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.

DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Absolute time for ascynchronous waveform channels

Hello,

 

I take asynchronous measurements of  different types  voltage, current, bus-signals  and savve them in a tdms file.

The whole cycle of measurement takes about 2-3 mins, as it goes thr'  various states. I repeat this process for a week. I save each cycle of data  15-20 mins in one tdms file.  What I need is absolute Time value  for my data as tht's the only reference.

 

How can I have absolute Time added to my TDMS file.  I did read the soln of making a  Date/Time channel but how can this help me synch all my data in one File.  say I want to parallely see my voltage measurements and Bus-Signals w.r.t time.  The measurements also take place at some time which is inconsistent( no real time system here).

 

I need the absolute time info with each measurement.

 

regards,

Akshay

0 Kudos
Message 1 of 9
(3,974 Views)

You never mentioned the data type that you were logging, or how you were acquiring your data, so I made some assumptions on this demo.  It will log 100 data points.  It will randomly choose if it is logging a scalar double to Signal 1 or Signal 2.  When it does this it will also log the time for that signal.  The result will be 4 channels in the log, one for the data of Signal 1 and Signal 2, and one for the time of Signal 1 and Signal 2.  If you are getting waveforms of data the absolute start time, and the DT between samples is logged as properties of the channel, if you are logging dynamic data I believe it already makes a time channel.

 

Example_VI_BD.png

0 Kudos
Message 2 of 9
(3,960 Views)

hey thnks

 

the Data I am  saving is  Waveform type

0 Kudos
Message 3 of 9
(3,958 Views)

well the Dynamic data  cannot save  Absolute time.

 

The option I tested is by making a  Time Channel  which  saves the abs. time value Info. The issue is I measure 4 different  waveform values  current, voltage bus signals at diff. times and  it would have been of gr8 help had these signals the same Time base(same Time channel) so I can analyze them  at once bcos, when Ch1_mA = 5 mA (measured at time t)  the Bus is Aktiv = TRUE and I also save this  Bus Signal as waveform which is measured at time (t+500ms).

0 Kudos
Message 4 of 9
(3,948 Views)

Oh in that case try this.  It will take a waveform (simulated) pull out the Y values, and create an array of X values that are the times of each sample then write them to the individual channels.  Each write adds more to the data, and more to the time columns.

 

Example_VI_BD.png

0 Kudos
Message 5 of 9
(3,948 Views)

well the Dynamic data  cannot save  Absolute time.

 

The option I tested is by making a  Time Channel  which  saves the abs. time value Info. The issue is I measure 4 different  waveform values  current, voltage bus signals at diff. times and  it would have been of gr8 help had these signals the same Time base(same Time channel) so I can analyze them  at once bcos, when Ch1_mA = 5 mA (measured at time t)  the Bus is Aktiv = TRUE and I also save this  Bus Signal as waveform which is measured at time (t+500ms).

 

 

0 Kudos
Message 6 of 9
(3,947 Views)

The DAQ card (that I assume is taking the measurements) is likely an aggregate sampling card.  Meaning if you tell it to read 4 channels at once, it will actually reach each of them one at a time switching between each of them very quickly.  This means the time that each sample is taken is slightly after the previous one, depending on the sampling rate.  This likely doesn't matter too much depending on how you are processing the data, and the rate of sampling.

 

My point is the absolute time that voltage is taken, is going to be slightly before the time that the current is taken, which is why you have different waveforms, and it is why the times are going to be slightly different.  How different?  Well that will depend on the settling time of the card which can be configured but it will be on the order of less than a millisecond for sure.

 

So the question you need to ask yourself is, if I have a single time column for all of my data, do I care if that is the time that the voltage was taken, and all the other signals were slightly after?  If that matters then you need separate time columns.  If you don't care that much than you can probably get away with generating one time column, for all samples, still using the function I just showed, but only for one of the signal waveforms.

0 Kudos
Message 7 of 9
(3,946 Views)

Hi there,

I am measuring the  Voltage current and Bus in different States one after other,  This  is a Bus Komm test, and I start the Bus Communication,  measure current,  voltage bus signals and stop Comm. and  measure again.  I save the Protocol after this loop in TDMS and the cycle continues... 

0 Kudos
Message 8 of 9
(3,928 Views)

In that case any of the suggestions I gave are still applicable.  Either log a new time with every sample of every signal, or log a new time for every collective sample of all signals, knowing that the time of each sample won't be exactly at that time, but close enough.

0 Kudos
Message 9 of 9
(3,926 Views)