LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Data acquisition using Labview FPGA

Solved!
Go to solution
Highlighted

Hello Everyone,

 

I want to obtain data from my FPGA device NI USB 7856R and send it to the host VI, for plotting it on a Waveform Chart. However I doubt that my Target VI is working properly. Please find the attached image of my target VI. My aim for the target VI is to continuously acquire data from the connector. If that seems right please refer to my host VI, in which I just want to plot data continuously. Please let me know where have I made a mistake. The chart plots no data just a constant line with 0 amplitude.

Thank You

 

Regards

Pratik

Download All
0 Kudos
Message 1 of 23
(1,042 Views)
Highlighted

Hi Pratik,

 

Can you try wiring the output of the I/O node inside the loop ? 

 

Also, how fast are you acquiring ? You may want to consider using DMA to send data back to the host

 

-- Taranjeet

0 Kudos
Message 2 of 23
(1,013 Views)
Highlighted

You should definitely be using a DMA FIFO to send the data to your host.  That is how you can get waveform data (ie Streamed Data) between the FPGA and host.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
Message 3 of 23
(1,002 Views)
Highlighted

Hi Knight of NI,

Thank You for helping me out. I tried using the DMA FIFO. Please find the target VI attached and let me know if the FIFO implementation in the target is correct.

Thank You.

 

P.S: I am trying to send Data continuously from FPGA target VI to host VI

0 Kudos
Message 4 of 23
(989 Views)
Highlighted

That looks like it should work.  But it seems more complicated than it should be.  I don't think you need to use all of those shift registers since analog inputs are typically slow.  You can just linearize the loop instead of having to go with a pipelining setup.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
0 Kudos
Message 5 of 23
(987 Views)
Highlighted

Hi Knight of NI,

 

I searched about the implementation of FIFO and rebuild the VI from the beginning. Yet I am unable to get a wave. I am new to Labview and I am trying to learn everything I can from videos but I am unable to troubleshoot the problems myself. Please find the attached VIs. There are no errors in the VIs yet I am not able to obtain any wave. I tried "Highlight Execution" for the host VI and it shows 'ok' for all the used functions. Please can you help me out in finding the mistakes.

 

Thanks a lot!!!

Download All
0 Kudos
Message 6 of 23
(978 Views)
Highlighted
Solution
Accepted by topic author pratikpade

1. Your host should NEVER have an infinite loop in it.  Use a STOP button or some other condition to stop that loop so you can properly close stuff out.

2. You really need to learn DATA FLOW.  You are not writing to the chart until after the infinite loop stops, ie NEVER.  So just move the terminal of the chart to be inside of the loop.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
0 Kudos
Message 7 of 23
(974 Views)
Highlighted

Hi Crossrulz,

Thank you for the advice, I tried implementing your suggested changes. Yes, I don't have a good grip over data flow. I am using this in a project and I am in a bit of hurry, thus I have to complete it as soon as possible. I am expecting a sine wave of 1kHz on the waveform chart. However I am unable to get a perfect wave. I tried adjusting the scales to get a closer look at the graph. (Please find the waveform chart attached and I have also attached images of the VI for reference). The image is of waveform chart 2.

Thank you once again.

 

Regards

Pratik

Download All
0 Kudos
Message 8 of 23
(958 Views)
Highlighted

Yes, I expect Waveform Chart 2 to look like complete garbage.  It is based on a single sample at some random time of when the PC manages to get around to reading that data point.  You really need to be looking at Waveform Chart (the one connected to the DMA FIFO Read).

 

And what is the point of that FOR loop in your host VI?  It is doing nothing at all except wasting time, memory, and CPU.  Get rid of it.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
0 Kudos
Message 9 of 23
(954 Views)
Highlighted

Hi,

 

I got rid of the for loop and also the waveform chart 2. The waveform chart is not printing any data. I wanted to ask what invoke methods should I involve to read the data succesfully?

 

How should they be implemented?

 

Configure->Start->Read(in while loop)->waveform chart(in while loop).

Does this seem ok?

0 Kudos
Message 10 of 23
(950 Views)