Read/Write Data
Original instructions
Introduction
In a single transaction, the MSTR read and write operations can transfer data from a master source device to a specified slave destination device, then transfer data from this specified slave source to the master. It uses a master transaction path and may require several cycles to complete. To program an MBP_MSTR block to perform a combined read/write operation, use function code 23.
The combined read/write operation can be used only with these models:
Control Block Usage
Register
Content
CONTROL[1]
23 = read/write data.
CONTROL[2]
Indicates the error status.
CONTROL[3]
Number of registers to be sent to the slave.
CONTROL[4]
Specifies the %MW starting register in the slave to which the data will be written, e.g. 1 = %MW1, 49 = %MW49.
CONTROL[5]
Most significant byte: network adapter module slot.
Least significant byte: MBP on Ethernet Transporter (MET) mapping index.
CONTROL[6]
...
CONTROL[9]
Each address contains 1 byte of the 32-bit IP address, where the MSB is in CONTROL[6] and the LSB is in CONTROL[9].
CONTROL[10]
Number of registers to be read from slave.
CONTROL[11]
Specifies the %MW starting register in the slave from which the data is read, e.g. 1 = %MW1, 49 = %MW49.
NOTE:
When configuring the MBP_MSTR block for a read/write data operation, note that
  • The DATABUF output parameter is used to store, in the following sequence, both:
    1 the data to be written 2 the data to be read
  • The size of the DATABUF output parameter must equal the combined size of the data to be written and the data to be read; if the size is smaller, data will be overwritten and may be lost.
  • Both the CONTROL and DATABUF parameters must be stored at located addresses, for example %MW addresses.