01-04-2024 12:01 PM
Hi,
I have made an application from a few VIs.
When I try to run the application, I get following error:
This happens only if I try run the application. This DOES NOT occur if I run the VIs in developer mode.
I have configured all the filepaths in all VIs such that they allow new or existing files.
Thanks in advance. I appreciate your suggestions.
Solved! Go to Solution.
01-04-2024 12:03 PM - edited 01-04-2024 12:08 PM
Hi Sudipta,
@SudiptaDas wrote:
This happens only if I try run the application.
So which filepath is used in your app when that error occurs?
Did you add any debugging code to handle that error?
@SudiptaDas wrote:
This DOES NOT occur if I run the VIs in developer mode.
I don't see any UI handling code in your main VI!
When you start the executable it will immediatly run and so it will use those empty filepath controls to call the subVIs!
Why do you wonder about the behaviour of your executable when you don't provide any useful UI handling?
01-04-2024 12:26 PM
Hi GerdW,
Thanks for your reply.
It seems to me that as an amateur LV coder I do not know enough about building an executable.
So, what kind of UI handling code is a standard practice? Will a simple state machine work?
I did not know that the executable runs immediately after start. Is there a way to circumvent that?
Thank you
01-04-2024 12:47 PM
Hi Sudiptas,
@SudiptaDas wrote:
I did not know that the executable runs immediately after start. Is there a way to circumvent that?
So you open your favorite browser executable and you need to explicitely "start" that exe to be able to access the internet?
You open MSWord and there is a "run me" button before you are able to edit any text document?
Which other executable can you name that does not immediatly run after start???
(And no, there is no way to prevent an executable from running immediatly. It is the purpose of an executable to run after start!)
@SudiptaDas wrote:
So, what kind of UI handling code is a standard practice? Will a simple state machine work?
You need a way to wait for user actions!
A simple (polling) state machine would be fine, and other approaches like a QMH with some user event handling loops too…
01-04-2024 01:00 PM - edited 01-04-2024 01:00 PM
Hi SudiptaDas,
Here is a simple example of UI handling using an event structure within a while loop.
The report generation is executed when the "Generate" button is pressed.
If an error occurs when generating the report, a dialog box will display it.
Also clicking on the top-right cross of the window closes the application.
Regards,
Raphaël.
01-04-2024 01:33 PM
Hello,
Thanks for your response! It seems like you are quite upset at my lack of knowledge about software.
I found a way to circumvent immediate run after start:
In "Source File Settings" check "Set VI properties for all contained items":
Then go to "Customize VI Properties" just underneath it, and uncheck "Run when opened" under "Execution":
It did the trick well enough for me for what I needed. I am very much willing to accept that that should not be the "Right Way" to do things.
Best wishes 🙂
01-04-2024 01:35 PM
Hello Raphael,
I appreciate the suggestion. Thank you:)
01-04-2024 01:36 PM
Hi Sudipta,
@SudiptaDas wrote:
I am very much willing to accept that that should not be the "Right Way" to do things.
It isn't the right way to create an executable that doesn't "run when opened"…
@SudiptaDas wrote:
It seems like you are quite upset at my lack of knowledge about software.
Because you claimed you know no other software that "runs when opened"…