Some Project Resources not publishing

This may be a side-effect of the fact that Ignition doesn’t/can’t track the usage and retention of python code objects throughout the gateway. This means that when your script modules have interlocking dependencies, updating one script won’t impact the code objects that other scripts have imported. You may need to make a trivial change in all of your scripts and save them all together to get it to “take”. You may also need to disable then re-enable the entire project. Consider renaming the offending class/function and having all code call the (fixed) new name.

Some practices to consider:

  • Avoid using import with any shared or project script. Use the full name everywhere, which will get the latest code version as long as that name hasn’t been imported.
  • Avoid using shared scripts for anything that isn’t extremely well-tested and unchanging, especially if python classes are being instantiated. It is relatively safe to add new functions and classes to existed shared scripts.
  • The above means you should also be avoiding tag events, as they cannot call project scripts. Use tag change events instead.
  • Gateway event scripts are defined in a project, so use that project to contain the corresponding script modules. When there is a need to call some of its code from another project, take care to factor out the simplest and best-tested parts to move to shared scripts.
  • If you are storing persistent python objects in system.util.getGlobals() and/or using system.util.invokeAsynchronous() for long-running tasks, you must implement some mechanism to replace the old code objects and kill off the old versions of background functions.
2 Likes