10-22-2012 05:59 AM
Hi,
I prepared an executable VI. It works fine but when I start it, it runs immediately. I dont want it to run immediately because I have to set some parameters on the vi. How could I fix it? I could not find any function about it.
10-22-2012 06:02 AM
Build another VI on top and select this as startup VI. This VI will ask for the parameters and call the now-used startup VI as subVI passing those parameters.
Norbert
10-22-2012 07:02 AM - edited 10-22-2012 07:07 AM
I do not understand what you meant. I attached the execeutable. How could I do it?
10-22-2012 07:24 AM
When configuring the EXE build script, you selected one VI to be the "top level VI" aka Startup VI. This VI will automatically start to run when the EXE is called (double click).
So if you want the EXE to wait for parameters (dialog?), you have to implement this and exchange that with the top level VI. Of course, this new top level VI must call your previous top level VI as a sub VI.
Norbert
10-22-2012 07:46 AM
@Norbert_B wrote:
When configuring the EXE build script, you selected one VI to be the "top level VI" aka Startup VI. This VI will automatically start to run when the EXE is called (double click).
So if you want the EXE to wait for parameters (dialog?), you have to implement this and exchange that with the top level VI. Of course, this new top level VI must call your previous top level VI as a sub VI.
Norbert
You mean like a state machine?
10-22-2012 07:54 AM
A statemachine is a framework pattern for VIs to execute "sub code" in a certain order.
So, essentially, you can use a statemachine for the new top level VI.
You can, on the other hand, of course introduce a statemachine in your now-top level VI with the first case to wait for parameters or to cancel. If parameters are passed, you go into your "normal application using those parameters", if cancel is pressed, you go to the cleanup/shutdown case.
Norbert
10-22-2012 08:23 AM
Thank you Norbert. I will try your suggestions.