SimpleWriteArrayOfInt

SimpleWriteArrayOfInt (FB)

FUNCTION_BLOCK SimpleWriteArrayOfInt

Representation

Triggering the transmission of Modbus data

The data transmission is triggered if at least one of the conditions described below is met:

Requirement: A suitable array is connected to input ariInputArray . This is signaled by output xInputArrayValid (= TRUE).

  1. after an edge change at input xUpdateSetp (FALSE >> TRUE) (once)

  2. after the expiry of the duration tTimeUpdateSetp (tTimeUpdateSetp > 0) (cyclic)

  3. after a change to the array at the input ariInputArray (data type, size, contents) (once)

  4. after a change of essential parameters (byUnitId, wRegisterAddr) (once)

  5. after an edge change at input xEn (FALSE >> TRUE) (once)

  6. after each cold start (once)

Note: The data type of the array at input ariInputArray cannot be recognized and evaluated as of 07/07/2023 (CDS-43675 Compiler, AnyType: Extension for Arrays needed) In the tooltip help for input ariInputArray the possible array data types are displayed depending on the selected function code.

InOut:

Scope
Name
Type
Initial
Comment

Input

xEn

BOOL

TRUE

Enable / disable communication (TRUE = enable)

Input

byUnitId

BYTE

0

Modbus address of the device

Input

ariInputArray

__SYSTEM.AnyType

Input for the array of data to be written (FC16, ARRAY OF INT (16 bits per element))

Input

xUpdateSetp

BOOL

FALSE

Update of setpoints (on every rising edge)

Input

xResError

BOOL

FALSE

Reinitialization of the outputs eErrorCodeCom or eErrorCodeDev to the error-free state (on every rising edge)

Inout

ModbusClient

ModbusClientBase

Client of the device

Output

wRegisterAddrFb

WORD

0

Feedback - start address of the register for the Modbus- telegram

Output

diInputArrayNumb

DINT

0

Number of array elements at the input ariInputArray

Output

xInputArrayValid

BOOL

FALSE

Validity of the array at the input ariInputArray (data type, size) (FALSE = not valid, TRUE = valid)

Output

xAlarm

BOOL

FALSE

Collective fault (TRUE = fault)

Output

xAlarmCom

BOOL

FALSE

Collective fault - communication (TRUE = fault)

Output

eErrorCodeCom

ModbusErrorCode

ModbusErrorCode.NO_ERROR

Error code - communication (0 = no error)

Output

eErrorCodeDev

SIMPLE_WRITE_ARRAY_OF_INT_ERROR_CODE

SIMPLE_WRITE_ARRAY_OF_INT_ERROR_CODE.NO_ERROR

Error code - device (0 = no error)

Output

xBusy

BOOL

FALSE

Communication indicator (TRUE = communication)

Input Const

wRegisterAddr

WORD

Start address of the register for the Modbus telegram

Input Const

tTimeUpdateSetp

TIME

TIME#0ms

Update interval for the processes influenced by the input xUpdateSetp influenced

Last updated