LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

USB 6008 dynamic data convert to simple 1D array

Solved!
Go to solution

I'm acquiring a voltage signal: 100 samples at 1kHz, read via a for loop 3x, so 300 total samples.  I'm using an USB-6008 in differential mode to read in the data. 

image.pngI'd like to turn the dynamic data type into a "simple" 1-d array of 300 voltage readings.  How should I parse the dynamic data type wire? In other words, how do I unbundle (?) the data shown in the front panel indicator below?image.png

 

0 Kudos
Message 1 of 5
(2,698 Views)
Solution
Accepted by topic author nmoorewsu

Hi nmoorewsu,

 

I'd like to turn the dynamic data type into a "simple" 1-d array of 300 voltage readings.

Several options:

1. Get rid of the DAQAssistent and use plain DAQmx functions.

2. Use FromDDT inside the loop and convert to an 1D array of samples. Then change the tunnel mode to concatenate…

Try to understand/learn why option 1 is preferred and option 2 will work as needed…

 

(Option 2 will delete timing information from your data. You can also convert to a waveform, but then you need to use a shift register and AppendWaveforms.)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 5
(2,694 Views)

Perfect, thanks so much GerdW!  I'm used to the Arduino/Linx interface - now I see where that open-read-close programming pattern in LINX came from.  Here's a quick read from a TMP63 that I touched and released from my finger.

 

Are there any obvious design/VI mistakes I'm making with the DAQmx "primitives"?

image.png

 

0 Kudos
Message 3 of 5
(2,686 Views)

Hi nmoore,

 

when you want to read samples at the same interval you should define a sample rate.

See the example VIs on DAQmx...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 5
(2,681 Views)

DAQ devices (such as the USB-6008) work very hard to have an accurate and precise "clock" to drive their data acquisition.  It is much better than the millisecond clock provided by LabVIEW's "Wait" function (which will stop when Windows decides to scan for a virus or do something else).  You are (almost) always better off with N-sample recording (a common setting is 1000 samples at 1 kHz).  GerdW already told you this, but I'm explaining "why" ...

 

Bob Schor

0 Kudos
Message 5 of 5
(2,663 Views)