LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

HELP! Real-time combined display of waveforms from separate loops

Hi all, I would like to combine the waveforms from two separate continuous acquisitions (ie in while loops) and display them on one chart.  I was thinking that I could create a third loop and feed the two waveforms into this but it's proving a bit tricky.  I have to create another 2 waveforms and use Append Waveforms to store the data until it is ready to be plotted by the third loop.  Then there is the issue of having a lock on this data while it is being plotted to prevent new data from overwriting it....

Does anyone have a good idea on how I can achieve this? 

Thanks for your help,
Pauline
0 Kudos
Message 1 of 10
(3,660 Views)

One of the ways would be to use queues to send data from the two loops to a third loop, where they can be combined and plotted

Look at example vi's shipped with Labview

Go to find Examples>>search Tab>> type queues and get all relevant examples

Take a look at 'Queue Multiplexer.vi'

Hope this helps

regards,

Dev

 

Message 2 of 10
(3,657 Views)
Thanks Dev! I'm going to try that now and see how I get on. Smiley Happy
0 Kudos
Message 3 of 10
(3,652 Views)
Hi Dev, I've gotten quite a bit further but now I have a new problem.  Smiley Sad

I have two loops acquiring data at different rates and I'm using two separate queues to buffer the two data.  In a third loop (of lowest priority), I read all of the elements in both queues each time using (Dequeue Element iteratively for the #elements returned by Get Queue Status) and output the 2 channel waveform to a chart.

For some reason, data is lost and there are gaps on the chart.  My vi is rather complicated that's why I'm not posting it.  I was hoping/wondering if anyone could suggest some reasons why this is the case. 

Thanks,
pauline


0 Kudos
Message 4 of 10
(3,627 Views)

Pauline,

Please verify this

Is data lost in the queue?

or is just a missing out of data points on chart display??

Just put a seperate chart for each Dequeue and check this out

Regards,

Dev

0 Kudos
Message 5 of 10
(3,615 Views)
Hi Dev,

Thanks for your help.  This is my plot from a subVI which is updated after every Dequeue Element is called:


I'm not sure if this verifies whether data is lost from the queue or if it's a display issue.  I can't think of what else it could be. 

Thanks again,
Pauline
0 Kudos
Message 6 of 10
(3,605 Views)

Pauline,

Since you are using 2 seperate queues, did you try to plot each dequeued data on a seperate chart and observe??

Do paste a pic of your Block diagram. That would help in answering better

Dev

0 Kudos
Message 7 of 10
(3,600 Views)
Hi again Dev,

I've just rechecked and I think data is not lost in the queue.  The plot from the chart just after each dequeue is continuous but is discontinuous on the final chart.  Has this something to do with computer speed/load?

Thanks again,
Pauline
0 Kudos
Message 8 of 10
(3,600 Views)

Probably this has to do with how you are stopping the two loops that are queueing the data.

maybe one loop is stoping transmission of data before the other

Again, it tough to take a stance with out looking at your vi

0 Kudos
Message 9 of 10
(3,595 Views)
Hi Dev,

I've attached a couple of snapshots - I apologise for the mess but I'm really trying to plot data from three parallel loops. (I've blanked out one of them for the moment.)

In the mainvi, the top loop is for a 4channel (waveform array of 4 elements) acquisition and the bottom is for a 1channel (waveform) acquisition.  The second loop from the top has the "flush" subVIs that read all the elements in the queue and displays the data after concatenating the two waveforms (waveform array of 5 elements now).

I've also attached a pic of the queue-subvi for the 4channel "flush".  It's similar to the 1channel case except I don't loop for the waveform array.  It shows where I've put the "debug chart" and I've used append waveform to concatenate the queue elements.  As I've mentioned, this debug chart shows continuous plot for both the 4ch and 1ch data.

Thanks very much for your help!

Pauline
Download All
0 Kudos
Message 10 of 10
(3,589 Views)