05-29-2012 06:03 PM
Neither %S%d nor %S nor %d provided the result that I want. It didn't start from zero in the save file. With %S%d, the time in the file was starting from 0301, 0302 ... which is wrong.
I put the delay function in the sub vi because I want the user to be able to adjust how fast the data is saved.
05-29-2012 06:29 PM
If you want the time to start at 0 you will have to place your initial timestamp in the loop itself and get it at the same time you get the iteration timestamp. This will only be done the first time you execute the loop. Place this timestamp into a shift register and use that value for all other iterations of the loop.
As for the time being in teh subVI it is still a very poor design. This is effectively a task of the UI of your program and should be done at that level. The subVI should simply be called and do its work. No delays or anything else. What would happen if someone tried to use this subVI in another program. They may not want the delay or have some other method of controlling when this subVI is called. By place the wait in the subVI you have made this subVI much less reusable.
05-29-2012 07:17 PM
05-30-2012 02:38 AM
05-30-2012 03:34 AM
@ Mark Yedinak,
I would appreciate if you can adjust directly in my code. I already tried what you have said but it didn't work.
05-30-2012 10:21 AM
Here is the VI.
05-30-2012 02:01 PM
Could you please save it in 2010 version? thanks
05-30-2012 02:38 PM
Here it is.
05-30-2012 02:50 PM
Thank you for adjusting my code. It does starts from zero. However, when it reaches 60, it comes back to zero again which is supposed to be 61 instead. How can I program that?
05-30-2012 02:54 PM
You could modify the format specifier for the Format String to include the minute value. Or you could simply format the difference you calculated using a regular format string (or format number into string).