Modbus returning negative values

maragon

Member
Join Date
May 2023
Location
Amercia
Posts
2
I have 3 koyo PLC's in series. The 1st and 3rd are reporting values correctly but the 2nd is reporting negative values. The values in the PLC and HMI are reading positive values. They are connected to port 2 serial built on the PLC. All modbus settings are the same as the other 2 except for the ID of course. No high voltage is in the cabinet, only 24v.

Looking for any advice on what else to look for. Thank you!
 
The Modbus specifications do not define if the data contains signed or unsigned values, it only defines the sending of raw 16-bit words.

Whether this is interpreted later with or without a sign depends on the Modbus client that reads that data.

Perhaps your HMI has some setting for the data to be interpreted as signed or unsigned. The same for the PLC programming software.

Or simply in your 2nd system an overflow occurs that sets the most significant bit to 1 and therefore changes the sign no negative
 
To expand on what @lfe says, the issue is most likely how the Modbus client* device interprets bit 15 of the 16-bit registers transferred. If it is interpreted as -32768, then unsigned** values on the Koyo that are greater than 32767, I.e. 32768 through 65535, where bit 15 is 1, will be interpreted as negative numbers -32768 through - 1.

* or server device, if the Koyos are writing the values
** unsigned value interpret bit 15 as +32768

The first and third Koyos have values*** less than 32768 decimal. If those values go above 32767, then their values will be interpreted as negative as well.

*** N.B. This all assumes the values in question are 16-bit integers. If there are multiple registers being combined into a larger entity, then the problem may lie somewhere else.
 

Similar Topics

Hi Everyone, i was hoping for a little help with this module. i have data that needs to be read from a different plc through the Modbus plus...
Replies
11
Views
222
I have a PH meter that I am trying to bring its data into 1756-L81. I have downloaded the Rockwell MODBUS AOI kit, but I am not sure if I need to...
Replies
5
Views
164
Dear All, i am trying to connect Danfoss inverter with s7 200 cpu 226.but microwin shows following error at DATA Ptr.i assigned different VB...
Replies
1
Views
48
I'm trying to control a device via MODBUS RTU and the ModbusRtuMasterV2_PcCOM in Twincat 3. I've configured a device with the right com port and...
Replies
7
Views
222
Hi all, Currently having trouble getting a speed reference to write over modbus to an Omron M1... I can successfully write a run command and...
Replies
6
Views
255
Back
Top Bottom