Modbus Signed vs UnSigned Issue

lostcontrol

Lifetime Supporting Member
Join Date
May 2009
Location
NeverSayNever
Posts
1,069
Hello,

I am working on a HMI/Motion controller system, that utilises Modbus. HMI is Master, Motion Controller Slave.

When a value of 32767 is entered, the same value is written to the slave. When a value of 32768 is entered, a value completely different is written (I am assuming this is the signed equivalent...?)
If I enter a value of 32768 into the Trio Motion Controller, then the same value is displayed on the object display (32768) on the HMI.


What I am not sure of (yet:reup: ), is if this is a configuration setting somewhere, or an issue in the HMI or Modbus driver... One would assume (& as Ron says, I hate that word!!), that the issue would be in the HMI, as this is the master...

The data object is configured to be displayed as a unsinged integer, and is reading as such, just not writing.. :cry:

The HMI isa Beijer Electronics, whilst the Motion Controller is a Trio MC206x..

I have just checked the comms config again, & there is a Modbus config for Beijer addressing, I wonder what this is?
 
Last edited:
Hi,

The setting is in the HMI. MODBUS does not define the data type only the size, 16 bits per registers (holding/input register).

How that data is used/displayed is a programs choice.


 
32767 is 7FFF hex, the largest integer that fits in 15 bits.

The 16th bit is the negative sign bit.

So, increasing the value above 32767 can trigger another value.

Mark is correct, the interpretation of 32768 is up to the device. The Modbus standard does cover number format.
 
Thanks for the replies guys.
I have had some feedback from Trio tech support, and they have informed me that there format is signed only, so it is the Trio that is interpreting the data incorrectly.

Support of floats would of solved this headache ;).
But then, thats part of the daily battles we deal with...
 
Support of floats would of solved this headache ;).
Yes.

But then, thats part of the daily battles we deal with...
How much is it worth to you?
Our motion controller does just about everything in floats. The default data type is REAL. On top of that DINTs are also supported so the 16 bit problems don't EVER occur.
 
How much is it worth to you?
I know where you are going with this Peter, but this hardware is what customer has used previously, and due to pressure of this project, we stuck with same platforms.

Our motion controller does just about everything in floats. The default data type is REAL. On top of that DINTs are also supported so the 16 bit problems don't EVER occur.
If I could of, I would of used the RMC, & will look at it for next machine.
I am sure other HMI's may of supported it, or it may be a limitation of both devicees. I could explore other HMI's, as well as other controllers.

The time thing is important, and as we all know, so often customers are demanding & time is short. Thankfully this is not a priced job, if it was the hardware would of been compatible..
 

Similar Topics

Hello, I'm reading a modbus register 40125 I'm using a modbus poll program to read this register. If i read the register as a "signed" value it...
Replies
12
Views
9,264
Hello, I'm using the MSG command with RSLogix 500. The values are being read in as signed integers. Is there a way I can read them in as an...
Replies
10
Views
6,501
We are reading a signed long via modbus plus into a quantum PLC using fast trac software. We receive the data in two consecutive registers. Now we...
Replies
1
Views
2,532
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
1
Views
7
Apologies for not being the best IDEC programmer. I recently was doing some inspections on a site that had 3 FC6A IDEC processors. The issue is...
Replies
0
Views
51
Back
Top Bottom