02-03-2009 11:29 PM
Here is soemthing I think would work for you.
I was thinking of some sort of state machine architecture. But instead I tried to be a bit slick with it and use some booleans to convert to 4 potential states based on whether the Save data button is pressed or not, and whether it was pressed in the previous iteration or not.
02-04-2009 01:13 PM
That *was* slick. Perhaps you are the Ray Lewis of LabView. It works perfectly with one exception - Case 2 returns an error if you have already toggled the Record Data Boolean to false, because the files have already been closed. I guess I can try to rig something clever myself.
I've only got one more medium sized task before I complete this interface and send it packing into the field - maybe you hear from me, maybe you don't - either way, I am very grateful to you and the rest of the LabView community for all the help during this process!
02-04-2009 01:28 PM
02-04-2009 02:08 PM
CodeMunkee wrote:That *was* slick. Perhaps you are the Ray Lewis of LabView.
It works perfectly with one exception - Case 2 returns an error if you have already toggled the Record Data Boolean to false, because the files have already been closed. I guess I can try to rig something clever myself.
You're right. I didn't try everything out. My philosophy was that if you hit Stop while you are logging, you want to be sure that the file is closed before the program ends. On the other hand, if you already undid the logging, then the file is already closed and the file reference becomes invalid. Thus closing it again causes the error.
There are a few choices to solve this. Once is wire up the error handler to a clear error function as it comes out of the close dialog. Thus ignoring all errors. Another is to clear only that specific error. Another is to check whether the file reference is valid and only close it then.
I've only got one more medium sized task before I complete this interface and send it packing into the field - maybe you hear from me, maybe you don't - either way, I am very grateful to you and the rest of the LabView community for all the help during this process!