Hi Ben
Is there a way to close the FC10 Runtime.exe with a command in the App?
Or is there a way to prevent the app from closing before data is saved or a stop command is sent to a machine?
In the simulation it's working with a while loop and a end switch
regards
Stefan
App Developer Runtime close with a command
-
- Valued Contributor
- Posts: 997
- http://meble-kuchenne.info.pl
- Joined: Wed Dec 02, 2020 10:53 am
- Has thanked: 190 times
- Been thanked: 217 times
-
- Matrix Staff
- Posts: 1465
- Joined: Sat Dec 05, 2020 10:32 am
- Has thanked: 204 times
- Been thanked: 347 times
Re: App Developer Runtime close with a command
Hi Stefan,
There is no easy way to programmatically close a Flowcode App Developer app. I will add to my list to investigate.
But there is a way to prevent the app from closing (although the user can override this by pressing 'ignore' when the warning appears).
I have attached a simple app and project to show this behaviour. The Event you need is "Components.ProjectClosedown", and returning a non-zero value from this event will show the warning message.
There is no easy way to programmatically close a Flowcode App Developer app. I will add to my list to investigate.
But there is a way to prevent the app from closing (although the user can override this by pressing 'ignore' when the warning appears).
I have attached a simple app and project to show this behaviour. The Event you need is "Components.ProjectClosedown", and returning a non-zero value from this event will show the warning message.
- Attachments
-
- shutdowntest.fcsx
- (14.69 KiB) Downloaded 376 times
-
- shutdowntest.mscada
- (4.32 KiB) Downloaded 400 times
-
- Valued Contributor
- Posts: 997
- Joined: Wed Dec 02, 2020 10:53 am
- Has thanked: 190 times
- Been thanked: 217 times
Re: App Developer Runtime close with a command
Hi Steve
Very good !
I will use this into my programs for now.
I would like to test later when you have new commands to close the app.
Just a little remark
Unfortunately, this small square stops immediately but the user should not use this.
regards
Stefan
Very good !
I will use this into my programs for now.
I would like to test later when you have new commands to close the app.
Just a little remark
Unfortunately, this small square stops immediately but the user should not use this.
regards
Stefan
- Attachments
-
- Snag_102647.png (133.21 KiB) Viewed 3012 times
-
- Matrix Staff
- Posts: 1926
- Joined: Mon Dec 07, 2020 10:06 am
- Has thanked: 501 times
- Been thanked: 684 times
Re: App Developer Runtime close with a command
Hi Stefan,
There is a Simulation Stop event that you could use to catch users clicking the stop button, In the event macro you could either restart the sim or close the app.
There is a Simulation Stop event that you could use to catch users clicking the stop button, In the event macro you could either restart the sim or close the app.
Regards Ben Rowland - MatrixTSL
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel
-
- Valued Contributor
- Posts: 997
- Joined: Wed Dec 02, 2020 10:53 am
- Has thanked: 190 times
- Been thanked: 217 times
Re: App Developer Runtime close with a command
Hi Ben
Yes, I understood a little but not completely.
The input Message window opens but the program is already closed.
Does that have something to do with the error message? I choose yes then the input Message windows open
But there is no count/down or count/up
regards
Stefan
Yes, I understood a little but not completely.
The input Message window opens but the program is already closed.
Does that have something to do with the error message? I choose yes then the input Message windows open
But there is no count/down or count/up
regards
Stefan
- Attachments
-
- FC10_post_stop1.fcsx
- (18.09 KiB) Downloaded 316 times
-
- Matrix Staff
- Posts: 1926
- Joined: Mon Dec 07, 2020 10:06 am
- Has thanked: 501 times
- Been thanked: 684 times
Re: App Developer Runtime close with a command
Hello,
You can't really have blocking code inside the event macro but I have edited the stop macro so that now it just starts the sim running again. Hopefully helps to avoid the user clicking that pesky stop button.
You might need to check that variable values aren't reset and if they are then you might need to store them in the stop event and restore them after.
You can't really have blocking code inside the event macro but I have edited the stop macro so that now it just starts the sim running again. Hopefully helps to avoid the user clicking that pesky stop button.
You might need to check that variable values aren't reset and if they are then you might need to store them in the stop event and restore them after.
Regards Ben Rowland - MatrixTSL
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel
-
- Matrix Staff
- Posts: 1465
- Joined: Sat Dec 05, 2020 10:32 am
- Has thanked: 204 times
- Been thanked: 347 times
Re: App Developer Runtime close with a command
If you don't want the "stop" button in a deployed app, select ""no controls" or "start/pause" under "execution controls" when deploying it.