12-06-2010 11:38 AM
I cannot seem to save the elements in the array. If I stop the program and restart it, the array starts from 0 again. I want it to start from the value it stopped at.
Is it a shortcoming in the SubVI "Timer A1"?
Thanks for the help.
mhaque
Solved! Go to Solution.
12-06-2010 12:04 PM
Use the "Set File Position" function and set it to the end after the open and before the first write.
12-06-2010 12:58 PM
Hi Omar I did as you told, but it does not seem to work.
12-06-2010 01:32 PM
@mhaque wrote:
Hi Omar I did as you told, but it does not seem to work.
No you didn't. He told you to set it to "end". You have it set to "current".
12-06-2010 01:35 PM
I did set it to "end" but but it still did not work. Should I use a different file format or is there something instrinsically wrong with my code?
mhaque
12-06-2010 01:46 PM
Your Feedback Nodes are set to Globally Initialize on the First Call, as evidenced by the glyphs. If you are stopping and starting your program, they should be set to Globally Initialize on Compile or Load, just Right-Click and change the setting. This should give you the behavior you are looking for, but does not rule out intrinsic problems with the code.
12-06-2010 01:48 PM
Try again. It works for me. The only other thing I did was set the file open to "open or create" and disable the reading part that you have outside the loop since I didn't have your existing file.
12-08-2010 09:33 AM
The VI works for me well but I still have a few queries.
Firstly could I use the SubVI "Timer A1" as rentrant?
Secondly if I close the program, the timer again starts from 0. How do I make it start from the time I left it at when I close the program?
Thanks
mhaque
12-08-2010 09:42 AM
@mhaque wrote:
How do I make it start from the time I left it at when I close the program?
You will have to save the time to a file and then read it in again at the start of your program.
12-08-2010 09:54 AM - edited 12-08-2010 09:55 AM
Omar Wrote
You will have to save the time to a file and then read it in again at the start of your program.
I put in the following code. It still does not work. Perhaps I made a mistake.
mhaque