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.
Solved! Go to Solution.
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
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.
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.
P.S: I am trying to send Data continuously from FPGA target VI to host VI
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.
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!!!
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.
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.
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.
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?