Function Description

You can select one of 14 available network communication operations using the MBP_MSTR function block.

The MBP_MSTR block is supported on various hardware platforms.

EN and ENO can be configured as additional parameters.

NOTE: Verify that the programmer is familiar with the routing procedures of your network when programming an MBP_MSTR function block. Modbus Plus routing path structures are described in detail in the communication architectures manual and the Modbus Plus Network Planning and Installation Guide. If TCP/IP or SY/MAX Ethernet routing is implemented, use standard EtherNet IP router products.

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: In FBD and LD sections, this function block can be used on the program level and with derived function blocks (DFBs). When using DFBs, verify that the parameters CONTROL and DATABUF are directly connected to the I/O pins of the DFB.
NOTE: A TCP/IP communication between a Quantum PLC and a Momentum PLC is only possible when one read or write job is carried out in every cycle. If several jobs are sent per PLC cycle, the communication stops without generating a detected error message in the status register of the function block.
NOTE: In Quantum or Premium Hot Standby, to help prevent the former standby CPU from executing communication functions (now in RUN offline state), add a condition on the status bits to disable the function if the CPU is offline.

Example:

  • You can send MBP_MSTR.Enable:=(HSBY_NOEPLCMSTR_ON) AND (%SW61.1) AND NOT (%SW61.0)

    or

  • You can create a boolean variable, primary_state:=(%SW61.1) AND NOT (%SW61.0), and insert it for executing the section

NOTE: In M580 Hot Standby, to help prevent the former standby CPU from executing communication functions (now in RUN offline state), add a condition on the status bits to disable the function if the CPU is offline.

Example:

  • You can set MBP_MSTR.Enable:=(HSBY_NOEPLCMSTR_ON AND ECPU_HSBY_1.LOCAL_HSBY_STS.RUN_PRIMARY)

    or

  • Use the boolean variable ECPU_HSBY_1.LOCAL_HSBY_STS.RUN_PRIMARY as condition for executing the section

NOTE: Several copies of this function block can be used in the program. However, multiple instancing of these copies is not possible.

Representation in FBD

Representation in LD

Input Parameters

Parameter

Data Type

Description

ENABLE

BOOL

When ON, the operation specified in the first element of the CONTROL register is enabled.

ABORT

BOOL

When ON, the currently active operation is aborted.

Output Parameters

Parameter

Data Type

Description

ACTIVE

BOOL

ON when the operation is active.

ERROR

BOOL

ON when the operation is aborted without success.

SUCCESS

BOOL

ON when the operation concludes successfully.

CONTROL

WORD

This field contains the control block. The first element CONTROL[1] contains the number of the operation code of the operation to be performed. The content of the sequence register is determined by the operation.

Verify that the data field is declared as a located variable.

The structure of the control block differs according to the network used.

DATABUF

WORD

For operations providing data (for example a write operation) the data field is the data source. For operations receiving data (for example a read operation) the data field is the data destination.

With Ethernet CTE read and write operations, the data field holds the contents of the Ethernet configuration extension table. Verify that DATABUF is defined as an array of at least 10 elements in this case.

Verify that the data field is declared as a located variable.

Runtime Error

In the event of a detected error occurring during an MBP_MSTR operation, a hexadecimal error code is displayed in the CONTROL[2] register of the control block for one cycle.

NOTE: Function error codes are network-specific.
NOTE: For a list of all block error codes and values, refer to the tables of error codes for the communication library.