LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

time stamp a file

hi ,
 
i am acquiring an analog input signal upon an analog trigger and do it continuously i.e. i check for the trigger, and if there is a trigger i acquire some specified number of samples and then check for the trigger again and repeat the above process. each time i get n samples i write them to a file.
 
i also have to do averaging, so i take an array of n samples and add them n times and divide the sum by 'n' to get the averaged data.
i write the raw data and the averaged data to a Labview TDM file. I want to get a time stamp of the instance when the write starts or ends for both averaged and raw data and keep getting it for each write. i don't need to get the time stamp for each data point. i have never used time stamps and i am a bit confused. can some one help me out.
 
thanks
jithendra
0 Kudos
Message 1 of 10
(3,141 Views)

Hiii, Jithendra,

             If you are acquiring the data of more than one channel, then it must be a two dimension data, so now what you can do is you can concatenate the time stamp in ahead of the first column with the use of format date/time string, which will give you a current date and time and if you want it with the miliseconds, then you can format the time stamp string in that control, by doing this you can take the current times satamp. if you are still in trouble, let me know how you are writing the data into the file and send me ur vi, i can do the modidfication accordingly.

Thanks,

Nishant

Message Edited by Nishant on 02-10-2006 09:55 PM

0 Kudos
Message 2 of 10
(3,127 Views)
Hi Nishanth,
 
i am acquiring the data on only one chanel, so each time i i have a trigger, i get a 1-D array of data. Now what i need to do is, do some averaging to reduce the data. i am doing it by acquiring n 1-D arrays each time a trigger occurs, and adding them up, and divide the result by n and display the data in a graph as well as write the data file.
 
Now when i write the data to the file, i need to get a time stamp relative to the system time, when the write operation starts. suppose if i specify the number of samples to acquire is 2500, and averages as 10, then i will get a 1-D array of 2500 samples (which is the average of the 10 1-D arrays), and before writing this data to a file i have to get the current time and store it in a file (or even in the same file as the data), and then write the data. Again when the loop executes for next trigger, i have to get the current time and then write the data and so on. so for each array of 2500 points i will have a time stamp. i am able to get the time in hours, minutes, and seconds but not in ms. also how do i combine all of them and build a single array with hours, minutes, seconds, and ms and combine it with the data file.
 
i have attached my VI. can u please have a look at it.
 
thanks
jithendra
0 Kudos
Message 3 of 10
(3,114 Views)

hi Nishanth,

i tried using format date time string, but it's not displaying ms. in the string control when i give %I%M%S<digit>, it's displaying hours, minutes and seconds correctly but for digit its just displaying what ever i give as input. I am using the Get Date/Time VI to get the current time and then giving it's output to Format Date/Time string. At the output of the Get Date/Time VI if i put an indicator it's showing the time in ms. But at the output of the Format Date/Time VI its not. can u please help me out.

thank you

jithendra

 

0 Kudos
Message 4 of 10
(3,107 Views)


@jithendra p wrote:

... i tried using format date time string, but it's not displaying ms. in the string control when i give %I%M%S, it's displaying hours, minutes and seconds correctly but for digit its just displaying what ever i give as input.


Hi Jithendra,

     Have you tried "%I%M%S%3u" ?

When they give imbeciles handicap-parking, I won't have so far to walk!
0 Kudos
Message 5 of 10
(3,101 Views)

Hi Dynamik,

thank you for your suggestion. i tried %I%M%S%3u and it's displaying the time in ms. how do i write this to a file. at the output of the Format Date/Time String, so how do i write this to a file, with each column showing Hours, Minutes, Seconds and ms? is there a way to do this?

thanks

jithendra

 

 

0 Kudos
Message 6 of 10
(3,094 Views)

Hiii, Jithendra,

             Here i am attaching the vi for you, in which i vw shown the format for writing the data with the time stamp with the data, select the appropriate file and start the program, that will show you the data with the time stamp in the file.

Thanks,

Nishant

0 Kudos
Message 7 of 10
(3,086 Views)
Hi Nishanth,
 
thanks for sending the VI. i will try to use it in my application and save both data and time stamp in same file. i was using the Data Storage VI's (tdm format) to store my data (I have to acquire data continuously for about a minute with a sampling rate of atleast 50 kS/s, so i would have huge data file). if i use the write to file function and store my data in text format would it be ok? will it decrease the speed, if i write the data in text format? and is there any limitation on file size?
 
thanks & regards
jithendra
0 Kudos
Message 8 of 10
(3,080 Views)

Hiii, jithendra

       Glad to help you, actually i dont have use the TDM file, but i can say one thing, yes if you write the file in the text format, then there will be a problem, but u also can overcome on that, by taking its offset, just check the offset continuosly, when ur offset crosses the mark, it will create a new file of next name, so then it wont be the problem of file size. but by writing through the file format "write to file", it wont increase the speed at all, and you can write the file as per that method, if not happen then tell me again.

Thanks,

Nishant

0 Kudos
Message 9 of 10
(3,075 Views)
jithendra, i am working on a project now and what you described sounds exactly like what i am trying to do. have you gotten your vi to work right with the averaging and time stamp? would you mind sending me what you have to help me out? thanks alot
0 Kudos
Message 10 of 10
(3,033 Views)