Skip to main content

Function Block: ModbusChannel

Library: IoDrvModbus

This function block starts the execution of a single configured Modbus channel.

Table 21. Inputs (VAR_INPUT)

Name

Data Type

Initial Value

Description

Slave

ModbusSlaveComPort

xExecute

BOOL

Rising edge: The action starts.

Falling edge: The outputs are reset when a falling edge occurs before the function block has ended the action. The outputs behave as usual and are reset only if the action is ended or has been aborted (xAbort), or if an error has occurred. In this case, the corresponding output values (xDone, xError, iError) exist at the outputs for exactly one cycle.

xAbort

BOOL

TRUE: The action is aborted immediately and all outputs are set to their initial values.

iChannelIndex

INT

The channel index to be executed. An invalid index leads to xError = TRUE (without Modbus-specific error code).



Table 22. Outputs (VAR_OUTPUT)

Name

Data Type

Initial Value

Description

xDone

BOOL

FALSE

TRUE when a request has been ended successfully

xBusy

BOOL

FALSE

TRUE as long as the request is being processed

xError

BOOL

FALSE

TRUE when a request has been ended with errors

xAborted

BOOL

FALSE

TRUE when the request has been aborted by the user

ModbusError

MB_ErrorCodes

Current error; defined in the MB_ErrorCodes enumeration.