05-29-2012 04:27 PM
It still didn't provide the time starting from zero. It always starts from 5 or 4 (dont know why!!) I put a Get date time in seconds inside the while loop, and the other one before the loop, and then subtract each other. I also created another input in the subvi to obtain the substraction result and save it in the file.
05-29-2012 04:50 PM - edited 05-29-2012 04:51 PM
Since you did not show your code, I have no clue what might be wrong. The basic code below works.

05-29-2012 04:54 PM
I did exactly the same thing as you did!
05-29-2012 05:05 PM
No. I think you probably attached the wrong subVIs.
05-29-2012 05:06 PM
No this is my main VI containing the sub VI I posted before
05-29-2012 05:19 PM - edited 05-29-2012 05:19 PM
Write data to file has a different connector pattern than what's expected in the main VI. (the main VI expects an additional DBL connector, which the subVI does not have). After relinking, the VI is broken.
05-29-2012 05:23 PM
Sorry this is the sub VI which is supposed to be correct one
05-29-2012 05:27 PM
Format it as a plain integer (%d), not a time.
05-29-2012 05:45 PM
Sorry but it appeared only 01,01,01.... after chaging to %d in the sub vi
05-29-2012 05:54 PM
Look at the help for the format time VI. The format string you want would be "%S%d", just like I had posted earlier. The %S gives you the interger seconds value from the timestamp and the %d gives you the fractional part.
I still think it is bad programming to put the delay in the subVI. Let the application control the timing, not the subVI. You should also be aware that the current time you take in the loop will be one of the first things to execute. So, if you other code takes some time to process you may want to force the time stamp to be obtained after the processing has completed.