Slc ladder logic examples d-7 – Rockwell Automation 22-COMM-P PowerFlex Profibus Adapter User Manual
Page 95
SLC Ladder Logic Examples
D-7
Figure D.3 Drive 1 Control/Reference/Parameter Access Routine (continued)
Station 2 Speed Reference
The PowerFlex 40 parameter 38 - [Speed Reference] needs to be set to 5 ("RS485 [DSI] Port").
N19:7 is controlled elsewhere in the user program.
9
MOV
Move
Source
N19:7
314<
Dest
N20:7
314<
MOV
Station 2
Speed Reference
Write
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.
10
S:1
15
First Pass
U
B3:19
0
Station 2
Par Prot
Messaging
Request
This circuit utilizes the Parameter Protocol. A REQUEST to Station 2 is processed only
RESPONSE from Station 2 a zero must be sent and received to 'handshake' before the next REQUEST/RESPONSE
transaction can take place. For example:
Send a parameter read request --> Receive a param. read response --> Send a "0" --> Receive a "0" --> [Transaction compl.]
If the RESPONSE PCA Word 1 (N10:8) is "0", then a REQUEST can be initiated.
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)
N7:31 = PNU = the parameter number to read or write
N7:32 = Subindex = the DPI port # ("0" = Host or PowerFlex drive, "5" = 22-COMM-P, 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:8 = contains RC (the operation to be performed) and PNU (the parameter number to read or write) combined
N20:9 = Subindex (the DPI port #)
N20:10 = PVA #1 (the parameter value (high word))
N20:11 = PVA #2 (the parameter value (low word))
B3:19/0 is turned ON elsewhere in the program after a 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.
11
B3:19
0
Station 2
Par Prot
Messaging
Request
EQU
Equal
Source A
N10:8
0<
Source B
0
0<
EQU
Station 2
RESPONSE
PCA Word
MOV
Move
Source
N7:31
77<
Dest
N20:8
0<
MOV
Station 2
PCA Word
N7:30
0
RC bit 0
L
N20:8
12
PCA Word
RC bit 0
N7:30
1
RC bit 1
L
N20:8
13
PCA Word
RC bit 1
N7:30
2
RC bit 2
L
N20:8
14
PCA Word
RC bit 2
COP
Copy File
Source
#N7:32
Dest
#N20:9
Length
3
COP
IND Word
(Subindex)
once at a time, and after each