Chapter 9. Modbus/TCP Client
GFK-2224Q
January 2017
163
COMMREQ Ladder Logic Example
The input values for the Block Move Functions in the example below are taken from the Open Modbus/TCP
Connection (3000), Modbus/TCP Read (3003), and Close Modbus/TCP Connection (3001) Examples in this
chapter.
Named variables are used in this example to make the ladder program easier to follow. LANIFOK is bit 16 of
the LAN Interface Status bits. LAN_OK is bit 13 of the LAN Interface Status bits. All other nicknames may be
assigned as you choose.
1
2
3
4
Figure 58: COMMREQ Ladder Logic Segment
Rung # 1
: Input LANIFOK (bit 16 of the LAN Interface Status bits) monitors the health of the Ethernet interface.
Input LAN_OK (bit 13 of the LAN Interface Status bits) monitors the online/offline status of the Ethernet
interface. If both bits are set it is OK to send a COMMREQ and the ETH_READY coil is ON. ETH_READY is used as
an interlock for Rungs 2-16.
Rung # 2
: When ETH_READY is set, Input DO_OPEN triggers OPEN_REQ, which enables execution of the MOVE
and COMMREQ functions for the Open Modbus/TCP Connection COMMREQ. OPEN_REQ is a one-shot (Positive
Transition) coil, activating once when both ETH_READY and DO_OPEN have transitioned from OFF to ON.
Rung # 3
: The MOVE WORD function moves a zero to the CRS word referenced in the Command Block (see
rung #4). This clears the CRS word. This rung also resets the OPEN_FLT output coil of the COMMREQ Function
Block in rung #5.
It is vital that the CRS Status Word is cleared and the COMMREQ fault output coil be cleared each time before
initiating a COMMREQ function.
Rung # 4
: The BLKMV INT functions set up the COMMREQ Command Block contents. When this rung is
activated, the constant operands are moved into the memory beginning at the address indicated in the
instruction. The constant operands in this example are defined in the Open Modbus/TCP Connection Example
in this chapter.
Summary of Contents for PACSystems RX7i
Page 45: ......
Page 80: ...Chapter 4 Configuration GFK 2224Q January 2017 67 ...
Page 81: ......
Page 122: ...Chapter 6 Programming EGD Commands GFK 2224Q January 2017 109 ...
Page 147: ......
Page 211: ......
Page 262: ...Chapter 13 Network Administration GFK 2224Q January 2017 249 ...
Page 263: ......