ModbusTCP_WriteSingleRegister


Function Code 06. Writes a single holding register in a remote device

Syntax

C++
Python
 
def ModbusTCP_WriteSingleRegister(
	inSocket: int,
	inValue: int,
	/,
	*,
	inTimeout: int | None = None,
	inUnitID: int = 1,
	inRegisterAddress: int = 0
)
-> None

Parameters

Name Type Range Default Description
Input value inSocket int Connected socket ID on port 502.
Input value inTimeout int | None 10 - None Timeout in milliseconds, block if not specified.
Input value inUnitID int 0 - 255 1 Default is 1.
Input value inRegisterAddress int 0 - 65535 0 The address of the holding register to be written.
Input value inValue int 0 - 65535 Value to send.