ModbusRequest2 (FB)¶
FUNCTION_BLOCK ModbusRequest2
- InOut:
Scope
Name
Type
Initial
Comment
Input
xExecuteBOOL- Rising edge: Action start
Falling edge: Resets outputs If a falling edge occurs before the function block has completed its action, the outputs operate in the usual manner and are only reset if either the action is completed or aborted (xAbort), or in the event of an error. In this case, the corresponding output values (xDone, xError, iError) are present at the outputs for exactly one cycle.
xAbortBOOLIf this input is TRUE, the action is stopped immediately and all outputs are reset to their initial values.
hComPortRTS_IEC_HANDLEusiSlaveAddrUSINTSlave address, range 1..247
modbusCommandThe Modbus Command to be executed. Supports FCs for bit and word access
tResponseTimeoutTIMETimeout for the request in ms
uiSendTimeoutUINT100
Timeout sending request
pSendDataPOINTER TO BYTE
Pointer to a buffer holding the data to be send to the Slave
pRecvDataPOINTER TO BYTE
Pointer to a buffer for writing the data received from a Slave
transmissiontransmission type (RTU or ASCII)
Output
xDoneBOOLxBusyBOOLxErrorBOOLxAbortedBOOLuiDataLengthBYTElength of modbus-data received from slave (in bytes)
byModbusErrorMB_ErrorCodes.UNDEFINED
Specifies the current error as defined in the “MB_ErrorCodes” enumeration