Function description
The READ_REG_QX
function is used to read registers
in a Modbus slave connected to a Modicon X80 serial communication module located in an EIO drop.
When programming a READ_REG_QX
function,
you must be familiar with the routing procedures used by your network. Modbus Plus routing path structures are described
in detail in chapter Addressing
for a Modbus Plus Communication Entity and in the Modicon Modbus Plus Network Planning
and Installation Guide.
The additional
parameters EN
and ENO
can be configured.
The communication function blocks use one data transaction path and require multiple cycles to complete an operation. The number of transaction paths available by module and by MAST cycle depends on the communication port used:
Modbus Plus embedded port or NOM modules support up to 4 blocks at the same time.
TCP/IP Ethernet embedded port support up to 4 blocks at the same time.
TCP/IP Ethernet NOE, NOC, and 140 CRP 312 00 modules support up to 16 blocks at the same time.
More communication function blocks may be programmed on the same communication port. However, a communication block exceeding the maximum number on that port is not serviced until one of the transaction paths is available. Then, the next block on the same port becomes active and begins using an available path.
Representation in FBD
Representation:

Representation in LD
Representation:

Representation in IL
Representation:
CAL READ_REG_QX_Instance (ENABLE:=ReadRegQxEnable,
ABORT:=ReadRegQxAbort, ADDR:=ModuleAddress, NO_REG:=NbRegistersToRead,
SLAVEREG:=SlaveAddress, IEC:=IndexAdjust, DONE=>ReadRegQxSuccessfull,
ACTIVE=>ReadRegQxActive, ERROR=>ReadRegQxFaulty, STATUS=>ErrorCode,
REG_READ=>ReadData)
Representation in ST
Representation:
READ_REG_QX_Instance (ENABLE:=ReadRegQxEnable,
ABORT:=ReadRegQxAbort, ADDR:=ModuleAddress, NO_REG:=NbRegistersToRead,
SLAVEREG:=SlaveAddress, IEC:=IndexAdjust, DONE=>ReadRegQxSuccessfull,
ACTIVE=>ReadRegQxActive, ERROR=>ReadRegQxFaulty, STATUS=>ErrorCode,
REG_READ=>ReadData)
Parameter description
Description of input parameters:
Parameter |
Data type |
Meaning |
---|---|---|
|
|
Set to 1 to read registers. |
|
|
Set to 1 to abort the current operation. |
|
|
Array containing the Modbus slave address, result of ADDMX function. |
|
|
Number of registers to be read in the Modbus slave. |
|
|
Offset address of the first |
|
|
Index adjust applied to
|
Description of output parameters:
Parameter |
Data type |
Meaning |
---|---|---|
|
|
Set to 1 when the execution of the function is completed successfully. |
|
|
Set to 1 when the execution of the function is in progress. |
|
|
Set to 1 if an error is detected by the function block. |
|
|
Provides the error code if an error is detected by the function block. |
|
|
Read data (A data structure must be declared as a located variable to receive the response from the Modbus slave.) |