03-26-2009 11:45 AM
Hello everybody!
I have problem creating executable files. I want the files not to start running until the user don't write some parametres. So I want that the user could fillful some fields and when he finishes, he could launch the program using the white arrow (like when you are executing it using Labview).
When I create one of the file I unselect the option of "run when it starts", and i get the white arrow in the executable front panel. However, i try to do the same with the other files and I am not able. Could sb. explain me which are the steps I have to take to let the user control the execution??
Thanks!
Solved! Go to Solution.
03-26-2009 11:57 AM
You could always just run the VI on startup, as is default and do some extra code so that the user can control the execution:
You could check the values of the fields to make sure that they have been changed, when they all have, run the code.
You could have a "start" button on your front panel that would be the conditional for a while loop at the very beginning of your code
You could use an event structure, and only execute the code once the user has pressed a certain button, or a certain field was changed.
03-26-2009 11:58 AM
This is quite common, but most of the time you don't need to programmatically "run" the main VI. There are ways to do that, but I don't think you need to.
You can just have your user-input parameters run in a loop as shown. After the user enters the settings and hits OK, the main program loop runs.
03-27-2009 05:10 AM
Thanks Broken Arrow and Chris for your ideas. I think I will use or the start button solution or the secuence one. 🙂
But after reading your answer I went on confused because I didn't understand why there was a white arrow in just one of the executable but not in the rest of them so I looked attentively to all the properties of executables files to find the differences. And my mistake was a very silly one: In the project of the file in which I could create the executable the START VI was the first file of the tree, however in the other cases the start vi was in other position of VI. So when I was checking the properties of the source file setting, in the successful case I was checking the properties of the start vi (and I unselected in the Customize VI Properties the "run when it starts" option), however in the other cases I was changing the properties of a subVI of the program and I wasn't doing it for the main vi.
Thanks!
1000A