Chapter 9. Modbus/TCP Client
GFK-2224Q
January 2017
145
location 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 information
on how to fill in the Channel command information, see the next section.
9.3
Modbus/TCP Channel Commands
This section describes the operation of the Channel commands. A detailed description and example of each
Channel 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 Device
Please note that Modbus/TCP channel COMMREQs (unlike SRTP channel COMMREQs) do not contain a
parameter to configure a timeout value. Enforcing a timeout for a Modbus channel command is at the
discretion 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
. Up
to 32 channels are available for Modbus/TCP client communications. However, these 32 channels are shared
with 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 a
remote Modbus/TCP device. Using the COMMREQs defined later in this document the PLC may transfer data to
and from a remote device.
Once a channel is allocated for Modbus/TCP Client communications, the channel remains allocated (i.e. another
protocol such as SRTP Channels cannot use the channel). The channel connection is released only when: the
application 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 the
standard 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 Connection
COMMREQ. If the COMMREQ requests an invalid channel number or an already allocated channel the
COMMREQ fails and the CRS is set to a non-zero value to identify the failure. See the section “Status Data” later
in this document for detailed CRS failure codes.
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: ......