LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

NI 9212 FPGA & C++ Fixed Point help

I have a fixed point reading from my module, 9212 in FPGA and it is (for lack of better words) a very whack fixed point value - see my first attachment. It looks to be a signed 24,-2. Now currently, I am converting that to an I32 (see second attachment) and sending it through my C API to my C++ code. I cannot for the life of me figure out how to convert the c++ integer back into a usable value. What I do have is a formula to convert a 16.16 signed fixed point value back into something that I can use. Is there a way to convert my whack fixed point value into a 16.16 one before I convert it to an I32 in my VI?

Download All
0 Kudos
Message 1 of 3
(2,379 Views)

Hi baconman,

 

a very whack fixed point value - see my first attachment. It looks to be a signed 24,-2.

The thermocouple reading is with unit V with a range of ±125mV, so you get a FXP with the very same range of ±1.25e-1 (V!). That's surely not "whacky"!

 

Why don't you convert that FXP to a float value, either SGL or DBL? Which integer values do you receive?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 3
(2,364 Views)

I am working with LabView FPGA. I can only send integers and booleans through the C API so converting to a float or double is no use to me since I can't send them. I have to send a fixed point that represents a float or boolean, I just need to figure out how to convert my 24,-2 fixed point into a 16,16 fixed point before I convert it to an I32 to send. I don't mind if I lose some resolution.

 

Ok it took me a second to realize what you meant, sorry! If I convert my fixed point to single-point and then to fixed point again, I can choose my word and integer lengths. Thank you!

0 Kudos
Message 3 of 3
(2,359 Views)