LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Sample an an Analog input from my PXI-7841R DAQ

Solved!
Go to solution

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!

0 Kudos
Message 1 of 7
(3,101 Views)

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.

Message 2 of 7
(3,099 Views)

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.

0 Kudos
Message 3 of 7
(3,094 Views)
Solution
Accepted by topic author altran

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?

0 Kudos
Message 4 of 7
(3,086 Views)

That looks about right.

0 Kudos
Message 5 of 7
(3,059 Views)

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.


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
0 Kudos
Message 6 of 7
(3,039 Views)

Thank you all!

0 Kudos
Message 7 of 7
(3,018 Views)