04-12-2010 10:10 AM
Well guys, I recorded some files at LabVIEW with my program, but now I need to show at Front Panel
the time at the begging of the file
and the time at the finish of the file
like this file beggin 1:30pm
this file end 1:33pm
Someone could help me on that? I'm using the Write file [+I16] to make my file
and labview version 7.1
Thanks
Solved! Go to Solution.
04-12-2010 10:16 AM - edited 04-12-2010 10:17 AM
Hi EduU,
for the file end you could maybe check the file's "last mod" time given by "File/Directory Info" function.
When you have a constant sampling time you could then calculate the start time of file writing.
Maybe it's now time to redesign your file format? Maybe including some header information? Like start of measurement, type of, sampling rate, etc... Usually you have to think about that much earlier, right after reading the functional requirements of the programming contract...
04-12-2010 10:20 AM
Hey GerdW, thanks for the help
My file already have some header but not those.
But thanks for the help I already get the time of the begging file...
and with your help I will get the time of the end of file
so I have all I need now =D
I will try here, and post later with it works!
Thanks
04-12-2010 12:24 PM
04-12-2010 02:19 PM
Hi EduU,
I'm not sure I thought you already got the start time of the file?
Suppose you have constant intervals between saving data items: then you could get the file length (amount of data), divide by the data item size to get the number of data items. Now you could mutiply number of data with interval to get the whole "file time"...
Or you could change the data header before saving new files
04-13-2010 06:19 AM
Well GerdW,
I dont have the start time x( I think I had it but when I saw it's the end of file already
Yes I record to file it from 2 seconds... like 2 4 6 8 10....
but I don't know how to make it take the amount of data and divide for the number of samples....
could you attach an image for me?
and don't have any other way, more easier?
How can I make that at header??
Thanks
04-13-2010 06:44 AM
Hi EduU,
it's kind of pure math:
Suppose you write an I32 each 2 seconds. Your file end is at 12:00:00 and the file has a length of 100 I32 values (=400 bytes). Then the file start is at 12:00:00 - (100*00:00:02) + 00:00:02 = 11:56:42. Pure math...
How to make header: you could first write some text lines containing needed values (like start time and sampling frequency). Then you mark the beginning of the data section (like "DATA:") and start to write your actual data... Anything is possible (depending on your requirements)!
04-13-2010 06:48 AM
Well,
Have some VI that gives me the number of I32 interations??
and at header, could you attach a image showing me how to make it?
like values needed: time and samples only a simple example
so I can understand better and adapt to my program!
Thanks
04-13-2010 07:28 AM
Hi EduU,
number of I32 = data length (in byte) divided by 4 byte/I32.
The file length is also given by "File/Dir Info"...
Right now it's only guessing from my side. You have to know the file content and it's formatting. Once you know that (and suppose it's a rather simple file layout) you can easily calculate all needed values. But it's up to you!
File example:
*** start of file ***
HEADER:
start=12:34:56
sampling=00:00:02
name=Test measurement
...
DATA:
1234,5678,9012,...
*** EOF ***
04-13-2010 07:48 AM
Well, my program works with I16 so its
number of I16 = data length (in byte) divided by 2 byte/I16. ??
like I have a length of 100000 bytes so I have
100000/2 = 50000 I16?