I have a single workstation screen that is dynamic and open on workstation based on IP assigned to workstation. So, at one of the station multiple tabs with same workstation was opened so some scripts were triggered multiple time this has happened previous, so we use to close the other tabs then the everything starts working fine but now after closing also multiple triggers are received after gateway restart all things settles down. How we resolve this issue permanently?
Thanks for the support
Well... what's the trigger for this script ? Is it a gateway event ? A value change ? Something else ?
There's not much we can do to help without more details.
we have some custom params on root inside that we have value change script
Multiple "tabs"? As in, you somehow were able to open two tab container tabs at once? That is technically impossible.
Correct terminology is crucial for our understanding. If you mean Views, say Views. If you mean perspective clients, say perspective clients. Etc
I meant Multiple browser tabs. I can say same view were opened in the two different tabs.
I'm not sure what you expect to happen when two user interfaces are open, and have the same scripts. Why wouldn't they run for both clients?
If you want scripts to run once regardless of how many user interfaces are open, use gateway events.
If you want scripts that run once for a single browser, no matter how many browser tabs are open, use session events.
On custom params have opc tag bindings so when i am receiving values from OPC tags it triggers my script twice.
Yeah, expected behavior. View parameters are user-interface elements. If you need machine-triggered operations, those do not belong in user interfaces.
so, i have multiple browser tabs opened so it was triggering multiple time as expected but now those tabs are closed only single tabs is opened but still script is running twice. after gateway restart it is resolved and again this repeat on some stations.
Browsers don't always tell a webserver that a given browser tab was closed. Nothing Ignition can do about that. Refactor your application to put such scripts in gateway or session events.
So what about session params? will they so behave same when brower tabs are closed?
Session params won't generate duplicate events. But events might fire long after the last tab is closed--again because browsers don't tell webservers when tabs are closed.
You haven't shared anything about what the script is doing, so I cannot even advise where this script belongs. I can only make very general recommendations. You will have to share much more detail to get better advice from us here on the forum.
So here after receiving a value from OPC tag we have some custom logic that after execution writes again on other OPC tag.
In the above snapshot is the log file where we are writing during execution of the script
Sounds like something that belongs in a gateway tag change event, not in a user interface.
it's not a gateway tag change event it is tag binding on custom params.
My point is that the code needs to be moved to a more appropriate place in the Ignition project. That kind of operation should not be in any user interface.
ok got it
Unrelated to the topic, but instead of stringing together multiple indirect references such as here, you should pre-concatenate these into a single custom prop and use the new prop everywhere instead. Otherwise you're just making a lot more work for yourself, especially if something has to change. You can then also guarantee that all places it's used are all the same
Eg
Expression binding on view.custom.deviceTagPath:
"[default]Dewas/" + {view.params.CurrentAreaName} + "/" +
... Etc
Fwiw, I would also be passing in the start as well. Who knows what other project it might end up on. If you design it to be adaptable from the start you will thank yourself
Thanks, will look for implementing this as well