I am trying to figure out how to use system.db.refresh() in a project in order to refresh the binding to our "LabelPrintRack" shared (global) script below. There are changes made to this script that I need to utilize in this project but I can't figure out how to refresh this connection. This is on a simple button-push event in the current project that feeds some parameters into the mentioned LabelPrintRack script.
Does anyone know if this is the right method to refresh this script connection? If so how exactly should the arguments look for this? Thanks for the help and sorry if this is a dumb question.
I have a project that is used for label printing that calls the LabelPrintRack function via inheritance. Let's say this project is called "PrintProject" and the global one is just called "Global." Global has the LabelPrintRack script that I need to call and use inside PrintProject.
But after updating the LabelPrintRack function in Global and saving that project, I have opened the other project PrintProject to find it is still "looking at" at the previous version of Global. So the updates I have made are not seen and thus I am running into a roadblock...
In your code in LabelPrintRack, are you using import to pull in the functions from Global? If so, don't. Just use the fully-qualified name of functions in Global anywhere else you need them. (You should never import a project library script. Only use import with java classes and jython site-packages.)
Nope, doesn't look like that is how it is set up. I am working with a legacy Ignition MES made by someone who is no longer around, so I'm always open to ways to do things better.
Can I ask why that is bad practice? Just so I can understand things a bit better
When you import a project script, it'll bring a copy of the Python code into the local script as it was at the time of import, which can cause all kinds of fun: