Scripting libraries for V8 and V7.9

Oh! Thanks a lot Griffith for the confirmation. i was breaking my head over it since yesterday without any clues as to what’s going on! I tried everything possible from restarting gateway, Reinstalling the designer , rebooting the computer!

When do you think I can expect it to start working again?

Is the gateway scripts issue resolved? I still don’t see the new scripts working in version 8.0.1 . They are being developed and tested in 7.9.10 and work fine there, but in 8.0.1 , It doesn’t see the new scripts!After copying and saving the new scripts , it still runs the old ones!Any clues? When can this be fixed or when is version 8.0.2 expected to be released?

I have installed the Ignition version 8.0.2, however the gateway scripts are still not running properly. For some reason the changes in the edited gateway scripts are not seen by the server! It runs the old version of scripts from somewhere (I don't know where its stored) ! Any clues? The version 7.9.10 works fine!

I would get in contact with support - issues like that are tricky to troubleshoot via forum.

I would appreciate it very much. Let me know if the gateway scripts are working from Ignition point of view for version 8! Till then I will continue my development on version 7.9.10.

Can someone confirm that gateway scripts are working normally and properly in Ignition Version 8? I am experiencing that they are not. Changes in gateway scripts are not seen in the output, it runs the old scripts!

We’ve tested gateway scripts, including start up scripts, and they are all working in 8. This appears to be unique to you, so working with support will be the way to go.

1 Like

That’s strange! How to work with support? I can send my project for version 8 which has these scripts. I fact the project and associated files are available in the github repository (www.github.com/pramanj/rmscada and www.github.com/pramanj/arscada) if someone can try them out.

By the way, I am not using perspective, I intend to use vision for clients. (Guess it doesn’t matter for gateway scripts). In fact I don’t need any client (neither vision nor perspective) as my scripts communicate with my remote clients thru pubnub for dashboards/geo location tracking/ and pretty soon my own mSCADA clients.

regards

https://support.inductiveautomation.com/

I guess it has got something to do with project inheritance! I install the new versions of Ignition like 8.0.2 and opened an existing project in designer , then some where down the line I imported a saved project, that has done the damage! I don’t know how the scripts work in inherited projects in version 8! I just recreated a new project and copied the scripts manually and it worked!

Can someone throw more light on how scripts work in inheritance! In my case the changes in the new scripts were not seen by ignition, it was taking the old scripts , perhaps from an inherited previous version!

You may have a different issue, but I’ll layout how it works when it’s working right in case any of this is helpful.

Upgrading a 7.9.8 project resulted in a separate ‘global’ project set as parent project to the main project under Config->System->Projects->ChildProjectName like this:
image
The parent project could be changed to any other project/name, if desired. The upgrade process placed the shared scripts from ChildProjectName into the parent ‘global’ project. They show up greyed in the child project like this:
image
To edit/add to these scripts, we open the ‘global’ project in Designer, make the changes, and then Close & Commit:
image
To see these in the child project, we Save in parent project Designer
image
and then Merge changes in the child project:
image
At this point the scripts in parent project should be visible (greyed) in child project. Note that if you override the script in child project, the name will turn black and script will no longer be inherited from parent project. To cancel the override, delete the script showing in black that you want to go back to inherited and then you should see the inherited script in grey again.

2 Likes

Thanks for your reply. However I don’t see any parent project name for my project that’s giving problems in scripts! When I created a new project and copied the server scripts (gateway events and the project scripts) from the old project in to this, it worked fine! However , when my gateway scripts were working fine in the previous version of Ignition (8.0.), I just downloaded and installed the new version 8.0.1 on top of it and opened the project in the designer, the scripts were not working (actually they were working, but the old version of it, not the new changes I did after installing the new Ignition version).

Perhaps I might have imported an exported project (the same project) from the previous version of Ignition after opening the project in designer. I observed that , the newer changes in scripts were not reflected in the output! It kept showing the results of the older version was showing! I even saved the project after importing an old project and reopening it, but it had same results!

How does importing a project on top of an existing project work especially with gateway scripts in Ignition? The data base remains same for all projects as we know very well. If I have to distribute a project (with tags database and gateway scripts in it), to users, I guess I have to export the project and ask users to create a new and empty project and import this exported project in to it right?

Any way, for the present I am able to develop my scripts with a freshly created project, but its not a nice feeling when you don’t know what going on under the hood!

regards

I am still struggling with the issue. What I observer in version 8 is that, when I start the gateway scripts using a startPubNub memory tag in db (tag change scripts in gateway events script), an init script under the project scripts folder is called. I observe in version 8 that, it not only executes the init function for the currently open project in the designer, but also init function of an old project script with old scripts also gets executed.

What it means is that, the tag change gateway script, actually calls init scripts in two separate projects, one is the newly changed scripts under the project open in designer as well as some other project which has an old copy of project scripts! This is evident in the enclosed log file where some of the debug print statement results are duplicate (marked with <=====)!

Is it possible that two projects could be running in Ignition 8 gateway simultaneously? Is there any thing different in Version 8 that its not happening in previous versions?). The screenshot of the Config> System> Projects page on Ignition home page is also attached, in case it gives any clues.

INFO | jvm 1 | 2019/06/17 23:01:48 | Starting PubNub
INFO | jvm 1 | 2019/06/17 23:01:48 | calling initpubnub
INFO | jvm 1 | 2019/06/17 23:01:48 | initializing pubnub
INFO | jvm 1 | 2019/06/17 23:01:48 | Starting PubNub <====
INFO | jvm 1 | 2019/06/17 23:01:48 | Message to send: {“msg”:“hello112”}
INFO | jvm 1 | 2019/06/17 23:01:48 | iniside initpubnub
INFO | jvm 1 | 2019/06/17 23:01:48 | GETTAGS called
INFO | jvm 1 | 2019/06/17 23:01:48 | {}
INFO | jvm 1 | 2019/06/17 23:01:48 | {} {}
INFO | jvm 1 | 2019/06/17 23:01:48 | GETPROFILES called
INFO | jvm 1 | 2019/06/17 23:01:48 | profiles= [
{“profile”:“SU”,“profileaccess”:“RW”,“profiledes”:“SUPER USER”},
{“profile”:“BU”,“profileaccess”:“RX”,“profiledes”:“BASIC USER”},
{“profile”:“TU”,“profileaccess”:“RX”,“profiledes”:“TEMP USER”}
]
INFO | jvm 1 | 2019/06/17 23:01:48 | GETUSERS called
INFO | jvm 1 | 2019/06/17 23:01:48 | users= [
{“user”:“admin”,“userpassword”:“password”,“userprofile”:“SU”},
{“user”:“guest”,“userpassword”:“guest”,“userprofile”:“BU”},
{“user”:“visitor”,“userpassword”:“visitor”,“userprofile”:“TU”}
]
INFO | jvm 1 | 2019/06/17 23:01:48 | GETTAGS,PROFILES,USERS initialized
INFO | jvm 1 | 2019/06/17 23:01:48 | initializing pubnub <======
INFO | jvm 1 | 2019/06/17 23:01:48 | PNConnected status received True
INFO | jvm 1 | 2019/06/17 23:01:49 | PNConnected status received pn-2b745dc3-606e-481a-8846-e5a7f9349ef0True <======
INFO | jvm 1 | 2019/06/17 23:01:49 | PNMessageResult(message={“msg”:“hello”}, subscribedChannel=command_channel, actualChannel=null, channel=command_channel, subscription=null, timetoken=15607927106265645, userMetadata=null, publisher=pn-7c24a104-194a-4863-bb77-c3245325a384) <======
INFO | jvm 1 | 2019/06/17 23:01:49 | msg recd - channel/msg : command_channel/hello
INFO | jvm 1 | 2019/06/17 23:01:49 | msg recd - channel/msg : command_channel/hello<====
INFO | jvm 1 | 2019/06/17 23:01:49 | PNMessageResult(message={“msg”:“hello112”}, subscribedChannel=command_channel, actualChannel=null, channel=command_channel, subscription=null, timetoken=15607927109020987, userMetadata=null, publisher=pn-2b745dc3-606e-481a-8846-e5a7f9349ef0)
INFO | jvm 1 | 2019/06/17 23:01:49 | msg recd - channel/msg : command_channel/hello112
INFO | jvm 1 | 2019/06/17 23:01:49 | msg recd - channel/msg : command_channel/hello112
INFO | jvm 1 | 2019/06/17 23:06:01 | destroy
INFO | jvm 1 | 2019/06/17 23:06:01 | Stopping PubNub
INFO | jvm 1 | 2019/06/17 23:06:01 | destroy<====
INFO | jvm 1 | 2019/06/17 23:06:01 | Stopping PubNub<====

Sounds like you have problems with your own object lifetimes. An old jython script won’t truly go away until it is no longer referenced anywhere. If you are calling module API methods from jython, and any listener is created pointing at old code, that code will never go away.

1 Like

I think you have hit the nail on the head! My earlier instance of PubNub object created in the previous project using the Jython scripts, is still remaining active! Hence the two debug print statements in the wrapper log file!

But this didn’t happen in previous versions of Ignition 7.9 etc! Anything specifically different in version 8! How to get rid of the previous jython scripts running. I guess I have to specifically delete the previous instance of PubNub object created if it exists! Let me try.

Problem is partially resolved! I deleted some temporary projects that I had created for testing my RMS Project scripts. With this an additional PubNub object that remained in memory is deleted.

However some objects associated with gateway event scripts are still remaining in memory! For example the timer object which is started on rising edge of a memory tag (StartTimer) remains in memory from a previously opened project! How to ensure that such objects are deleted at the beginning?

Which project they are coming from? Is it global project? Who creates global project? I didn’t do it. Is it automatically created? Can I delete the global project as I am not inheriting any project from global project?

This was not happening in previous versions (< version 8)!

Please see the log after I start PunNub, then start timer that writes the dash board json file to EON, then I stop the timer. You can see the Timer Start and Stop are coming from two sources (the suffix1 marked <===, is from new project and withou suffix is from some unknown instance of timer!).

INFO | jvm 1 | 2019/06/21 17:23:25 | calling initpubnub
INFO | jvm 1 | 2019/06/21 17:23:25 | GETTAGS called
INFO | jvm 1 | 2019/06/21 17:23:25 | {}
INFO | jvm 1 | 2019/06/21 17:23:25 | {} {}
INFO | jvm 1 | 2019/06/21 17:23:25 | GETPROFILES called
INFO | jvm 1 | 2019/06/21 17:23:25 | profiles= [
{“profile”:“SU”,“profileaccess”:“RW”,“profiledes”:“SUPER USER”},
{“profile”:“BU”,“profileaccess”:“RX”,“profiledes”:“BASIC USER”},
{“profile”:“TU”,“profileaccess”:“RX”,“profiledes”:“TEMP USER”}
]
INFO | jvm 1 | 2019/06/21 17:23:25 | GETUSERS called
INFO | jvm 1 | 2019/06/21 17:23:25 | users= [
{“user”:“admin”,“userpassword”:“password”,“userprofile”:“SU”},
{“user”:“guest”,“userpassword”:“guest”,“userprofile”:“BU”},
{“user”:“visitor”,“userpassword”:“visitor”,“userprofile”:“TU”}
]
INFO | jvm 1 | 2019/06/21 17:23:25 | initializing pubnub
INFO | jvm 1 | 2019/06/21 17:23:25 | Starting PubNub1
INFO | jvm 1 | 2019/06/21 17:23:25 | PNConnected status received True
INFO | jvm 1 | 2019/06/21 17:23:26 | PNMessageResult(message={“msg”:“hello111”}, subscribedChannel=command_channel, actualChannel=null, channel=command_channel, subscription=null, timetoken=15611180077208368, userMetadata=null, publisher=pn-b6009b06-a960-4eba-82c4-78f2fae43d5d)
INFO | jvm 1 | 2019/06/21 17:23:26 | msg recd - channel/msg : command_channel/hello111
INFO | jvm 1 | 2019/06/21 17:24:09 | setting timer ON
INFO | jvm 1 | 2019/06/21 17:24:09 | setting timer ON1<===
INFO | jvm 1 | 2019/06/21 17:24:36 | setting timer OFF
INFO | jvm 1 | 2019/06/21 17:24:36 | setting timer OFF1<===
INFO | jvm 1 | 2019/06/21 17:25:01 | destroy
INFO | jvm 1 | 2019/06/21 17:25:01 | Stopping PubNub1
INFO | jvm 1 | 2019/06/21 17:25:27 | calling initpubnub
INFO | jvm 1 | 2019/06/21 17:25:27 | GETTAGS called
INFO | jvm 1 | 2019/06/21 17:25:27 | {}
INFO | jvm 1 | 2019/06/21 17:25:27 | {} {}
INFO | jvm 1 | 2019/06/21 17:25:27 | GETPROFILES called
INFO | jvm 1 | 2019/06/21 17:25:27 | profiles= [
{“profile”:“SU”,“profileaccess”:“RW”,“profiledes”:“SUPER USER”},
{“profile”:“BU”,“profileaccess”:“RX”,“profiledes”:“BASIC USER”},
{“profile”:“TU”,“profileaccess”:“RX”,“profiledes”:“TEMP USER”}
]
INFO | jvm 1 | 2019/06/21 17:25:27 | GETUSERS called
INFO | jvm 1 | 2019/06/21 17:25:27 | users= [
{“user”:“admin”,“userpassword”:“password”,“userprofile”:“SU”},
{“user”:“guest”,“userpassword”:“guest”,“userprofile”:“BU”},
{“user”:“visitor”,“userpassword”:“visitor”,“userprofile”:“TU”}
]
INFO | jvm 1 | 2019/06/21 17:25:27 | initializing pubnub
INFO | jvm 1 | 2019/06/21 17:25:27 | Starting PubNub1
INFO | jvm 1 | 2019/06/21 17:25:28 | PNConnected status received True
INFO | jvm 1 | 2019/06/21 17:25:28 | PNMessageResult(message={“msg”:“hello111”}, subscribedChannel=command_channel, actualChannel=null, channel=command_channel, subscription=null, timetoken=15611181297865579, userMetadata=null, publisher=pn-538e7f2c-adad-4e78-b1e0-59946d488e68)
INFO | jvm 1 | 2019/06/21 17:25:28 | msg recd - channel/msg : command_channel/hello111
INFO | jvm 1 | 2019/06/21 17:42:40 | setting timer ON
INFO | jvm 1 | 2019/06/21 17:42:40 | setting timer ON1<===
INFO | jvm 1 | 2019/06/21 17:42:46 | setting timer OFF1<===
INFO | jvm 1 | 2019/06/21 17:42:46 | setting timer OFF

Lets say I execute a project script from a gateway startup or shutdown event script in ParentProjectA. Lets say ChildProcessC is also descendant of ParentProjectA, then will the code in ChildProcessA and ChildProcessC be executed twice if a gateway event script such as startup or shutdown is executed? The shared scripts in previous versions would have executed once, and that's what I want. How to achieve it in inherited scripts (version 8).

Also if I distribute my scripts as parent project , then how can users inherit it into their existing projects? Inheritance will work for new projects I guess.

I think I have identified the problem. I have my PubNub creation and timer start/stop scripts in project scripts which are called from gateway event script on rising edge of memory tags StartPubNub and StartTimer. This is triggering the PubNub object creation and timer initiation scripts execute for multiple times for multiple project in my gateway.! (log file remaining same)

Ideally I should have these scripts as shared scripts in gateway so that they are executed only once on every gateway event like startup/shutdown and StartPubNub StartTimer memory tag rising edge. However in version 8 there is no equivalent of shared scripts, they are to be achieved thru inheritance!

I am thinking about solution but any suggestions are welcome.