Rockwell Automation T3837 ICS Regent MODBUS Master Package for WINTERPRET User Manual
Page 6

MODBUS Master Package for W
INTERPRET
(T3837)
P D - 6048 August, 96
(Issue 1)
6
The ‘Write Command’ (WC) table is also used by the MODBUS master
function block code. In many ways, the WC table is similar to the RC table.
However, the WC table does not utilize a corresponding Write Variable
table because each “Write” only references a single variable. Table 4
defines the Write Command Table.
Table 4 - Write Command Table
Field
Size
Description
Node
Byte
The MODBUS node to notify when the value changes.
Function
Byte
The MODBUS function to use for notification.
MODBUS
Address
Word
The MODBUS address to use for notification.
Value
Word
The current value of the variable.
CRC
Word
Placeholder for the run-time calculated CRC of the MODBUS
command.
Last Value
Word
The last known value of the variable.
Reserved
Word
Reserved for internal use.
Every application scan the function block code is executed, each variable
defined in the WC table is examined by comparing its current value to the
contents of the Last Value field. If the two value differ, the Send Flag field is
set and the current value is copied into the Last Value field.
Each entry in the WC table, with the Send Flag set, causes a MODBUS
command to be sent. When the response is received, the Send Flag for that
variable is cleared. For the initial MODBUS scan, the Send Flag field is set
for every entry in the table. The WC table is processed from the initial entry
to the final entry in sequence. If no more MODBUS commands can be
sent, WC processing stops and resumes again on the same entry the next
time the function block code is executed.
Abstractly, the WC table can be thought of as a “Write” queue. This queue
is full for the initial MODBUS scan. Future pseudo code example refer to
the abstract WC table queue as the WRITEQ.
The tasks performed each time the function block code is executed are as
follows:
·
E
NABLE
is checked to see if the function block should be executed.
·
A check is made to see if this is the initial MODBUS scan. If so, local
variables and tables are initialized.
Note: