Doing some more investigation, with a particular PLC (Cruzet M4). All of the registers are unsigned (though some are treated as signed).
Using the Edge Agent when I try and write -1000 for instance which is a valid Signed 16bit value I get the following modbus error
“"value" argument is out of bounds”
“MODBUS_WRITE_ERROR”
Now my experience in the past has been that the real value is a 16bit unsigned value which you have to interpret as Signed/Unsigned as appropriate
From simply modbus
The example for FC03 shows that register 40108 contains AE41
which converts to the 16 bits 1010 1110 0100 0001
Great! But what does it mean? Well, it could mean a few things.
Register 40108 could be defined as any of these 16-bit data types:
A 16-bit unsigned integer (a whole number between 0 and 65535)
register 40108 contains AE41 = 44,609 (hex to decimal conversion)
A 16-bit signed integer (a whole number between -32768 and 32767)
AE41 = -20,927
(hex to decimal conversion that wraps, if its over 32767 then subtract 65536)
Now using Python (modbus_tk lib) to read/write to the same device we see expected behaviour
In [8]: c.execute(1,cst.READ_HOLDING_REGISTERS,25,1)
Out[8]: (32000,)
In [9]: c.execute(1,cst.WRITE_SINGLE_REGISTER,25,output_value=1)
Out[9]: (25, 1)
In [10]: c.execute(1,cst.READ_HOLDING_REGISTERS,25,1)
Out[10]: (1,)
In [11]: c.execute(1,cst.WRITE_SINGLE_REGISTER,25,output_value=32767)
Out[11]: (25, 32767)
In [12]: c.execute(1,cst.READ_HOLDING_REGISTERS,25,1)
Out[12]: (32767,)
In [13]: c.execute(1,cst.WRITE_SINGLE_REGISTER,25,output_value=32768)
Out[13]: (25, 32768)
In [14]: c.execute(1,cst.READ_HOLDING_REGISTERS,25,1)
Out[14]: (32768,)
In [15]: c.execute(1,cst.WRITE_SINGLE_REGISTER,25,output_value=-100)
Out[15]: (25, 65436)
In [17]: c.execute(1,cst.WRITE_SINGLE_REGISTER,25,output_value=65436)
Out[17]: (25, 65436)
So at the moment due to the Edge Agent modbus implementation it appears the maximum value that can be written is 32766, firstly due to the validation error, and the secondly because of the format of negative signed integers being written is being rejected by the MODBUS device.
Cheers
T