Ignition 8 Tag Event Script

ignition80
#1

Hi,
I created two projects,
Automation is the real one,
Automation_script has only scripts to share:

On Automation_scrip I imported the old scripts

tag_02

On Automation they complete correctly

tag_03

if I use a button to call up the function everything goes correctly

If I insert the same function in the Tag > Tag Event Script

Now what I don’t understand,
NameError: global name ‘shared’ is not defined
??

0 Likes

Ignition 8 SFC Scope to Project Scripts
#2

There were some bugs around this in the 8.0.0 release - can you try 8.0.1-rc1?

0 Likes

#3

Ignition v8 has a whole different architecture for shared scripts. If you restore a complete gateway backup, it’ll create a parent project to replace the shared environment, but if you import project by project, you have to shuffle the structure yourself. ‘shared’ won’t exist, as you’ve experienced.

Sorry, didn’t look close at your inheritance diagram… /-:

0 Likes

#4

Absolutely try upgrading to 8.0.1-rc1, but to clarify, is the Automation_script project configured as the Gateway Scripting Project?

Gateway > Config > Gateway Settings > Gateway Scripting Project (at the bottom of the page).

1 Like

#5

Hi,
y use the release 8.0.1-rc1

this is the Gateway Scripting Project

0 Likes

#6

According to your other screenshots you should have the value “Automation_script” for that setting, not “globals”.

0 Likes

#7

0 Likes

#8

Right, you do not have a project named globals, so we need to update the scripting project for your gateway.

Navigate back to the Gateway Scripting Project property in my earlier post, and set it to Automazione_script, and Save Changes.

0 Likes

#9

Ok, perfect.

0 Likes

#10

hey Paul. thanks for this post. I was struggling to get tag event scripts working with libraries, and didn’t know about this new Gateway setting.

This page in the 8.0 documentation really needs updating.
https://docs.inductiveautomation.com/display/DOC80/Project+and+Shared+Scripts
I understand there’s lots do in documentation, but IMO, this is high priority since previous behavior changed and the information here is incorrect.

Also, this page should define how library routines can be accessed by the tag event script.
https://docs.inductiveautomation.com/display/DOC80/Tag+Event+Scripts

0 Likes

#11

My friend, that is an understatement. :sweat_smile:

Joking aside, I agree. This Gateway Scripting Project concept was a major change that seems to have gotten lost in the shuffle. We apologize for the headaches that the outdated page caused.

I went rogue and created a quick replacement page: https://docs.inductiveautomation.com/display/DOC80/Project+Library

Additionally, I added a small heading and link on the Tag Event Scripts page linking back to the relevant information on the Project Library page, as you suggested. I’d like to spend a bit more time on the Project Library page and add some additional content (adding extra examples and such), but hopefully the changes on the page now should prevent folks from running into the same troubles.

4 Likes

#12

Perfect! I took a look at the new page, and I think it looks great.

Nicely done! Once again the IA team exceeding expectations.

1 Like