G-2 plc-5 example ladder program, Figure g.1 example plc-5 ladder logic program – Rockwell Automation 22-SCM-232 Serial Converter Module User Manual

Page 78

Advertising
background image

G-2

PLC-5 Example Ladder Program

Figure G.1 Example PLC-5 Ladder Logic Program

PLC-5 communications to a PowerFlex 4/40 using a 22-SCM-232

Connection:
The 22-SCM-232 connects to Channel 0 on the processor (DB25 connector) via a 3rd party 9-to-25 pin
adapter (Male-to-Male), and the RJ45 port on the PowerFlex 4/40. It provides both media (RS232 to
RS485) and protocol (DF1 to Modbus RTU) conversions.

Additional PF4/40 drives can be added. Use one AK-U0-RJ45-SC1 Splitter Cable for connecting to the
first drive, and one AK-U0-RJ45-TB2P for every drive. The "Local Node Address" in the MSG instruction
identifies the drive node to communicate with.

PF4 Parameters: 22-SCM-232 parameters:
36 [Start Source] = 5 (Comm Port) 1[Adapter Cfg] = RTU Master
38 [Speed Reference] = 5 (Comm Port) 2[DF1 Addr Cfg] = 1 (this MUST equal Parameter 104 of the PF
4/40 it is connected to)
103 [Comm Data Rate] = 4 (19.2K) 3 [DF1 Rate Cfg] = 19.2k bps
104 [Comm Node Addr] = 1
107 [Comm Format] = 0 (RTU 8-N-1)

For the PowerFlex 4/40 drives, 19.2K and 8-N-1 are a requirement and can not be changed. The data rate
of the controller and SCM MUST be equal to each other, but can be set faster or slower than the drives
baud rate if desired. It is recommended that 19.2K be used for ALL serial connections (controller, SCM,
and drives) to be consistent and to avoid any errors.

This rung clears the read data area (N7:10-19) on the first program scan (N7:0 = a constant 0).

0000

S:1

15

First Pass

COP

Copy File
Source

#N7:0

Dest

#N7:10

Length

10

COP

Logic Status

0001

I:001

0

Stop
PB

N7:20

0

Logic Command
STOP

0002

I:001

1

Start
PB

I:001

0

Stop
PB

N7:20

1

Logic Command
START

0003

I:001

2

Jog
PB

I:001

0

Stop
PB

N7:20

2

Logic Command
JOG

0004

I:001

3

Reset
PB

N7:20

3

Logic Command
RESET

Advertising