06-14-2011 01:21 PM
Hello,
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.
Solved! Go to Solution.
06-14-2011 01:31 PM
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?
06-14-2011 01:43 PM
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.
06-14-2011 02:26 PM
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
06-14-2011 04:33 PM
06-14-2011 05:12 PM
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?
06-16-2011 06:51 PM
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.
06-16-2011 07:34 PM - edited 06-16-2011 07:35 PM
time in a usable format
06-16-2011 07:42 PM
Time in a reporting (anchor point) for the data points.