Perspective - return to "default" page

I’m using an iPad with the perspective app to run a machine that from time to time will be unplugged and moved to a different place. The gateway PC and PLC will therefore be powered down, but the iPad remains powered on - as soon as it loses the gateway connection it indicates as such, but takes no other action.

What I’d ideally like is for the session to navigate back to my “startup” page as soon as it loses connection*, which is just a branding ‘splash screen’ of sorts which gives some basic information about the startup procedure that is run through when the machine is powered back up. Then when the connection is restored, you immediately see the progress of the startup.

I don’t imagine that this is possible, as with no gateway to serve up the page, it’s not likely to be able to load it. Unless there’s some way of caching that page? And then, of course, is there a way to detect the gateway disconnection from the perspective session and take some sort of action?

Assuming the above is not possible, can I at least detect the gateway reconnection, and take some action on that event?

At the very least, I can detect the “startup procedure active” tag becoming true, and configure an action - but I’m not sure how to get the session ID when the event trigger would be at the gateway level. In my application, I only have a single perspective session license, so there’ll only ever be one - but even if that changed and there were multiple, I’d like to force all active sessions back to the loading screen.

*I know that in most applications this would be undesirable. Our machine is very small, will be used in small rooms, and the WAP that the iPad connects to is built in to the machine. It has a range of about 50m, and the operator will be within 5m of it 100% of the time. So unless someone takes the iPad to the bathroom down the hall and is still trying to run the machine, there should be no networking issues. Initial tests have shown it to be extremely reliable, so we’re confident that this approach won’t give much, if any, grief.

Any ideas? Even just an idea on how to trigger a view change off a tag change event would get me moving. The script itself is simple, but the problem is that the tag change happens at the gateway level, which means there’s no implied session ID to pass to the function.

Ok, there’s a bit going on here.

First of all, navigating to a different page while the gateway is gone is actually quite feasible. All of the pages/views are loaded at the beginning of the perspective session (in anticipation of a future, more fully-featured “offline mode”), and navigation is a 100% client-side action, so no problems there.

However, the logic to detect the disconnect and perform the navigation is, like you found, not there. I think we’d have to build some sort of “If I’m disconnected for more than X seconds, navigate here” type of thing, which isn’t likely to happen anytime soon.

Now, once the session re-connects, of course we have more options. We have a ticket that should be done soon that will allow you to fetch all of the active session numbers. But perhaps in the meantime you could simply add a session custom property bound to the tag you care about, and attach a property change script to that session property. That way the script executes in the session’s context already, no need to find the ID.

2 Likes