09-17-2014 03:47 PM
I want to sample an Analog Input from my PXI-7841R AI0. The issue I am having is when I drag the input from my project into my VI, the item is set as a Signed Integer value and I cannot change it to a floating/double. Why is this? I am experienced with LabVIEW; however, this is my first go developing LabVIEW FPGA.
Please help! thanks!
Solved! Go to Solution.
09-17-2014 03:54 PM
The analog inputs on an FPGA are giving you raw, unscaled binary values. So I16's. (FPGA's are much more efficient with integers than floating point numbers.)
You will need to scale the data to a floating point, such as on your host machine, if you need a scaled floating point value that represents engineering units such as volts, or something else.
09-17-2014 04:03 PM
Yup, send the I16 value to a host RT or Windows machine using a DMA FIFO, or just read the front panel control value if you don't mind the slowness, then scale it for the range you want.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
09-17-2014 04:32 PM - edited 09-17-2014 04:36 PM
Got it. Thanks.
So the manual provides me this forumla:
Raw = (Voltage x 32768) / 10.0v
So if I wanted to compare the Analog input to a value of 1.5 Volts, I could use the formula to get the Raw value of 1.5v and compare it to AI0 directly on the FPGA correct?
09-17-2014 08:34 PM
That looks about right.
09-18-2014 06:44 AM
altran wrote:
So if I wanted to compare the Analog input to a value of 1.5 Volts, I could use the formula to get the Raw value of 1.5v and compare it to AI0 directly on the FPGA correct?
That's what I do and it works quite well.
09-18-2014 11:23 AM
Thank you all!