Multiple Tab Issue_

We developed one Perspective project. The project scripts run in both component and gateway scope. Sometimes, we face issues where the scripts do not run properly because the operator either closes the project while it is running, or opens the project in multiple tabs.

How can I prevent this issue?

Currently, when the project is logged in, we write TRUE to a tag, and when the operator logs out, we write FALSE to that tag. If the tag is FALSE, then login is allowed; otherwise, it is not.

The problem is that sometimes the operator does not log out and simply closes the Edge browser. We tried writing a shutdown script, but it is not working.

How can we solve this problem???

Ignition is intended to allow multiple logins. Is there any valid reason for only allowing 1 user at a time? Usually you should make your program work with any number of users logged in at any time.

If multiple users are allowed to log in, then the script does not run properly, because we are getting values from OPC tags and the script runs on valueChanged. If multiple tabs are opened, then the script runs two or more times.

This sounds like this should be a gateway tag changed script, not a session based script.

Maybe share your script, how it is supposed to work and where it’s located and we will be able to engineer around the issue with you?

1 Like

Why do you have to write True and False to a tag when operator logs in and out?

Why not use the session property self.session.props.auth.authenticated to check if operator is logged in or not?

1 Like

Sounds like an xy problem.
Tell us what your end goal is and we’ll help you figure out a better way to do it, instead of working around a broken methodology.

4 Likes