Sign in to follow this  
Followers 0
sancocho2001

MODBUS Unsigned Integer

6 posts in this topic

Hello, I'm reading from a MLX1100 Ser. A, two MODBUS Register 30008 and 30009 wich are Unsigned Integer for the Engine Running Time parameter, Scale is 10 and Unit is Second. I will like to group both, in order to read it from a Panel View Plus as a Decimal Value. Actually that is the value that I got from Modbus: 30008 = 5 30009 = 32320 I know that the Engine Running time is 10 Hrs., how I convert the Unsigned Integer to Decimal?

Share this post


Link to post
Share on other sites
Need more information exactly what is stored in each register? Is one hours and one seconds, is one minutes and the other seconds? If the 32320 has one implied decimal place then 3232.0 / 360 = 8.977777 hours not ten, so it's hard to tell with out exact information. You should be able to store the unsigned interger in a LONG file type and get the correct value. Then you can use math to combine the two and covert seconds to hours or whatever.

Share this post


Link to post
Share on other sites
Looks like it is the number of seconds times 100 stored as a DINT (Long Integer) If you put the 5 in the upper 16 bits of the 32320 then you get 360000 360000/3600 to convert seconds to hours would be 1000. If it is actually 10 hours then it would be divided by 100 to get 10.00 hours I’m rusty with Modbus and haven’t used the Panelview Plus in a while but with the Standard Panelview you can go to the tag editor and configure one tag to point to the upper integer and put the tag type as a DINT. This will automatically combine the two integers. Then in the tag editor we would set the scale at .01 to get the decimal in the correct position I think the same thing can be done with the Panelview Plus but I’m not sure. Edited by TWControls

Share this post


Link to post
Share on other sites
Each register is stored in seconds, you are right 360000 is the information that I need, but how do you get it? How I can convert these two register in 360000 using Micrologix 1100?

Share this post


Link to post
Share on other sites
To convert the value in the two register in a Micrologix take the value in 30008 and multiply it by 65536. Store this value in a Long Integer. This will shift the bits that are in 0-15 to 16-31. Then add the value that you stored in the long integer to the value in 30009 and store it in another long integer. This is the value in seconds * 100. I'm a little confused though. Initially you said you wanted to display the value on the Panelview Plus, but now you want to read it to the Micrologix. Where is it coming from and where does it need to end up at? Also if the two values you posted are 10 hours, your scale is 100 and not 10

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0