ModbusTCPRequestServer (FB)ΒΆ
FUNCTION_BLOCK ModbusTCPRequestServer
This function block provides the option to control how MODBUS requests sent to this server are processed by the MODBUS server application
- InOut:
Scope
Name
Type
Initial
Comment
Input
xEnableBOOLFALSE
Flag to enable execution - default is FALSE
xResetBOOLFALSE
Flag to reset - default is FALSE
InterfaceNameWSTRING(255)Name of ethernet interface (optional). If specified, the modbus server binds to the IP address of this interface.
PortUINT502
Modbus server port - 502 is Modbus default
tSocketTimeoutTIMETIME#5s0ms
Modbus tcp connection timeout. Tcp socket is closed in case of a timeout
ModeRequest handling mode: Receive => Look for new request, Neg_Response => Sent a negative response for latest (unhandled) request, Pos_Response => Sent a positive response for latest (unhandled) request
ExceptionCodeBYTEException code used for the negative response
Inout
DataBufferCoilsARRAY [0..255] OF BYTE
Buffer for read and write data of bit access operations
DataBufferRegistersARRAY [0..127] OF WORD
Buffer for read and write data of register operations
Output
xBusyBOOLFunction block is active
xErrorBOOLAn Error occured
ErrorCodeUDINTLatest error code
xOnlineBOOLFunction block is running and not in error state
ClientConnectionsBYTE0
Number of open TCP-connections
xNewRequestBOOLTRUE if a new request was received
ModbusRequestModbusCommandContains the request data of the current request in processing
uiUnitIdUINTUnit-ID of the request
Methods:
Structure: