MODBUS/TCP Slave

The PreciseFlex™ Controller can act as a MODBUS slave that can be accessed by MODBUS/TCP master devices using the MODBUS/TCP protocol.

A RIO board may be configured to operate in the same way if DataID 211 ("GPL MODBUS/TCP master") is set to TRUE.

As a MODBUS slave, the Controller provides an array of 16-bit holding registers that both external masters and GPL programs can read and write. These registers may be used to pass data between a GPL program and a MODBUS master. The holding register values are stored within the Parameter Database as "MODBUS/TCP holding register" (DataID 561).

The following function codes are supported by the Controller when used as a slave:

Function Code Function Name Description

3

Read holding registers

Read one or more MODBUS holding register. Register numbers from 1 to 16.

6

Write single register

Write a single MODBUS holding register. Register numbers from 1 to 16.

16

Write multiple registers

Write multiple MODBUS holding registers. Register numbers from 1 to 16.

43, MEI type 13

Read Device Identification

Read string values identifying the Controller.

 

For this mode of operation, the MODBUS master must set the Slave ID code to 255 when accessing the Controller.

Configuration

Both a standard PreciseFlex™ robot controller and a Remote I/O (RIO) board can be configured to act as a MODBUS slave and accept requests from external MODBUS masters.

The table below describes the parameters related to this feature.

Parameter Database ID Parameter Name Default Value Description

211

GPL MODBUS/TCP master

TRUE for standard controllers, FALSE for RIO boards

If TRUE, a RIO board operates like a Guidance Controller and can act as a MODBUS/TCP master to access other RIO boards.

Always TRUE for Guidance controllers. For RIO boards, must be FALSE if the RIO is to act as a standard remote I/O board.  May be set TRUE for RIO boards that act as intelligent controllers.

If TRUE, this controller maps MODBUS/TCP slave requests to holding registers in DataID 561.

If FALSE, this controller maps slave requests directly to I/O ports.

The controller must be rebooted for changes to take effect.

552

Remote IO max input time in sec

2

If the master controller does not issue periodic read or write requests within this time period, the connection is closed and an error is signaled. Set to 0 to disable this check.

560

MODBUS master IP address

"" (null) for standard controllers

"255.255.255.255" for RIO boards

Array of strings containing IP addresses that specify which MODBUS/TCP masters are allowed to connect to this controller. Set to "" to disallow connections. Set to "255.255.255.255" to allow any master.

561

MODBUS/TCP holding registers

0

An array of numeric values that contains the values of MODBUS/TCP holding registers accessed by MODBUS/TCP masters if DataID 211 is TRUE. These values act as the interface between GPL programs and the holding registers.