4.2. Global Data

Each node of a Modbus Plus network can optionally transmit up to 32 words of global data to the other nodes when it relinquishes the network control token. The MBP_PUT_GLOBAL, MBP_GET_GLOBAL and MBP_CLEAR_GLOBAL requests provide access to this global data.

4.2.1. MBP_PUT_GLOBAL

The MPB_PUT_GLOBAL request allows a task to modify some or all of the global data table for the Modbus Plus node. Until an MBP_PUT_GLOBAL request is received by mbpadmin, the SA85 or PC85 does not send any global data to the other Modbus Plus nodes; that is, the amount of global data available from the SA85 or PC85 node is zero.

When mbpadmin receives an MBP_PUT_GLOBAL request, it updates the specified portion of the 32-word global data table and causes the SA85 or PC85 to start transmitting 32 words of global data whenever it passes the token. This global data continues to be available to other Modbus Plus nodes until an MBP_CLEAR_GLOBAL request sets the amount of available global data to zero. By means of the MBP_PUT_GLOBAL request any task can modify any portion of the node's global data.

The offset field of the mbp_put_global structure indicates the first word to modify in the 32 words of global data. It can range from 0 to 31.

The length field indicates how many of the 32 words to modify. It must be at least 1 and not more than 32.

The data field contains the length words of data to be put into the global data table.

If the SA85 or PC85 peer processor crashes before the receipt of the MBP_PUT_GLOBAL request, the MBP_R_CARD_DOWN result is returned in the response. If mbpadmin cannot correctly write the global data to the peer processor, the MBP_R_WRITE_FAILED response is returned. Otherwise, the response is MBP_R_OK.

4.2.2. MBP_CLEAR_GLOBAL

The MBP_CLEAR_GLOBAL request sets the amount of global data for the node to zero; that is, it causes the SA85 or PC85 card to stop sending global data to other nodes. No global data is sent until another MBP_PUT_GLOBAL request is received by mbpadmin.

If the SA85 or PC85 peer processor crashes before the receipt of the MBP_CLEAR_GLOBAL request, the MBP_R_CARD_DOWN result is returned in the response. If mbpadmin cannot correctly modify the global data through the peer processor, the MBP_R_WRITE_FAILED response is returned. Otherwise, the response is MBP_R_OK.

4.2.3. MBP_GET_GLOBAL

The MBP_GET_GLOBAL request allows a task to read the global data table corresponding to a particular Modbus Plus node. If any global data has been received by the SA85 or PC85 from the node specified in the request, mbpadmin gets it from the peer processor and returns it in the mbp_r_get_global response. The length of the returned global data is given in the length field of the response. If specified Modbus Plus node is down or has not generated any global data, the length field is zero.

If the SA85 or PC85 peer processor crashes before the receipt of the MBP_GET_GLOBAL request, the MBP_R_CARD_DOWN result is returned in the response. If mbpadmin cannot correctly write the request for global data to the peer processor, the MBP_R_WRITE_FAILED response is returned. Otherwise, the response is MBP_R_OK.