Ignition fails to load a script file

Ignition Perspective 8.1.42

At random, infrequent times, I get errors referencing script files. I've included a screen shot of an example for "shared.Tables" -- it occurs with other scripts.

It seems to happen most often with "valueChanged" (on change) and "onStartup" events.

I tried adding an explicit 'import' and the error is "ImportError: No module named shared"

Without the import, the error is "No global named shared"

Error Log:

On change script:

If this is a valueChanged event on a tag, make sure that the project containing the "shared" scripting library is also defined as the gateway project library where the tag is defined.

This is my only suggestion, I'll let the experts chime in in case this does not solve your issue.

EDIT: I'm dumb, this is obviously a property change script, my bad but might be worth trying?...

1 Like

You shouldn't need to import shared. Remove that import and see if that helps.

3 Likes

As I tried to make clear in my original post, I've tried it both ways.

With the import, the error that pops up is "ImportError: No module named shared".

Without the import, the error that pops up randomly is "No global named shared".

To be clear, 99% of the time I don't see any errors from the prop on change script. Just trying to figure out why I sometimes get this one.

The most likely explanation is just "it's a bug". An intermittent problem with otherwise identical code sounds like a race condition in the script initialization process. It would be interesting if you could correlate "times it didn't work" with "times changes were made to the project or project(s) in the Designer and saved". I have a suspicion they would be related to each other.

I would encourage you to contact Support - they may or may not have a fix, but if nothing else can collect more detailed information from you and help get this issue in front of the right development team to take a detailed look.

2 Likes

Hmmm. Why does that sound familiar... :wink:

Paul-

Your suspicion is probably correct. There does seem to be a correlation between project saves/updates and when the error occurs.

Thanks for the tip.

-Shane