Read Data From A Modbus/Tcp Device (3003) - GE RX3i User Manual

Pacsystems
Hide thumbs Also See for RX3i:
Table of Contents

Advertisement

Chapter 9. Modbus/TCP Client

Read Data from a Modbus/TCP Device (3003)

The Read Data from a Modbus/TCP Device COMMREQ requests a data transfer from a Modbus/TCP device to
the PLC. The Read Data COMMREQ must reference an active Modbus/TCP channel previously established with
the Open Modbus/TCP Client Connection COMMREQ.
Registers, Coils or Exception Status data may be read from the remote Modbus/TCP device. The Modbus
Function Code specifies the data type. Valid Function Codes for the Read Data COMMREQ are presented in the
following table.
Function
Code
Description
1
Read Coils
2
Read Input Discretes
3
Read Multiple
Registers
4
Read Input Registers
7
Read Exception Status
24
Read FIFO Queue
The table above describes the general Modbus server memory areas. The actual memory accessed is
dependent on how the server maps the Modbus memory regions to the server's local memory.
An Address and Length specify the location of the data in the remote device and the number of data units to
transfer. The Length is the number of Registers or Coils to transfer. Modbus Function Code 7, Read Exception
Status does not require the address as the remote device retrieves the exception status from an internal
location.
When transferring data between server bit or coil memory to PLC bit memory, only the number of bits specified
is transferred. For example, if the COMMREQ requests to read 9 coils from the Remote Device and requests to
put the data at %M00001 in the Local PLC (using a bit type memory type), %M00001 through %M00009 will be
updated with the data from the Remote Device and %M00010 through %M00016 will be unaffected. However,
if server bit or coil memory is transferred to PLC byte or word memory, the following rules apply:
1.
Transferring discrete data from the Remote Device to Local PLC Word (16-bit) memory: If the number of
requested coils is not a multiple of 16, the data is padded with 0s to a 16-bit boundary. For example if the
COMMREQ requests reading 17 coils from the Remote Device and requests to place this data at %R00010,
%R00010 (all 16 bits) and bit 0 of %R00011 will be updated with values from the Remote Device and bits 1
through 15 of %R00011 will be set to 0.
2.
Transferring discrete data from the Remote Device to Local PLC byte memory (using byte type memory
type): If the number of requested coils is not on an 8-bit boundary, the data is padded with 0s to an 8-bit
boundary. For example if the COMMREQ requests 9 coils from the Remote Device and requests to place
this data at %M00001, %M00001 through %M00009 will be updated with values from the Remote Device
and %M00010 through %M00016 will be set to 0.
Data returned from the remote device is stored in the PLC data area specified in the Read Modbus/TCP Device
COMMREQ. Data can be stored in any of the PLC data areas. Refer to Local PLC Memory Type on page 150 for
the list of data areas and identification codes for the PLC. Note that the first item referred to in each data area
is item 1 (not item 0).
The COMMREQ Status Word (CRS) indicates the success or failure of the Read Data COMMREQ. If the COMMREQ
requests an invalid channel number or any other field is invalid the COMMREQ fails and the CRS is set to a non-
148
PACSystems* RX7i & RX3i TCP/IP Ethernet Communications User Manual
Modbus Server Memory
Region Accessed
Internal Bits or Physical coils
Physical Discrete Inputs
Internal Registers or Physical
Output Registers
Physical Input Registers
Server Exception Memory
Internal Registers or Physical
Output Registers
Data Unit Size
Maximum Data Units
Bit
2000
Bit
2000
Register
125
(16-bit Word)
Register
125
(16-bit Word)
Byte
Not Applicable
Register
32
(16-bit Word)
GFK-2224Q

Advertisement

Table of Contents
loading

This manual is also suitable for:

Rx7i

Table of Contents