LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Sending array via FIFO for xy graphs

Solved!
Go to solution

HI, i'm having trouble sendig data from the FPGA to the host user interface.

I want to plot 6 signals. on two XY graps, so for each XY graphs I have 3 plots.

I take samples each 100µs on the FPGA and bundle them in an array of 6 elements representing the y values.

I send this array via DMA FIFO to the host.

On the host VI  I gerate the x values bundle them in a cluster and build an array of 3 plots.

 

When I run the VI. I have a plot of the signals, but's its like the plots are changing all the time to another plot. Its like each time another element of the array is read. Before on the current graph I had only two plots and then it worked fine.

I hope someone can help me further.

 

In attachment you can find the FPGA VI, the realtime VI and host VI

0 Kudos
Message 1 of 6
(3,679 Views)

Could you upload the Host VI for older versions of LabVIEW? (file... save for previous version)

0 Kudos
Message 2 of 6
(3,654 Views)

This should be for an older version. 

 

0 Kudos
Message 3 of 6
(3,642 Views)
Solution
Accepted by topic author gihlutax

A couple of comments:

 

It looks like your x-axis is evenly spaced (by 0.001) so you do not need an xy graph, but just a waveform graph, which should simplify things.

 

I am confused why you make your x-axis for Graphics1 to be 100000 elements long but are only trying to graph 30000 elements from the stream. Similarly for your Hall-signals and Currents graphs it looks like the x-axis is 4000 elements long (though I don't have your time-axis.vi to check) and you want to graph 20000 elements. Switching to waveform graph will simplify this.

 

When generating your 100000 element array you can just use (i+1) * 0.001 as an auto-indexed output instead of using the shift registers.

0 Kudos
Message 4 of 6
(3,637 Views)

Maybe a waveform graph would make thinks more simple. The reason I used an XY graphs is because a used this in previous projects. I will give it a try using the waveform graphs.

I solved the problem using your tips.

 

On FIFO 3 I want to read 6 plots. In the FPGA  I  took samples every 100 µs. I generate 4000 x-values, with a resolution of 100µs this will make a x-axis of 400ms. As I have 6 plots, I have to read 6 times 4000 elements, makes 24000 elements from the FIFO. I did it this way and it works, is this correct?

Because I thougt one array (consisting 6 elements, 6 y-values sampled in the FPGA VI) is one element.

 

Thanks a lot for your support!

0 Kudos
Message 5 of 6
(3,611 Views)

Well, if you are getting what you expect then it sounds like you're on the right track!

 

The way you take your data off the FIFOs will completely depend upon how you put it on your FIFOs. If you have 6 plots, or sensors, or whatever labeled A-F, and you put all your data from sensor A, then sensor B, etc., then it sounds like you are doing it right. If you are putting data on like ABCDEF ABCDEF, etc. then you would have to do something slightly different. Perhaps read 6 elements at a time and then transpose your 2D array of data before plotting.

0 Kudos
Message 6 of 6
(3,603 Views)