LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Save data starting with 0 second

Solved!
Go to solution

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.

0 Kudos
Message 11 of 36
(1,642 Views)

Since you did not show your code, I have no clue what might be wrong. The basic code below works.

 

0 Kudos
Message 12 of 36
(1,636 Views)

I did exactly the same thing as you did!

Download All
0 Kudos
Message 13 of 36
(1,629 Views)

No. I think you probably attached the wrong subVIs.

0 Kudos
Message 14 of 36
(1,626 Views)

No this is my main VI containing the sub VI I posted before

0 Kudos
Message 15 of 36
(1,624 Views)

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.

0 Kudos
Message 16 of 36
(1,616 Views)

Sorry this is the sub VI which is supposed to be correct one

0 Kudos
Message 17 of 36
(1,611 Views)

Format it as a plain integer (%d), not a time.

0 Kudos
Message 18 of 36
(1,609 Views)

Sorry but it appeared only 01,01,01.... after chaging to %d in the sub vi

0 Kudos
Message 19 of 36
(1,604 Views)

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.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 20 of 36
(1,601 Views)