LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

SGL and U32 variables are wired to same DBL variable through case structure, DBL block displays SGL data when U32 case selected.

Solved!
Go to solution

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

0 Kudos
Message 1 of 6
(3,191 Views)
Solution
Accepted by topic author YuvarajaGK

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.

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
Message 2 of 6
(3,184 Views)

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

1!.PNG

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.


"Should be" isn't "Is" -Jay
0 Kudos
Message 3 of 6
(3,175 Views)
Hi, I've got a question. Is it possible to control an arduino (ATMEGA328P) with DAQ Assistant ? Please help me, for me it's too uncomfortable and difficult to use wiring. Thank you
0 Kudos
Message 4 of 6
(3,160 Views)

I got the solution. Thank you for help.

0 Kudos
Message 6 of 6
(3,130 Views)