LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Analog input-output FPGA

Solved!
Go to solution

Since you only provided screenshots we have no way to know which LabVIEW version and Flex-RIO (FR) carrier you are using. So if we assume you are using Lv2017, there is a generic example showing both Host-to-Target and Target-to-Host streaming methodology for various carrier modules.

If you use the Example Finder and search for Hardware Input and Output >> FlexRIO >> IO Modules you'll find the examples developed for your Adaptor Module (AM)

 

billede.png

When you open that project you can then select your carrier module and find the LabVIEW FPGA VI that corresponds to your system (in this case shown as a 7971 carrier module)

 

billede.png

 

The example should then work out-of-the-box for its specific I/O configuration. If you want to modify it for other I/Os and/or your specific application, you'll have to modify the code accordingly and re-compile your FPGA VI.

 

Since it sounds like you are new to LabVIEW you may want to start with basic concepts explaining Projects, Targets and in general how to code and compile FPGA VIs. This works great but may not be as trivial to get working as you may expect.

0 Kudos
Message 11 of 31
(1,997 Views)

Hello,

Thank you , this exemple helped me so much.

0 Kudos
Message 12 of 31
(1,980 Views)

Hello,

i did the DMA FIFO and i get the signal but there is some deformation and the magnitude is false

i send signal with 100kHz anb 0.5 V. 

But the graph gave me 1500--1600 in the Y axe.

here is the files and the capture of the graph.

Download All
0 Kudos
Message 13 of 31
(1,968 Views)

The data you retrieve with your DMA transfer is un-scaled raw data. The format is signed-integer 16 bit so has a range of +/-32768. This is the raw data of your A/D converter.

 

As you can see in the Host VI from the original example, the AI Vertical Range is given as 2.03 Vpp (to the left of the while loops). It means that 2.03 V corresponds to your ADC range of 65535, thus 0.5 V corresponds to approx 0.5 / 2.03 * 65536 = 16142 and that is pretty close to what you see on your graph.

 

To convert your data to 'volt' use the Scale Acquired Data sub-VI from the example host VI (inserted between DMA Read and the graph.

 

The periodic distortion in your signal may be present on your generator, can you try to check the waveform with an oscilloscope while still connected to you adaptor module.

 

The waveform jump on your graph is likely due to either buffer overflow (you should receive an error on your host side) or that you have not emptied your buffer before re-launching your VI so you get 'old' data from a previous run.

0 Kudos
Message 14 of 31
(1,964 Views)

Thank your very much for all this help !!

 

I fixed the probléme with the graph by using the Scale Acquired Data and it works now ( i have the real value in the scale).

 

For the waveform deformation: I linked the generator with the oscilloscope directly and I have a clean signal, so the generator works perfectly.

For the The waveform jump , I do not understand your explanation ( buffer overflow )..

 

0 Kudos
Message 15 of 31
(1,962 Views)

Did you check the generator with your scope while the 5783 was still loading as well? The 5783 has a 50 ohm input impedance so I wanted to make sure your generator can drive a 50 ohm load.

 

I cannot look at your actual project right now...

When you start your acquisition the FPGA will immediately stream data to its relatively small FIFO. If you are not able to retrieve this data (DMA to Host) fast enough, the small FIFO will overwrite itself and that could explain a waveform like the one you see. There are error flags you can use to check for any overflow (both on the FPGA - a Boolean on your FIFO node - and on the host side). Make sure to monitor these to catch eventual timing issues.

 

Also if you pause or stop your host VI, you may still have data stored in the different FIFOs. If you don't clean (empty) your FIFOs when you re-launch your host VI, you may retrieve old data first. Another possible explanation for your jumping waveform. In any cases, correct error handling should help you identifying possible issues.

0 Kudos
Message 16 of 31
(1,958 Views)

Yes, the problem was with the generator.

I changed the generator and now I get a real (clean) signal.

Thank you for your help.

0 Kudos
Message 17 of 31
(1,949 Views)

I can fix the AI Vertical Range when I know the true amplitude of my signal, but when I want to display a signal that I do not know the amplitude (for example a filtered signal in my project).

How can I determine the value of AI Vertical Range to put ? 

0 Kudos
Message 18 of 31
(1,945 Views)

The AI Vertical Range value is a system parameter that doesn't depend on what signal you input to your module.

The typical value is specified on page 4 of the datasheet

 

http://www.ni.com/pdf/manuals/375445a.pdf

 

If 1% isn't accurate enough for your application, you'll have to calibrate your module. If you input a known signal (DC or low frequency) you can derive the actual vertical range value for that channel and use that value for other signal types. But be careful not to over-specify your results, there are many other factors that may affect your accuracy (temperature, source impedance, signal frequency,...)

 

0 Kudos
Message 19 of 31
(1,942 Views)

OK, I will do like that.

Thaaank you !!

0 Kudos
Message 20 of 31
(1,925 Views)