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 = enabled )

Input

byUnitId

BYTE

0

Address of the device

Input

InputValue

__SYSTEM.AnyType

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

Input

xUpdateSetp

BOOL

FALSE

Update of setpoint values (on every rising edge )

Input

xResError

BOOL

FALSE

Reinitialization of the outputs ‘eErrorCodeCom’ and ‘eErrorCodeDev’ to the error-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 (\nFC05) (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\nstate of the coil (0 = invalid, 1 = BOOL, 2 = BYTE)

Output

xInputValueValid

BOOL

FALSE

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

Output

xErrorFreeDataTransmission

BOOL

FALSE

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

Output

xAlarm

BOOL

General fault ( TRUE = fault )

Output

xAlarmCom

BOOL

General 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 -\n65535)

Input Const

tTimeUpdateSetp

TIME

TIME#0ms

Update interval for operations influenced by the input 'xUpdateSetp'

Last updated