01-22-2013 07:31 AM
Hi,
Here i've attached one example, similar code module is used in our project.
In this example in two case structures SGL and U32 control panels are directly wired to DBL indicator panel. If i give 4294967295(U32 maximum range value in the false case as per the example) its displaying 4294967296.
Please give me the solution to display correct U32 value in DBL indicator panel.
Thank you
Yuvaraj
Solved! Go to Solution.
01-22-2013 07:52 AM
In your code, 4294967295 is first converted to SGL (at the case structure boundary), then to DBL. But this value cannot be exactly converted to SGL (due to the lack of significant digits).
You should convert the SGL value to DBL in the True case.
01-22-2013 09:32 AM
Back the bus up there! You seam to be confused about how data is stored in memory......
This snip shows how the value "120" is stored as both SGL and U32
When you Type cast you interperate the memory as if it was a different data type. This is why your code is going nuts. use conversion bullets to change data type and preserve value.
01-22-2013 04:47 PM
01-22-2013 09:01 PM
01-23-2013 11:12 PM
I got the solution. Thank you for help.