LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

From integer to integer: casting and conversion details?

Solved!
Go to solution

Dear colleagues:

I would like to know some details about the way LabVIEW (in particular, its FPGA module) performs some data type conversions.

For example, if you have a negative-valued INT32 variable, and make its wire pass through that "To Unsigned Long Integer" bullet-like box, what's the result? What happens to the MSb?

Thank you and regards.

Biscay.

0 Kudos
Message 1 of 6
(2,541 Views)

biscay wrote:

What happens to the MSb?

Why don't you just try it? Would seem much faster than asking here. 😄

0 Kudos
Message 2 of 6
(2,538 Views)

Good point. The thing is that I expect these things to be explained in the otherwise very complete Labview's Help menu.

0 Kudos
Message 3 of 6
(2,534 Views)

I bet if you looked at the very complete Microsoft Visual Studio help system for the same question, you don't find it explained there either.

0 Kudos
Message 4 of 6
(2,501 Views)
Solution
Accepted by topic author biscay

@biscay wrote:

For example, if you have a negative-valued INT32 variable, and make its wire pass through that "To Unsigned Long Integer" bullet-like box, what's the result? What happens to the MSb?


In this case, nothing happens the the MSb.  The data is literally just reinterpreted (the binary values are exactly the same).


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 5 of 6
(2,495 Views)

Thank you, Crossrulz, for your quick answer.

Other related question is, does anyone know how time- and resource-consuming is the conversion from SGL to whatever FXP, on an FPGA target?

There are plenty of examples suggesting to turn your ADC-acquired FXP values to SGL, which I see as very handy (given that, for example, the official PDI vi no longer makes use of I16s: it now uses SGL values). In fact, for me, it is reasonable to think that that FXP->SGL conversion is pretty straightforward. However, if you need to get back to the FXP world, I see that things are blurrier. And, again, LabVIEW's help is of little help here!

Biscay.

0 Kudos
Message 6 of 6
(2,478 Views)