The CREAD_REG block reads register data continuously from an addressed node via TCP/IP-Ethernet.
EN and ENO can be projected as additional parameters.
NOTE: About this function block:
-
When programming this function, you must be familiar with the routing procedures used by your network.
-
For technical reasons, this function block does not allow the use of ST and IL programming languages.
Block representation:
Description of parameters:
Parameter
|
Data Type
|
Meaning
|
SLAVEREG
|
DINT
|
offset address of the first %MW word (4x register) in the slave to be read from
|
NO_REG
|
INT
|
number of registers to be read from slave
|
AddrFld
|
WordArr5
|
data structure describing the TCI/IP address
|
REG_READ
|
WORD
|
first %MW word (4x register) for read values
|
STATUS
|
WORD
|
error code
|
Elementary Description for WordArr5 with TCP/IP Ethernet
Elementary description for WordArr5 with TCP/IP Ethernet:
Element
|
Data Type
|
Meaning
|
WordArr5[1]
|
WORD
|
Low value byte: MBP on Ethernet Transporter (MET) mapping index
High value byte: Slot of the NOE module
|
WordArr5[2]
|
WORD
|
Byte 4 (MSB) of the 32-bit destination IP address
|
WordArr5[3]
|
WORD
|
Byte 3 of the 32-bit destination IP address
|
WordArr5[4]
|
WORD
|
Byte 2 of the 32-bit destination IP address
|
WordArr5[5]
|
WORD
|
Byte 1 (LSB) of the 32-bit destination IP address
|
Function Mode of the CREAD_REG Block
CREAD_REG, CWRITE_REG, READ_REG, WRITE_REG, and MBP_MSTR 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.
NOTE: A TCP/IP communication between a Quantum PLC (NOE 771 ••) and a Momentum PLC (all TCP/IP CPUs and all TCP/IP I/O modules) is only possible, when only one read or write job is carried out in every cycle. If several jobs are sent per PLC cycle, the communication stops without generating an error message in the status register of the function block.
NOTE: A TCP/IP communication between a Quantum PLC (NOE 211 00) and a Momentum PLC (all TCP/IP CPUs and all TCP/IP I/O modules) is only possible, when only one read or write job is carried out in every cycle. If several jobs are sent per PLC cycle, the communication stops without generating an error message in the status register of the function block.
The entire routing information is contained in data structure WordArr5 of input AddrFld. The type of function block connected to this input and thus the contents of the data structure depends on the network used.
Please use:
NOTE: For experts: The WordArr5 data structure can be used with constants as well.
NOTE: This function block puts a heavy load on the network; therefore the network load must be carefully monitored. If the network load is too high, the program logic should be reorganized in order to work with the READ_REG function block, a variation of this function block that does not operate in a continuous mode, but under command control.
SLAVEREG is the start of the area in the addressed slave from which the source data is read. The source area always resides within the %MW word (4x register) area. SLAVEREG expects the source reference as offset within that area. (In 4x registers, the leading "4" must be omitted. For example, "59" (contents of the variables or value of the literal) = 40059).
The parameter can be specified as direct address, located variable, unlocated variable, or literal.
NO_REG is the number of registers to be read from the addressed slave (1 ... 100). The parameter can be entered as a direct address, located variable, unlocated variable, or literal.
The REG_READ word parameter addresses the first register in a series of NO_REG registers, listed one after the other, which are used as a destination data area. The parameter must be entered as a direct address or located variable.
Error code, see Runtime errors.
The STATUS parameter can be specified as direct address, located variable, or unlocated variable.