ModbusValue

ModbusValue (FB)

FUNCTION_BLOCK ModbusValue

InOut:

Scope
Name
Type
Initial
Comment

Input

xEn

BOOL

FALSE

Enables/Disables the function block ( TRUE = Enable )

Input

Value

__SYSTEM.AnyType

The value to read/write. It can be any IEC data type such as BOOL, WORD, INT, FLOAT…

Input

byUnitId

BYTE

1

In case of Modbus-RTU enter the slave ID. In case of Modbus- TCP or Modbus-UDP the unit it is required

Input

byFunctionCode

BYTE

3

The modbus function code (3 = read input registern, 4 = read holding registers…)

Input

wRegisterAddress

WORD

The modbus register address (zero based)

Input

eReadWriteType

Modbus_ReadWrite

Modbus_Read

The direction of data excange (Modbus_Read, Modbus_Write or Modbus_Bidir)

Input

eModRcvOpMode

MODRCV_OPERATION_CODE

Operation Mode regarding to communication erros concerning Modbus-Receive-Telegrams

Input

wNumberOfCoils

WORD

0

Number of Coils / Inputs ( nur für FC01 und FC02 )

Inout

ModbusClient

ModbusClientBase

Instance of ModbusClient (ModbusClient_RTU, ModbusClient_TCP, ModbusClient_RTU, …)

Output

eError

ModbusErrorCode

ModbusErrorCode.NO_ERROR

Current error code (0 = NO_ERROR if data exchange succeeded)

Output

xBusy

BOOL

TRUE during data exchange

Output

xChanged

BOOL

TRUE after data was ready successfully to the Value input (only for one cycle). Use this output for any needed byte manipulations

Output

eResponseState

Response_State_Code

Response_State_Code.STATE_INVALID

Output

wModRcvActDevErrCnt

WORD

Aktion für den Modbus-Kommunikations-Fehlerzähler des Geräts

Zuletzt aktualisiert