5 sample slc ladder - station 2 parameter protocol – Rockwell Automation RECOMM-PBUS PROFIBUS Communications Module User Manual
Page 88
7-14
PROFIBUS Communications Module
7.5
Sample SLC Ladder - Station 2
Parameter Protocol
Figure 7.11 – Sample SLC Ladder Logic - Station 2 Parameter Protocol (Continued)
This circuit utilizes the Parameter Protocol. A REQUEST to Station 2 is processed only one at a time, and after each
RESPONSE from Station 2 a zero must be sent and received to 'handshake' before the next REQUEST/RESPONSE transaction
can take place. For example:
Elsewhere in the user program these words must be loaded with message data prior to initiating the REQUEST:
N7:30 = RC = the operation to be performed ("1"=Read, "2" = 16-bit Write, "3" = 32-bit Write)
N7:31 = PNU = the parameter number to read or write
N7:32 = Subindex = the DPI port # ("0"= Host or SP600 drive, "5" = RECOMM-PBUS, etc.)
N7:33 = PVA #1 = the parameter value (high word) - only used when writing parameters
N7:34 = PVA #2 = the parameter value (low word) - only used when writing parameters
The four Parameter Protocol Words set up in the scanner are used to perform the Parameter Protocol:
N20:24 = contains RC (the operation to be performed) and PNU (the parameter number to read or write) combined
N20:25 = Subindex (the DPI port #)
N20:26 = PVA #1 (the parameter value (high word))
N20:27 = PVA #2 (the parameter value (low word))
Send a parameter read request --> Receive a parameter read response --> Send a "0" --> Receive a "0" --> [Transaction complete]
If the RESPONSE PCA Word 1 (N10:24) is "0", then a REQUEST can be initiated.
B3:19/0 is turned ON elsewhere in the program after the REQUEST message (N7:30-34) is loaded. This causes one Parameter
Protocol read or write to occur and B3:19/0 is turned OFF when the transaction is complete.
0016
B3:19
0
Station 2
Par Prot
Messaging
Request
EQU
Equal
Source A
N10:24
0<
Source B
0
0<
EQU
Station 2
RESPONSE
PCA Word
MOV
Move
Source
N7:31
9<
Dest
N20:24
0<
MOV
Station 2
PCA Word
N7:30
0
RC bit 0
L
N20:24
12
PCA Word
RC
bit 0
N7:30
1
RC bit 1
L
N20:24
13
PCA Word
RC
bit 2
COP
Copy File
Source
#N7:32
Dest
#N20:25
Length
3
COP
IND Word
(Subindex)
This section of the routine is only needed if the application needs to perform Parameter Protocol Reads or Writes to Station 2.
On power-up, initialize the Parameter Protocol routine.
0015
S:1
15
First Pass
U
B3:19
0
Station 2
Par Prot
Messaging
Request