Module Referencing Issues on Tag Value Change On Ignition 8.3.6

Hi Dear,

I just found out that Ignition 8.3.6 has module referencing issues on tag value changed event.

This is the situation:

i do have modules like:

on console script i can reference those module without any error:

but i put the same lines of code inside the tag value changed event script, it would trigger an error:

i got an error on my logger:

Originally i did run this on 8.1.26 and didn't get any issue at all.

Just wondering what to do to fix this ?

Regards

It's considered bad practice to import your script libraries into other scripts in Ignition. It's possible they blocked it in 8.3 but not certain because I don't ever import libraries anywhere else. Reference the functions by their full name everywhere they're used and you'll probably be fine.

Thanks for your feedback. This is what change i made (wrote all namespaces instead of using import statement as seen previously):

but i am still getting errors:

This is my constant interval module

Regards

This is caused when somebody introduces an error into the library script. It's usually a missing colon or mismatched parenthesis.

I am not sure what you meant. But it was working before on 8.1.26. I can't see any syntax error

as i tried to run it on Console Script, it works very well.

I have many library scripts and multiple projects. None of them broke when I upgraded to 8.3 ~ They are currently on 8.3.7

I have seen this exact error multiple times before when something is goofed in the library script itself. Look along the vertical scroll bar in the interval script for a red rectangle indicating an error:

Perhaps somebody missed a colon from one of the classes or functions, or perhaps somebody tried to alternate spaces and tabs when indenting.

Is the specific script included in your gateway scripting project?

Thanks for your response. But i couldn't find any red indicator as you mentioned.

Yes. if you see my first picture... all the scripts were there. There was no issue when i worked on this project on Ignition 8.1.X then after upgrading my Ignition to 8.3.6 all the sudden the issue came out like this.

i called those scripts on CurrentInterval tag value changed event script.

Value Changed events on tags need to reference your global scripting project. That is what Phil is referring to.

This does not indicate if that project is configured as the Gateway Scripting Project. That's a Gateway Setting.

What project is configured on the gateway as your gateway scripting project? As @pturmel said, these scripts will need to exist in this project or in a parent to this project for them to work in tag change scripts.

Hi Michael,

This project doesn't has parent project at all.

So then your gateway scripting project will need to be set as that project where those scripts exist.

They are on the same project.

Look at the manual that @lrose linked. What project is set there for the gateway scripting project setting?

I just want to make sure that we are all understanding each other, because, at least to me it is unclear if you have this project set as the gateway scripting project or not.

Here is what we know about your set-up:

  1. You are trying to use these scripts in a Tag Change Script.
  2. The scripts are defined in the project.
  3. There is no parent project for this project.

Because Tags operate outside of a projects scope, the project doesn't need to be running for the tag change to occur, you have to define them in a place that the Gateway knows where they are. This is the Gateway Scripting Project. If the project the scripts are defined in is not set as the gateway scripting project, then the tag system will not be able to locate the scripts which will generate the error you are seeing.

i think you were right:

My bad, many thanks.

I think is happening again...not sure what's wrong.

I had set the Gateway Scripting Project to OEE-Launch-Pad

This is my OEE-Launch-Pad project. All scriptings are inside (on the same project).

I am getting an error while trying to call the interval modules.

No clue what's is going on here. After i switched from OEE LP to OEE-Launch-Pad then it was working. I did some modification here and there, then now the problem comes back.

You should not be importing any project scripts into other scripts. Full Stop.

If you don't want the admittedly painful need to type out the fully qualified name each time you want to use it then you can just set a top level variable.

INTERVAL = long.path.to.your.script.interval

if someInterval == INTERVAL.HOUR:
    #do something

Search the forum and you will find that importing project scripts as you are here opens you up to a whole host of potential issues.

This should clear up your error.