03-15-2018 10:43 AM
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?
03-15-2018 11:15 AM - edited 03-15-2018 11:16 AM
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?
03-15-2018 11:30 AM - edited 03-15-2018 11:33 AM
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!