LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

report time of data taken

Solved!
Go to solution

I am new to Labview and am conducting an experiment where I will be collecting data from various sensors. I have figured out how to connect all the sensors in the program and have the all in a while loop so that I can eventually take data at a regular consistency. I have set it up to report all the data into an excel file but was wondering if there was a way to report the time of each data 'grab' (i.e. the time each row of data was taken)?

 

Thanks in advance!

0 Kudos
Message 1 of 8
(3,634 Views)

Here is a vi I wrote to do exactly that. 

 

Put all your measurements into a single dimension array and feed the array to this VI.

 

This VI will put a timestamp in the first column that is in the right format for Excel to use.

 

Open the vi and look at it as you will have to make a simple adjustment if you are not in the Pacific Time Zone.

 

Capture.PNG

 

 

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 2 of 8
(3,627 Views)
How do you get timestamp information or a dt from a 1D array of dbl?

kmarcella,

What is the format of the data you acquire and how how you acquiring it? If you use DAQ, you can request that the data returned is a waveform data type which contains all of the necessary information.
0 Kudos
Message 3 of 8
(3,616 Views)

How exactly would I get total elapsed time from waveform though? I understand how to get dt but is the only way to get total to keep adding up those values?

0 Kudos
Message 4 of 8
(3,569 Views)
You can use waveform function to get all timestamps or calculate them yourself with a simple for loop with a shift register and an add function. Depends on what you want, absolute or relative time.
0 Kudos
Message 5 of 8
(3,562 Views)

Waveform pallet has a get timestamp array fn.  Array min max that and a simple subtract gets duration.


"Should be" isn't "Is" -Jay
0 Kudos
Message 6 of 8
(3,555 Views)

How would I use a for loop to get either relative or absolute time? I will need both.

0 Kudos
Message 7 of 8
(3,436 Views)
Solution
Accepted by topic author kmarcella
The shift register is initialized to zero. The add function is wired to the shift register and the dt that you pass in. The output of the add is wired to the right side shift register and also auto-indexed out of the loop. Wiring the Y array of the waveform to just the edge of the for loop will determine the number of iterations.
0 Kudos
Message 8 of 8
(3,427 Views)