How to Convert N Channel N Sample waveform to 2D DBL Array

Updated Apr 14, 2020

Reported In

Software

  • LabVIEW

Driver

  • NI-DAQmx

Issue Details

After I get N channel data from DAQmx read.vi, I want to plot the waveform graph and also get DBL type of values in 2D array. How?

Solution

Typical data types read by DAQmx read function are Waveform and DBL type. You can select the interface optionally according to the desired data type. However, if you want both Waveform type and DBL type data at the same time, you must change the 1D array of Waveform type to 2D array of DBL type.

Waveform data includes 3 components(dt, t0, Y). Then, you should extract the Y component using Get Waveform Components.vi. However, because data conversion cannot be direct, it can be recombined using for loop. Here's an example.