I am writing a program that has requires a 32 bit floating number and the range is -1999000000 to 9999000000. When I use a REAL type, RSlogix seems to display these values in a different way. Any suggestions for displaying the values above?
I am writing a program that has requires a 32 bit floating number and the range is -1999000000 to 9999000000. When I use a REAL type, RSlogix seems to display these values in a different way. Any suggestions for displaying the values above?
A LINT will hold this range as integers. But I don't see any math functions which support it. Again, are you sure you need floating point? The significant digits will be much less.
The value is broken up into two 16 bit INT values that I need to combine into one to create my 32 bit value as stated above. I am doing this in a AOI and the AOI does not allow me to create an input or output parameter as a LINT.
Any advise on what I can do here?
Be careful with 32 bit floats. After you get to 16777216.0 you cannot add 1 any more to get to the next number. This has to do with how the number is stored in the computer. See this thread:
http://www.plctalk.net/qanda/showthread.php?t=19588&highlight=floating
The value is broken up into two 16 bit INT values that I need to combine into one to create my 32 bit value as stated above. I am doing this in a AOI and the AOI does not allow me to create an input or output parameter as a LINT.
Any advise on what I can do here?
The value is broken up into two 16 bit INT values that I need to combine into one to create my 32 bit value as stated above. I am doing this in a AOI and the AOI does not allow me to create an input or output parameter as a LINT.
Any advise on what I can do here?
Thanks. That still does not explain why when I entered
9999000000 as a REAL tag value, it changed the display value to 9.99899955e+009 (under monitor tag dialog). This was using Studio 5000 v23.