« Back to Product

Documentation

ModBus_WriteRegister

 boolean ModBus_WriteRegister (int $InstanceID, float $Value) 

Parameters

InstanceID

ID of the device to be switched

Value

32-bit floating point value according to IEEE754 or integer

Returns

If the command succeeds, it returns TRUE, otherwise FALSE.

Description

Writes the value Value to the configured address (write) of the instance with the ID InstanceID without knowing the exact data type.

Warning

This function cannot be used for bit values. ModBus_WriteCoil must be used for bit values.

Example

////Writes the value 23.5 to the register of the instance with ID 12345
ModBus_WriteRegister(12345, 23.5); 

////Writes the value 12 to the register of the instance with ID 23456
ModBus_WriteRegister(23456, 12);
Any questions?