4

COMMREQ Example

The input values for the Block Move Functions in this example are taken from the Open Modbus/TCP Connection (3000), Modbus/TCP Read (3003), and Close Modbus/TCP Connection (3001) Examples in this chapter.

Nicknames 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 can be assigned as you choose.

1

2

3

4

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 be cleared and the COMMREQ fault output coil be cleared each time before initiating a COMMREQ function.

GFK-1541B

Chapter 4 Programming Modbus/TCP Channel Commands

4-27

Page 142
Image 142
GE GFK-1541B manual Commreq Example