From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How Do I Get Y-Axis Values From 2D Double Data

Hello,

 

I am relatively new to LabVIEW building a VI to acquire strain data.

 

I am using the DAQMX family of tools, and my strain gauge output is in the form of 2D double data.  I assume thats the given time and amplitude value read by the Read step?  How do I access just the amplitude value?  I want to run and display calculations performed on the value, but I can't figure out how to get just that value.

 

Also, when I write to a spreadsheet, the amplitude values are written fine, but the time values are all zero.  I am frustrated with the 2D data output.....

 

Any help would be appreciated!

0 Kudos
Message 1 of 4
(2,118 Views)

Time is not any part of the 2D DBL data. Your assumption is wrong. As explained in the help for NChan Nsamp mode of the DAQmx Read, each row is a channel and each column corresponds to a sample from each channel. To get just one channel of amplitude, you simply use the Index Array function with the column input wired. If you want timestamps, then you must select 1D Waveform as the datatype for multiple channels or single waveform for a single channel. Then, to get a specific channel, you use the Index Array function on the 1D array and the Get Waveform Components function can be used to extract just the Y array.

 

 

0 Kudos
Message 2 of 4
(2,116 Views)

Thanks for the reply, Dennis.

 

So is a column a channel or a row?  It looks like a column is a channel in my spreadsheet....

 

How would I insert absolute time into the spreadsheet?  Would I just use one of the time steps and write a value to spreadsheet with each loop execution?

 

Thanks,

0 Kudos
Message 3 of 4
(2,114 Views)

A row is a channel and I mistyped how to get a specific channel with the Index Array. You wire the Row input to get a specific channel.

 

With the waveform data type, you can use Export Waveforms to Spreadsheet File or Write to Measurement File. To use Write to Spreadsheet, you would use the Get Waveform Components to get dt and t0, create an array of timestamps, and convert those and your Y array to strings. Look at the block diagram of the Export Waveforms to Spreadsheet File.

0 Kudos
Message 4 of 4
(2,110 Views)