LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I clear out the file path name each time when I restart my program?

Currently, the file name still stays even though I have stopped my program from running. The only way I can restart it completely is to close the vi and bring it up again. How can I clear out the file name each time?
0 Kudos
Message 1 of 9
(3,747 Views)
Hi,
The easiest way is to create a local variable of your control and write the path constant to it at the beginning of your VI. This constant could be equal to empty path or to some specified by you default path.

Good luck.

Oleg Chutko.
Message 2 of 9
(3,747 Views)
This seems to clear out the file path name fine when I initally start the program but then after stopping the program and then restarting it, the path is saved to the previous filepath and it will not prompt the user for a new file. How do I correct this?
0 Kudos
Message 3 of 9
(3,747 Views)
Try using a property node and writing an empty path to the "value" property of the node. Then put the property node in a sequence structure at the beginning of the program with the empty path constant that was referenced above wired out of the sequence loop to the edge of your main program loop. This will ensure order to the operation.

I'm not sure if this is what you are trying to do, but take a look.
0 Kudos
Message 4 of 9
(3,747 Views)
you could also do the same thing at the end if you want to clear it out when the program ends. Just wire a value from your main program loop into a sequence structure with the property node in it.
0 Kudos
Message 5 of 9
(3,747 Views)
Thanks for your help. Can you send me a copy of your vi in 6.0 version? I am still running off an older version of Labview. Thanks!
0 Kudos
Message 6 of 9
(3,747 Views)
I looked at the VI that you did and I'm confused about something. You have a state machine to handle most of the user interface events but didn't include the acquisition(?) and the file write in there. It appears that you can stop the VI without the state machine ever leaving the idle state or at least not always reaching the stop state where you've cleared the path. Putting everything into the state machine makes more sense to me but then I'm not sure at all what the rest of the program is designed to do.
0 Kudos
Message 7 of 9
(3,747 Views)
The point of this was to be able to when user prompted, continuously have data input into a file. While this is going on, there would also be the ability at the user's discretion to either edit the timer or other functions. I am a novice at this so the structuring might seem confusing.
0 Kudos
Message 8 of 9
(3,747 Views)