08-24-2018 01:07 AM
Hi,
I am trying to acquire signals from multiple channels using my USB 6001 and Labview 2014.
I am trying to use low level vi's and I need the output in 'dbl' from. But I am not able to get correct results. I am not able to separate the signals from different channels properly. I tried using 'for' loop and 'while' loop for this. Please find the attached vi.
Any help is appreciated.
Thanks
08-24-2018 01:24 AM - edited 08-24-2018 01:25 AM
Hi rk_t,
I need the output in 'dbl' from.
This is your VI:
You create a task to read 4 channels. In the loop you are reading those 4 channels and index the resulting sample array to get the 4 samples.
But I am not able to get correct results. I am not able to separate the signals from different channels properly.
From your VI everything should be fine.
Why do you think you don't get those 4 samples from your 4 analog inputs (in each iteration of the loop)?
08-24-2018 02:26 AM
I see the same element in all the displays. I will try doing it once again.
08-24-2018 02:38 AM
Hi rk,
I see the same element in all the displays.
Are there real sensors attached to your USB6001? Or are the input pins open/floating?
When the pins are open: due to the MUX you will notice ghosting on open analog inputs!
08-24-2018 05:39 AM
actual sensors are connected
08-24-2018 05:44 AM
Hi rk,
actual sensors are connected
Did you check the cabling?
Are the sensors powered correctly?
Can you measure their signal when you use only one channel?
What about testing the sensor signal using a testpanel in MAX?
What have you tried so far? Where are you stuck?
08-25-2018 12:05 AM
I am able to get the results when I acquire one channel at a time or I am currently acquiring 4 channels sequentially in a sequence structure(2 secs/continuous acquisition for each channel).
08-25-2018 02:56 AM
Hi rk,
I am able to get the results when I acquire one channel at a time or I am currently acquiring 4 channels sequentially in a sequence structure
Can you show your VI for both kind of "working DAQ"? How does your VI look like for "one channel" and how does it look like for "4 channels in a sequence"…
Can you also show a wiring diagram for your hardware attached to your DAQ device?
08-25-2018 03:04 PM
Generally when one wants to acquire analog data, there's the concept of the "sampling rate" and the "number of samples". This is done in MAX by setting the sampling "mode" (which can be "single sample", but more often is "Finite Samples" or "Continuous", which means "take multiple samples over and over until I say Stop".
You don't appear to have configured the Sampling Mode, which you do with the DAQmx Timing function. Try the following -- put this down between Create Channel and Start Task. Be sure to connect the Task Wire. The defaults are Finite Samples (OK), 1000 Samples/Channel (OK), and 1000kHz sample rate (also OK, for this demonstration).
Remove the For Loop. Change the DAQmx Read to Multiple Channels, Multiple Samples, and save it as 1D Array of Waveforms (each Waveform will have 1000 samples). On your Front Panel, drop a Waveform Chart, and wire this to the output of the DAQmx Read. Now run it -- it will "pause" for a second (as the 1000 points a 1kHz = 1 second) are acquired, then you should see 4 1000-point plots on the Chart.
Note that you can also choose to have the DAQmx Read give you your 4 channels by 1000 points as a 2D Array. However, when you plot it, you probably will see 1000 lines having 4 points, instead of 4 lines having 1000 points -- simply put a Transpose 2D Array on the 2D Array between Read and Chart to fix this.
Bravo on tackling DAQmx without using the Dreaded DAQ Assistant. You just forgot to use the Timing function.
Bob Schor