Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQ + other data on same Labview chart

Solved!
Go to solution
Trying to do something fairly simple in labview. We're reading up to 16 analog input channels continuously (in a loop), merging the signals and displaying on one chart.  Now I have some other data from a different (non DAQ) instrument being read within another much slower loop.  Problem is I can't seem to wire any data through to the daq loop to display on the same chart.  I even tried building the waveform within the daq loop.  But anything entering seems to cause the entire thing to stop and no data is read.  How is this best done?
Message Edited by Beck45 on 05-28-2009 06:07 PM
0 Kudos
Message 1 of 8
(3,735 Views)

Wiring from one loop to the other does not work because of the basic dataflow principle of LabVIEW. Nothing is passed out of a loop until the loop finishes and the other loop will not start until it's data is present.

 

If possible, move all of the data acquisition into a single loop. Otherwise, you can write to a queue in one loop and read it in the other. There are examples and design templates (i.e. Producer/Consumer) that demonstrate how queues can be used.

Message 2 of 8
(3,729 Views)
Yes, thanks I used a queue and it works.  One issue however: a waveform (using build waveform) wired to a chart.  The chart won't behave properly, even when set to autoscale x (time).  It just displays a new waveform each loop iteration and clears the old line.  If added to the main chart (daq data), the chart just freezes.  Even though the timestamp gets updated each time just like the waveform output by the DAQmx read.vi.  Any ideas? 
0 Kudos
Message 3 of 8
(3,692 Views)

BTW the only way I could get this to work is to just wire the data directly (no waveform), but then I lose the waveform name, which is important since the number of plots varies, and the legend needs an entry for this one.

0 Kudos
Message 4 of 8
(3,685 Views)

Screenshots of your code which documents the behavior you are seeing would he helpful in trying to find a solution. Can you post those so that we can try and figure something out?

 

-Zach

0 Kudos
Message 5 of 8
(3,664 Views)

Sure, here is the code of interest.  The loop on the left is the DAQ loop (about 0.5s period) which charts data from several channels.  On the right is the loop (0.25s) that gets data from the other intrument which I'd like on the same chart.  As I say, it now works, but I need the name showing up in the plot legend. 

0 Kudos
Message 6 of 8
(3,654 Views)
Solution
Accepted by topic author Beck45

Hello,

 

From looking at your screen shot, it seems that you have a double data type wired into your Obtain Queue located in the middle of your attached screen shot. I would recommend wiring a waveform constant to the Obtain Queue instead of the double constant. This will define your data type as waveform and will porbably allow you to get the waveform names.

 

The waveform constant is located on Functions Pallette under Waveform>>Analog Waveform>>Waveform Constant. 

 

Please see the attached screen shot for clarification.

 

Hope this helps!

Regards,
Margaret Barrett
National Instruments
Applications Engineer
Digital Multimeters and LCR Meters
0 Kudos
Message 7 of 8
(3,612 Views)
I had tried using the queue with an array data type and then building the waveform in the left side loop, but the chart then wouldn't seem to work properly. With your solution, I built it in the right loop and passed the waveform in the queue, and it all DOES work now...thanks Margaret.
0 Kudos
Message 8 of 8
(3,567 Views)