Function Block - MODBUS RTU Slave protocol on serial port.

Inputs

Input

Data type

Description

IN

BOOL

Enabling command: the port is open when this input is TRUE.

PORT

STRING

Settings string for the serial port (e.g. 'COM1:9600,N,8,1').

SLV

DINT

MODBUS slave number.

SrvID

STRING

MBSlaveRTUex only: ID of the server in the configuration.

Outputs

Output

Data type

Description

Q

BOOL

TRUE if the port is successfully open.

Remarks

When active, this function block manages the MODBUS RTU Slave protocol on the specified serial communication port. The configuration of the MODBUS Slave map (designing MODBUS addresses) is done using the MODBUS configuration tool, from the Fieldbus Configurator.

There can be several instances of the MBSlaveRTU working simultaneously on different serial ports. Other MODBUS Slave connections (TCP server, UDP) can also be active at the same time.

The slave number entered in the MODBUS Slave configuration tool is ignored when MODBUS Slave protocol is handled by this function block. Instead, the SLV input specifies the MODBUS slave number.

With MBSlaveRTUex, you can specify the ID of a server from the MODBUS slave configuration. If you specify an empty string, the first server is used. MBSlaveRTU always works with the first server in the configuration.

ST Language

MySlave is a declared instance of MBSlaveRTU function block.

MySlave (IN, PORT, SLV, SrvID);
Q := MySlave.Q;


Created with the Personal Edition of HelpNDoc: Transform your help documentation into a stunning website