SimpleWriteCoil_FC05

SimpleWriteCoil_FC05 (FB)

FUNCTION_BLOCK SimpleWriteCoil_FC05

Transmission of the state of a coil (FC05) to an address (wCoilAddr)

CODESYS

InOut:

Scope
Name
Type
Initial
Comment

Input

xEn

BOOL

TRUE

Enable / disable communication (TRUE = enable)

Input

byUnitId

BYTE

0

Address of the device

Input

InputValue

__SYSTEM.AnyType

Input variable to determine the state of the coil (FC05) (BOOL, BYTE)

Input

xUpdateSetp

BOOL

FALSE

Update setpoints (on every rising edge)

Input

xResError

BOOL

FALSE

Reinitialize the outputs 'eErrorCodeCom' and 'eErrorCodeDev' to the fault-free state (on every rising edge)

Inout

ModbusClient

ModbusClientBase

Client of the device

Output

wCoilAddrFb

WORD

Feedback - address of the coil for the Modbus telegram (FC05) (0 - 65535)

Output

eInputValueDataType

SIMPLE_WRITE_COILS_FC05_DATA_TYPE

SIMPLE_WRITE_COILS_FC05_DATA_TYPE.INVALID_TYPE

Internal classification of the data type of the variable with the state of the coil (0 = invalid, 1 = BOOL, 2 = BYTE)

Output

xInputValueValid

BOOL

FALSE

Validity of the input variable 'InputValue' (FALSE = not valid, TRUE = valid)

Output

xErrorFreeDataTransmission

BOOL

FALSE

Status of the data transmission (FALSE = faulty, rising edge = error-free)

Output

xAlarm

BOOL

Collective fault (TRUE = fault)

Output

xAlarmCom

BOOL

Collective fault - communication (TRUE = fault)

Output

eErrorCodeCom

ModbusErrorCode

Error code - communication (0 = no error)

Output

eErrorCodeDev

SIMPLE_WRITE_COIL_ERROR_CODE

Error code - device (0 = no error)

Output

xBusy

BOOL

Communication indicator (TRUE = communication)

Input Const

wCoilAddr

WORD

Address of the coil for the Modbus telegram (FC05) (0 - 65535)

Input Const

tTimeUpdateSetp

TIME

TIME#0ms

Update interval for the operations influenced by the input ‘xUpdateSetp’

Last updated