Script Error Popup without interrupting the script

I have scripts on some of my components that have to possibility of creating an error. The usual ignition error box will popup but this will interrupt the script, there are some things I would like to complete after the error that don’t get complete. I have tried using the usual python try and except and it does help me finish the script upon error but I still would like that same ignition error window to popup. Is this something I could do?

When you do the try/except/finally you will need to create your own popup in the except block. Use something like system.gui.errorBox - Ignition User Manual 8.1 - Ignition Documentation or create your own generic popup to handle the error in there.

1 Like

Yes this is exactly what I need. Thank you.

You can also catch it, save the exception, then raise it at the end of your script when the rest of your processing is done.

What can I do if I want a popup in a gateway script upon failure. I know it’s not possible to open windows in the gateway scripts but I don’t see how I could put this in a client script. The code should only execute once on a tag change, I don’t want it to happen for each client open.

How I’ve done that in the past is to put the exception information in a tag(s) and then have a client script that is running that is looking at those tag(s) and then takes appropriate action when it sees that tag value change.

You can’t. They don’t open a pop-up now, so there’s nothing to catch on the client side. Theoretically you can message to clients, but which client is to display it? All of them? What if no client happens to be open at that moment?

Could you open it on all clients and if it is closed on one, close on all?

You want to play with system.util.sendMessage().

1 Like