07-16-2009 11:11 AM
I found on the forum a reference for reading negative numbers. Fom 0 to 360 degrees I read everything fine. I am confused on the 65xxx return below 0. Is there a way to use unsigned decimal or what is the best answer?
Philip Nielsen
07-16-2009 12:05 PM
Not a whole lot of detail to go on here.
Why do you want to use an "unsigned decimal" when you are asking for negative numbers.
Modbus just returns a series of ASCII bytes that get typecast to a numeric value. Perhaps you want to typecast the number to an I16 instead of the U16 that comes out of the Modbus VI's.
07-16-2009 12:46 PM
Thanks for your response. I believe I need to change the control indicator to unsigned? I tried it but I still got it wrong. Please see the labeled indicator "Actual Temperature from Oven". I not if I should add any other properties? Such as double I16 etc.
Thanks again,
Philip
07-16-2009 01:17 PM
I found out where I am getting the error. I am not sure how to fix it. I ran the oven temp below o and 65xxx showed up again. I attached the unmodified Modbus VI.
Philip
07-16-2009 01:59 PM - edited 07-16-2009 02:01 PM
No, change the value to a signed integer, I16.
07-16-2009 04:11 PM
Works like a champ. My first VI modbus was in 8.2. I was unable to convert all the functions to 8.6.1. I put the data conversion in my FOR LOOP. Thanks for the simple answer. Sometimes we stumble more then we want too. It reads negative temperatures and positive temperature greate.
Thanks
Philip
02-03-2021 07:58 AM
How do I read negative temperatures in modbus? as soon as it drops below 0 degrees celcius, it reads 6552 on labview and on the instrument itself reads correctly -10 degrees.
02-03-2021 08:08 AM - edited 02-03-2021 08:10 AM
You say it reads 6552, but do you actually mean 65526?
When you typecast the U16 integer of 65526 to an I16 integer, you'll get -10.
Did you try what I posted nearly 12 years ago in message #5? Because that works as well.
02-03-2021 08:17 AM - edited 02-03-2021 08:18 AM