Jump to content

Starting an EXE but not running on startup


Recommended Posts

Hello,

I need to have my EXE open when a user double-clicks the application, but I don't want the actual compiled VI to begin execution when opened. The user needs to enter several parameters prior to execution, like entering system serial numbers and such. Then, the user can hit the Run button and the program can run normally. This is only an issue on initially opening the application. Once the application is open, has run, and terminates normally, the user can change the parameters and run the application with Run again without issue.

Is there a parameter I can set somewhere that will open the application but not run it? I don't know the right search term to figure out how to ask the question to find this parameter.

Thanks!

Link to comment

QUOTE (Aaron L @ Oct 17 2008, 11:08 AM)

Hello,

I need to have my EXE open when a user double-clicks the application, but I don't want the actual compiled VI to begin execution when opened. The user needs to enter several parameters prior to execution, like entering system serial numbers and such. Then, the user can hit the Run button and the program can run normally. This is only an issue on initially opening the application. Once the application is open, has run, and terminates normally, the user can change the parameters and run the application with Run again without issue.

Is there a parameter I can set somewhere that will open the application but not run it? I don't know the right search term to figure out how to ask the question to find this parameter.

Thanks!

Aaron,

I think the preferred method to solve this problem is that you edit your application to add a Run or Start button as part of the application. In other words the LV application does run immediately and waits for you to enter the parameters. Then when you are ready to execute, you press the new button on your UI which starts the main operation of your application. Once it completes the first operation, it goes back to the Wait state, waits for the new parameters, and you press the new Run button again. The actual LV application does not stop between these operations.

Link to comment

QUOTE (LV_FPGA_SE @ Oct 17 2008, 09:15 AM)

Aaron,

I think the preferred method to solve this problem is that you edit your application to add a Run or Start button as part of the application. In other words the LV application does run immediately and waits for you to enter the parameters. Then when you are ready to execute, you press the new button on your UI which starts the main operation of your application. Once it completes the first operation, it goes back to the Wait state, waits for the new parameters, and you press the new Run button again. The actual LV application does not stop between these operations.

Christian,

Thank you for the idea! Unfortunately I didn't forsee this issue when I first began development. I believe I can see a way to do such a thing, now that you mention it.

However, I have the pleasure of answering my own question as well. In the Build Menu, select Properties->Source file settings->Customize VI properties button -> Execution selection - > uncheck Run when opened. Hopefully this will help someone in the future.

This will open the application but not begin running it. It's not the prefered method, but it achieves my current goals. I'll develop with a better LV methodology in the future, thanks!

Link to comment

QUOTE (Aaron L @ Oct 18 2008, 05:21 AM)

Christian,

Thank you for the idea! Unfortunately I didn't forsee this issue when I first began development. I believe I can see a way to do such a thing, now that you mention it.

However, I have the pleasure of answering my own question as well. In the Build Menu, select Properties->Source file settings->Customize VI properties button -> Execution selection - > uncheck Run when opened. Hopefully this will help someone in the future.

This will open the application but not begin running it. It's not the prefered method, but it achieves my current goals. I'll develop with a better LV methodology in the future, thanks!

Hi Aaron

I had the same problem when I started coding and made my first exe.

In code, I would type in all my values then press the LabVIEW run button, run the code and get my answer.

As a compiled exe, it would start straight away and would ruin everything.

So I am guessing the following may help (as it helped me)

This was until I learned about the Event Structure (and design patterns).

Building a UI into an application as FPGA suggested is far more productive then stopping the VI from running at startup.

Do a little search on Producer Consumer (Events) to see how a UI event will trigger state(s) to run in a working (main) loop.

Now the application will be running - but you (or the user) controls the execution of events, and does so expending minimal CPU resources.

Once you get this powerful design pattern, it will really accelerate your development.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.