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

Hello Everyone, I am using a raC_Opr_NetModbusTCPClient AOI module, as below,. So, I need some assistance to restrict in reducing the poling...
Replies
2
Views
45
I want to communicate my Q series PLC with Factory IO using GX works 2 software, I want to use modbus as server and the ips are as follows plc...
Replies
0
Views
55
Hi folks, I have a Controllogix in communication with a zigbee coordinator using Logix AIO for modbus tcp. This zigbee coordinator have 3 slaves...
Replies
10
Views
265
Hi, I'm setting up a modbus master on an S7-300. It seems to work in OB1 but not when I use it in OB35. Does anyone have any ideas why? Could...
Replies
10
Views
117
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
275
Back
Top Bottom