Chapter 9. Modbus/TCP ClientGFK-2224Q January 2017 163COMMREQ Ladder Logic ExampleThe input values for the Block Move Functions in the example below are taken from the Open Modbus/TCPConnection (3000), Modbus/TCP Read (3003), and Close Modbus/TCP Connection (3001) Examples in thischapter.Named variables are used in this example to make the ladder program easier to follow. LANIFOK is bit 16 ofthe LAN Interface Status bits. LAN_OK is bit 13 of the LAN Interface Status bits. All other nicknames may beassigned as you choose.1234Figure 58: COMMREQ Ladder Logic SegmentRung # 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 Ethernetinterface. If both bits are set it is OK to send a COMMREQ and the ETH_READY coil is ON. ETH_READY is used asan interlock for Rungs 2-16.Rung # 2: When ETH_READY is set, Input DO_OPEN triggers OPEN_REQ, which enables execution of the MOVEand COMMREQ functions for the Open Modbus/TCP Connection COMMREQ. OPEN_REQ is a one-shot (PositiveTransition) 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 (seerung #4). This clears the CRS word. This rung also resets the OPEN_FLT output coil of the COMMREQ FunctionBlock in rung #5.It is vital that the CRS Status Word is cleared and the COMMREQ fault output coil be cleared each time beforeinitiating a COMMREQ function.Rung # 4: The BLKMV INT functions set up the COMMREQ Command Block contents. When this rung isactivated, the constant operands are moved into the memory beginning at the address indicated in theinstruction. The constant operands in this example are defined in the Open Modbus/TCP Connection Examplein this chapter.