Example Program Drafts

Showing results for 
Search instead for 
Did you mean: 

Passing, Converting, and Graphing Analog Data Through a U32 FPGA FIFO

by Active Participant Robbob ‎04-09-2009 05:41 PM - edited ‎01-30-2017 10:17 AM

Functional Description

In earlier versions of LabVIEW, the FPGA FIFO is fixed at a U32 Datatype.  LabVIEW 8.6.1 allows any type to be used, including Fixed Point.  When using the U32 FIFO, it can be confusing when your I16 AI data gets coerced to a U32 and then Read as a U32 on the Host, which requires some careful data conversions.  This example shows a way to pack I16 Analog Data into a U32 and then to Unpack and Continuously Graph the Data on a Chart that gives a Start Time and timestamps on the data.

This example was built for a PXI-7831R, but can be applied to many different FPGA targets.

Caveats and Additional Notes

The data is continuously passed through a shift register, if you run this code for a long time, the shift register will eventually overflow. If that is the case, seek out an alternate method for your data.

You can modify the chart history length by Right Clicking on the Chart.

Be sure to change the Period Constant to be representative of the rate you are reading on the FPGA. For this example, I was reading at 100Hz on my fpga, so I put a period of .01 seconds into my waveform properties.

FPGA Conversion.jpg

Host BD.jpg

Host FP.jpg

Active Participant Robbob
Active Participant

Please leave feedback if you have any comments or suggestions!

Member SpaceHunter

add the version numner into the file name

Active Participant Robbob
Active Participant

Good call. Original files were for LV 8.6, but this example helps 8.5 users more. I'll convert the files and upload them later today!

Member soljiang

Thanks Robbob.  I do need the 8.5 version because I cannot open these file.  Looking forward to the new files.