User manual

Transferring Data Using Communication Blocks
33002479 06 07/2008 165
Write Data
Description A write operation transfers data from a master source device to a specified slave
destination device on the network. It uses a master transaction path and may require
several cycles to complete. To program an MBP_MSTR block to perform a write
operation, use function code 2 (see Operational Function Codes, p. 151).
Network
Implementation
The write operation can be performed on Modbus Plus, TCP/IP Ethernet, and SY/
MAX Ethernet networks.
Control Block
Usage for
Modbus Plus
Note: Do not attempt to program an MBP_MSTR to write to its own drop address.
This action causes the function block to generate an error in the CONTROL[2]
register of the control block (see Network Control Block Structures, p. 152).
You can perform a write operation to a nonexistent slave register. The slave
detects the status and logs it. This can last for several cycles.
Register Meaning
CONTROL[1] 1 = write data
CONTROL[2] Indicates the error status
CONTROL[3] Number of addresses sent to the slave
CONTROL[4] Determines the %MW starting register in the slave to which the data is
written, e.g. 1 = %MW1, 49 = %MW49
CONTROL[5]
...
CONTROL[9]
Routing register 1 is used to specify the address (routing path address 1 of
5) of the node during a network transfer.
The last byte in the routing path that is not 0 is the destination node.