SimpleWriteValueFloat

SimpleWriteValueFloat (FB)

FUNCTION_BLOCK SimpleWriteValueFloat

Use of type conversion operators (e.g. INT_TO_REAL) directly at the input ‘InputValue’

In this constellation, compiler error messages of type C0032 are generated; a download is not possible. Workaround: Use an intermediate variable of explicit type REAL directly at the output of the type conversion operator. Connect the intermediate variable to the input ‘InputValue’.

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 ( FC16 ) ( REAL, LREAL )

Input

rMultiplier

REAL

1.0

Multiplier for the input variable

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

wRegisterAddrFb

WORD

Feedback - start address of the register for the Modbus telegram

Output

eFormatFb

SIMPLE_WRITE_FORMAT_CODE

Feedback - format of the floating point number

Output

eTypeInputValue

SIMPLE_WRITE_VALUE_TYPE_CODE

SIMPLE_WRITE_VALUE_TYPE_CODE.STATE_INVALID

Sign state of the value at the input ‘InputValue’

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_VALUE_ERROR_CODE

Error code - device (0 = no error)

Output

xBusy

BOOL

Communication indicator ( TRUE = communication )

Input Const

lrDevMinus_64Bit

LREAL

0.0

Maximum negative value change before triggering a transmission (64 bit)

Input Const

lrDevPlus_64Bit

LREAL

0.0

Maximum positive value change before triggering a transmission (64 bit)

Input Const

rDevMinus_32Bit

REAL

0.0

Maximum negative value change before triggering a transmission (32 bit)

Input Const

rDevPlus_32Bit

REAL

0.0

Maximum positive value change before triggering a transmission (32 bit)

Input Const

xSwapValue

BOOL

TRUE

Enable/disable swapping of the byte positions of a register (16 bit) (only relevant for 32/64 bit)

Input Const

xBigEndian

BOOL

TRUE

Position of the most significant 8 bits in a datum (only relevant for 32/64 bit)

Input Const

eFormat

SIMPLE_WRITE_FORMAT_CODE

SIMPLE_WRITE_FORMAT_CODE.IEEE754_32BIT

FALSE = most significant 8 bits are sent last // TRUE = most significant 8 bits are sent first Format of the floating point number

Input Const

wRegisterAddr

WORD

Start address of the register for the Modbus telegram

Input Const

tTimeUpdateSetp

TIME

TIME#0ms

Update interval for operations influenced by the input 'xUpdateSetp'

Last updated