Chapter 9. Modbus/TCP ClientGFK-2224Q January 2017 145location of the CRS word, you must specify a zero for the offset. The offset for %R100 would be 99 decimal.Note that this is the only zero-based field in the Channel commands.(Word 5): Reserved. Set to zero.(Word 6): Reserved. Set to zero.(Words 7 and up) Data Block: The Data Block defines the Channel command to be performed. For informationon how to fill in the Channel command information, see the next section.9.3 Modbus/TCP Channel CommandsThis section describes the operation of the Channel commands. A detailed description and example of eachChannel command is included. There are four Channel commands:▪ Open a Modbus/TCP Connection▪ Close a Modbus/TCP Connection▪ Read Data from a Modbus Server Device to the PLC▪ Write Data from the PLC to a Modbus Server Device▪ Mask Write Register Request to a Modbus Server Device▪ Read/Write Multiple Registers between PLC memory and a Modbus Server DevicePlease note that Modbus/TCP channel COMMREQs (unlike SRTP channel COMMREQs) do not contain aparameter to configure a timeout value. Enforcing a timeout for a Modbus channel command is at thediscretion of the user and must be implemented in the user application.Open a Modbus/TCP Client Connection (3000)The Modbus/TCP Ethernet interface transfers data to or from another Modbus/TCP device using a channel. Upto 32 channels are available for Modbus/TCP client communications. However, these 32 channels are sharedwith SRTP Channels so that the combination of SRTP Channels and Modbus/TCP Channels cannot exceed 32.The Open Modbus/TCP COMMREQ requests the communication subsystem to associate a channel with aremote Modbus/TCP device. Using the COMMREQs defined later in this document the PLC may transfer data toand from a remote device.Once a channel is allocated for Modbus/TCP Client communications, the channel remains allocated (i.e. anotherprotocol such as SRTP Channels cannot use the channel). The channel connection is released only when: theapplication program closes the channel, the channel is automatically closed when the PLC transitions to STOP,when the Ethernet interface uses a Redundant IP and the CPU transitions from the Active to the Backup unit,the Ethernet interface is reset or the underlying TCP connection is terminated.The IP address of the remote Modbus/TCP device is specified in the Open Modbus/TCP COMMREQ using thestandard dotted-decimal format. No other IP address format is accepted.The COMMREQ Status Word (CRS) indicates the success or failure of the Open Modbus/TCP Client ConnectionCOMMREQ. If the COMMREQ requests an invalid channel number or an already allocated channel theCOMMREQ fails and the CRS is set to a non-zero value to identify the failure. See the section “Status Data” laterin this document for detailed CRS failure codes.