MBSlaveUDP

Function Block - MODBUS UDP Slave protocol on ETHERNET.

Inputs

IN : BOOL    Enabling command: the port is open when this input is TRUE
PORT : DINT  ETHERNET port number
SLV : DINT   MODBUS slave number
RTU : BOOL   Protocol: TRUE = MODBUS RTU / FALSE = Open MODBUS

Outputs

Q : BOOL      TRUE if the port is successfully open

Remarks

When active, this function block manages the MODBUS UDP Slave protocol on the specified ETHERNETport. 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 MBSlaveUDP working simultaneously on different serial ports. Other MODBUS Slave connections (TCP server, serial) 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. If SLV is 0 then the default port number from the MODBUS configuration is used.

ST Language

(* MySlave is a declared instance of MBSlaveUDP function block *)
MySlave (IN, PORT, SLV, RTU);
Q := MySlave.Q;

FBD Language

LD Language

IL Language:

(* MySlave is a declared instance of MBSlaveUDP function block *)
Op1: CAL    MySlave (IN, PORT, SLV, RTU)
     LD     MySlave.Q
     ST     Q
     LD     MyCounter.CV
     ST     CV

See also

MBSlaveRTU   MODBUS configuration