LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Time Stamp

Solved!
Go to solution

Smiley SadHello,

I need some help adding a time stamp (real time from the PC clock or device) to the data file. I have attached a sample of the vi.

 

 

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

What format do you want it in?

 

Where do you want it? (i.e header, colum header, every data point)

 

What is the rest of the data going to look like?

Tim
GHSP
0 Kudos
Message 2 of 9
(3,523 Views)
Solution
Accepted by topic author pistonbones

LV2009 is the latest version I have, so I could not view your vi, but I usually save my data in ascii format and include the timestamp as the first data in each row entry. I typically use the "Format Date/Time String.vi" time function to generate the timestamp string and then concatenate it with the rest of my data string. The image shows my typical format which goes from most to least significant figure. It does not have a timestamp wired to the input, so it just gets the system time at the time the format time vi is called. If you grab the time elsewhere, you can just wire that timestamp to the format function.

 

timestamping.png

jc
Mac 10.4
LV7.1
CLD
Message 3 of 9
(3,519 Views)

To be honest I don't have a preference on the file format. I would like one column header labeled Time and one time stamp for each data point. The date and time format I would like is MM/DD/YYYY;hh/mm/ss

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

Hi bones,

 

so you take jc's example, read the help for the function and then change the format string to suit oyur needs...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 5 of 9
(3,497 Views)

OK I'll attempt to use the example given by JC, but do I add the output of the string to the name input on the write TDMS block?

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

OK so the suggestion did not seem to work, well atleast I was unable to get it to function properly. Let me try to get this resolved another way. Scratch the .vi I uploaded. I am now using the write to file, with Dynamic data set properties (to label the channel names (headers) along with specifying the analog input number. All the DDTSet properties are connected together and input into the write to file input. The problem when I specify a label it replaces the time stamp with a sample number(i.e. line 1, 2..Etc.) If I leave the first input unlabeled without using a set properties output then the time stamp works. I really would like all the columns to have labels.Smiley Surprised

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

time in a usable format


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

Time in a reporting (anchor point) for the data points.

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