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.

Signal Conditioning

cancel
Showing results for 
Search instead for 
Did you mean: 

how to get waveform time array

Hi All,

I am trying to :

1.capture a temperature transient signal,

2.log and export the X(time in millisec) and Y(amplitude of temperature signal) in a spreadsheet,

3.call up the logged  X(time in millisec) and Y(amplitude of temperature signal) as input to a non-linear curvefit VI for curvefitting.

My Problem.

1.I want all these achieved using one VI.

2.I couldn't extract the corresponding time in millisec,all I have been getting is time stamp,showing Date,YY:MM:DD:HH:SS which is not usable for plotting and curve fitting.

3.When I wrote the output of the trigger and gate VI to an array,I only got the Y value array,the time array the did not show up.See array XY on the front panel.

 

WHAT I HAVE DONE IN THE ATTACHED VI.

1.Exported captured waveform to spreadsheet.

2.Converted the dynamic dat from the trigger and gate VI  to a waveform and to a time array.This shows time stamp 1/1/1904 see the front panel.

3.Tried using a get waveform time array.

N.B.

The attached VI is a version of the work.I replaced the original DAQ with a simulate signal VI.

Any related advice would be appreciated.Thanks.

spotless
0 Kudos
Message 1 of 4
(8,846 Views)

Hi spotless,

 

This is really more of a general LabVIEW question than a signal conditioning question. This Board does not get much traffic. You would probably get a faster response and get more people offering suggestions on the LabVIEW Board.

 

The way waveforms work is to take advantage of the fact that signal sources which produce waveforms (DAQ or software) generate uniformly sampled data. So only two pieces of information are required to preserve all the timing information: The start time, t0, returned as a timestamp, and the sampling interval, dt, returned as a scalar. The amplitude data is in the Y array. Export Waveform to Spreadsheet file saves the timing information in the header.

 

The waveform at the output of the Trigger and Gate VI has dt = 0.00100 and t0 = 1/1/1904 (which is the "zero" value of a timestamp). So the necessary information is there.

 

When you need an array of times for something like the fitting VIs, you need to create it yourself. You probably do not need the start time. You can create the X array by several methods. Convert the timestamps from WDT Get Waveform Time Array.vi to DBL and subtract in a for loop. Multiply dt by i in a for loop. Use Ramp Pattern.vi. These three methods are all shown in the image below. All create arrays with 0, 0.001, 0.002, 0.003 ...  In your case I would probably use the method wired to t Array 2 (dt*i).

 

Lynn

 

Time arrays.png

Message 2 of 4
(8,842 Views)

Hi Johnsold,

Thanks for your prompt response,time and explanation.You have solved the problems!The options worked fine.I am now making progress.Thanks once again.God bless you.Amen.

spotless
0 Kudos
Message 3 of 4
(8,819 Views)

Lynn -- Can you use the method for t array with the for loop function to write data in a tdms file in milliseconds?

0 Kudos
Message 4 of 4
(7,393 Views)