# LabVIEW

cancel
Showing results for
Did you mean:

Solved!
Go to solution

## Multiple waveform charts not displaying data simultaneously

Hi,

I am using a USB-6009 to acquire three analog input voltage signals simultaneously. I want to plot two of the voltage signals wrt time, while for the third signal, I want to extract the frequency and then plot the frequency wrt time. I want all three waveform charts to have an x-axis in units of seconds starting at zero seconds. My VI block diagram is below:

When I run the VI, I'm getting some issues. Firstly, the Frequency chart isn't plotting any data and although I'm happy the time starts and remains at zero, it's counting up by tenths of a second instead of by just seconds.

With the Voltage 1 and 2 charts, the voltage is being read correctly, but the x-axis is in terms of time and date instead of seconds. The VI front panel is below:

I have tried running the VI with only the third voltage signal being read and the waveform chart plots the frequency perfectly. The front panel and block diagram is below:

Could someone point out what I am doing wrong in the first VI?

Message 1 of 6
(6,313 Views)

## Re: Multiple waveform charts not displaying data simultaneously

What do you want to do in the first VI?  You appear to be taking in 3 channels of 1000 points, sampled at 10KHz, so your Chart should "jump" 10 times a second as 1000 new points are added.  You define t0 for each waveform as the current time, and plot your data using Absolute Time (which means the Time Axis has date and clock time, rather than "seconds since start of experiment" or something I would consider more useful).

But what do you want to plot on the Frequency graph?  Do you notice that while the other plots are Waveform plots and include a 1D Y array of 1000 points, you have a single thin orange wire (meaning a single float) going into the Frequency Chart.  You should expect the points will accumulate there 1000 times slower than the other two plots.

Somehow, I think that is not what you want, but it seems to be what you programmed.

Bob Schor

Message 2 of 6
(6,294 Views)
Solution
Accepted by topic author ahsan2

## Re: Multiple waveform charts not displaying data simultaneously

1. You should use the Mutiple Channels Multiple Points Waveform Array version of the DAQmx Read.  Then you don't have to build up the waveforms yourself.

2. Arrays indecies are 0 based.  So the filrst element of the array is actually 0, not 1.

There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 3 of 6
(6,280 Views)

## Re: Multiple waveform charts not displaying data simultaneously

Thanks for the help crossrulz. I followed your steps and got the VI to work exacttly how I wanted it to. I also managed to get all the charts to start at zero seconds using the VI found here: Start at Zero with Relative Time using Waveform Data in Charts

My updated VI is below:

Message 4 of 6
(6,270 Views)

## Re: Multiple waveform charts not displaying data simultaneously

i am currently working on a very similar project and im using NI USB-6009 to acquire two different waveforms from analog input, I tried the updated code that you have done but I am only getting reading from voltage 1 and the the other two graphs are not being plotted, urgent help is required. Thank you

Message 5 of 6
(5,127 Views)

## Re: Multiple waveform charts not displaying data simultaneously

Well, I don't have LabVIEW 2017 installed on this laptop, but I do have a 6009.  I first configured a Task in MAX (because I'm lazy and don't like to mess with all those DAQmx functions one at a time) to do the following:

• Set Range:  0 to 5 v, Differential.
• Set Acquisition for Continuous Mode, 10 samples at 100 Hz.
• Open Block Diagram, create Error In (constant).
• On Error Line, drop Start Task, DAQmx Timing Node, DAQmx Read, DAQmx Stop Task, and Simple Error Handler.
• Set DAQmx Read to Multi-Channel, Multi-Sample, 1D Waveform.
• Drop While Loop around DAQmx Read (keep other functions outside loop), wire Stop Control to Stop Indicator.
• Wire Constant to input of Start Task.  Click down-triangle, choose created Task, Test-6009.