Hello,
I would like to close/discard a page based on the value of a variable.
Specifically, in my application I have parameter setup pages and a "work cycle" page that is displayed based on a start command, which can come from various sources (digital input, serial/LAN command, display button, etc.). Upon the start command, the interface sets variables on the device to execute the requested work cycle, execute the WorkCycleStart function in the device integration, and displays the CyclePage.
The machine is state-based, so when the work cycle is esecuted, the device status changes from "ready" to "running" (different values of the DeviceStatus property). The change of the status is managed in the device integration code, which also updates the property value on the GUI (as explained in your DeviceIntegration examples).
When the work cycle ends/interrupts, to exit the work cycle page, I have associated an observer to the state property in this page. When the variable changes and is no longer "Working" (value 5), the DismissDialog command is executed.

However, I have the problem that if the work cycle is too short to display the work page (less than 100ms), the page is displayed, the value of the status variable is "ready," and the observer doesn't catch the change, so the work page remains displayed.
How can I strengthen the link between the page and the variable? The goal is to prevent the page from being displayed when the status is anything other than "working".
Furthermore, to start the work cycle from digital inputs, I have created observers in the "base" page (the one that loads when the application starts and above which various parameter settings pages are displayed) linked to the input properties. This allows me to start the cycle from any page.
Considering the suggestion in the previous ticket ("Update ValueDisplay Outlet from another page"), is it better to handle the start commands as a system event instead of using PropertyObservers? Below is an image of the Default page (which loads the FirstPage at startup) with the Start1Slot code called by the Start1Observer.

Thank you for support!