12-02-2010 01:52 PM
First some basics.
I don't know why you save the steps value. Isn't that give by the array size? Too many degrees of freedom!
You don't need to set the file position.
You haven't solved the original problem. Basically, you want to check if the file exists (e.g. defaults.mpc) before the main loop and
if the file exists, read it, it it does not exist, keep the defaults
After the main loop has finished, overwrite the values to the same defaults.mpc. (Or do it in the "panel close" event).
If you want to specify paths, You should use a file dialog and skip the rest of the file IO if its cancelled.
Here's a quick rewrite of the file IO parts.
12-03-2010 09:30 AM
12-08-2010 02:06 PM - edited 12-08-2010 02:10 PM
Hey altenbach
Where does the VI initialize, i.e from where are the zero filled arrays created.
I want to place a read/write binary file and I am wondering where I should wire it to, to save the timers when I exit the program.
Otherwise the timer starts from 0 which is not what I want.
Thanks
mhaque
12-08-2010 03:22 PM
Whew, what a mess.
It is difficult to make sense because of of all the overlapping wires and structures, but there are some serious flaws:
12-08-2010 05:48 PM
Hi altenbach I did as you said but I still can't get the file to save. Also I am getting an error message when I stop the loop.
12-08-2010 06:07 PM
No, you did not do as I said. Look at the data dependency. You are reading from the file only after the loop has finished and you are branching the file ref so the reading and writing occurs at the same time. That's not good.
Also, writing to an indicator does not change the wire value leading to it. Think dataflow!
Try something like this, maybe it can give you some ideas..
(Note that the code is incomplete and does not do all required error handling, etc.)