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?
Solved! Go to Solution.
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.
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.
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:
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
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: