D.1 single drive example, D.1.1 main routine – Rockwell Automation MD65 Profibus Communication Card User Manual
Page 88

D-2
PROFIBUS Communications Module
D.1 Single Drive Example
D.1.1 Main Routine
This example program is for a PROFIBUS demonstration using a SLC 5/04 processor with an SST Profibus scanner
(
SST-PFB-SLC) in the first slot of the rack. The program is written for 2 drives on the network:
Station 1 MD65 with MDCOMM-PBUS
Station 2 MD65 with MDCOMM-PBUS
The example program demonstrates using Logic Command / Reference, Logic Status / Feedback and Parameter
Access using the Parameter Protocol.
On power-up, zero out the transmitt buffer to the Scanner.
0
S:1
15
First Pass
FLL
Fill File
Source
0
Dest
#N20:0
Length
12
FLL
1
MOV
Move
Source
S:3
2561<
Dest
M0:1.4011
?<
MOV
The Scanner is configured to 12 bytes (6 words) of inputs for each drive. Two drives require 24 bytes (12 words).
Read the drives data from the Profibus scanner.
File N10: contains the acutal read data that can be used elsewhere in the ladder program.
Station 1 Station 2
Description
M1:1.0 (N10:0) M1:1.6 (N10:6)
Logic Status
M1:1.1 (N10:1) M1:1.7 (N10:7) Speed Feedback
M1:1.2 (N10:2) M1:1.8 (N10:8) Parameter Protocol Word 1 (PCA)
M1:1.3 (N10:3) M1:1.9 (N10:9) Parameter Protocol Word 2 (IND)
M1:1.4 (N10:4) M1:1.10 (N10:10)
Parameter Protocol Word 3 (PVA 1)
M1:1.5 (N10:5) M1:1.11 (N10:11)
Parameter Protocol Word 4 (PVA 2)
2
COP
Copy File
Source
#M1:1.0
Dest
#N10:0
Length
12
COP
Execute LAD 3 - Station 1 Drive Logic
3
JSR
Jump To Subroutine
SBR File Number
U:3
JSR
Execute LAD 4 - Station 2 Drive Logic
4
JSR
Jump To Subroutine
SBR File Number
U:4
JSR
Automatically have the SST-PFB-SCL scanner's watchdog period track that of the
SCL processor (recommended per SST user manual)
Write the drives' data to the profibus scanner.
File N20: contains the actual write data generated elsewhere in the ladder program.
Station 1 Station 2
Description
M0:1.0 (N20:0) M0:1.6 (N20:6)
Logic Command
M0:1.1 (N20:1) M0:1.7 (N20:7)
Speed Reference
M0:1.2 (N20:2) M0:1.8 (N20:8)
Parameter Protocol Word 1
(PCA)
M0:1.3 (N20:3) M0:1.9 (N20:9)
Parameter Protocol Word 2 (IND)
M0:1.4 (N20:4) M0:1.10 (N20:10) Parameter Protocol Word 3 (PVA1)
M0:1.5 (N20:5) M0:1.11 (N20:11) Parameter Protocol Word 4 (PVA2)
5
COP
Copy File
Source
#N20:0
Dest
#M0:1.0
Length
12
COP
6
END