MSTR Block Read Global Data Operation

For general information on the MSTR Block, see Using the MSTR Modicon Ladder Logic Block.

Note: This operation is only available for Modbus Plus and not Modbus/TCP.

 

This operation reads in Global Data registers from a particular slave device (such as the RMC). The read always begins with the first Global Data register on the device, but the number of registers read is set in the control block. For details on Global Data, see Using Modbus Plus Global Data.

 

Note: This operation will fail with an error code of 200B if Peer Cop is used. The two methods of accessing Global Data cannot be used at the same time.

 

Control Block

In a Read Global Data operation, the nine control-block registers are assigned as shown:

Register

Content

1st

Operation: 6

2nd

Error Status: This register is filled by the operation. See MSTR Block Error Codes for a complete list.

3rd

Length: Indicates the number of global data registers to read.

4th

Operation-dependent Value: Gets filled by the PLC with the number of registers of global data available from the slave.

5th

Routing 1: Address of the node to read global data from.

6th-9th

Routing 2-5: Unused. Set to zeros.

 

Example

Suppose that you wish to read four global data registers from each of the first four axes of the RMC located at node address 3. The commands to write are located in holding register 400400 through 400423. You must first choose a location for the 9-register control block. In this example, 400120 to 400128 is the location. The following MSTR block would be used:

image\ebx_-497016098.gif

As you can see, this function block indicates it will do an operation using the control block beginning at 400120, using up to 32 registers beginning at 400300. The next step is to set up the control block:

Register

Content

400120

6 (decimal): Operation type: Read global data

400121

0000 (hex): Error status: filled in by function

400122

16 (decimal): Length: we want the first 16 registers

400123

0 (decimal): Available Registers: filled in by function

400124

3 (decimal): Routing 1 (Node address)

400125-8

0 (decimal): Unused

 


Copyright (c) 1997-2015 by Delta Computer Systems, Inc.