How to run event scripts

OK, i know that this question sounds ridiculous. But I’m really confused. I’m testing the ignition 8 Beta and its Perspective module. So I made some simple window, simple label and simple button. I added one custom property to button called ‘val’.
I made binding Label.props.text and Button.custom.val. It’s working (yay!)
And now I made the script in button. Like this: Configure Events… -> onClick -> add -> Script. My script is also very simple. It’s:
self.custom.val = 10.
And its not working. I tried to make "print ‘10’ " but the console output remains empty.
What makes me more confusedI made the script in the button “system.perspective.setTheme(‘dark’)”. And it’s also not working, but the direct onClick -> add -> Theme, setting ‘dark’ is fine. I feel like the Ignition is ignoring my scripts without even a single error message. So the question is: am I doing something wrong or is this some kind of strange error?

Look in the gateway logs. Perspective scripts run in gateway scope.

the script:
print “test!”
and i have this in log:
Unable to run function “runAction(self, event)”, code could not be compiled.

“print” output won’t show up in the gateway web interface logs… only in the actual wrapper log.

Cold you post a screenshot of the entire Script Editor window where you’re writing the script, along with the exact message from the gateway logs?


And errors:

Did you type some spaces instead of use a tab?

1 Like

It’s tab, not spaces… Btw, I didn’t type anything, this is default place where the “# Write your script here” is. So You mean that it should work, but it’s not for some reason?

It should work then :confused:

If you create a new script and leave that “# Write your script here” text in and just start below it does it work?

Unfortunately, it does not help

Even when I run empty script I have error in gateway logs :confused:

Can you tell us what version of Windows you’re using, any locale information, what version of the beta this is, and maybe upload a gateway backup or just a zip file containing the data/projects directory?

Or also try this trick to give us some additional insight: Select the View node in the Project Browser (not the root node, but the node you actually supplied a name to, like “MyView”). Hold down Shift and then right-click the View node, and select Copy JSON. Paste your clipboard into your preferred text editor, save this content as “<view_name>.json”, and post that file for us.

Sure, So it goes like that:
OS for Server: Windows 7 Professional, Version 6.1, Compilation 7601 Service Pack 1
OS Designer: Windows 10, Version 1803, Compilation 17134.648
Ignition Version: 8.0.0-beta0 (b2019030802)
I noticed something weird: the processor in server is Intel Xeon E3-1220 v2, but in gateway status I see OS as “Windows 7 | amd64”

This is link to Gateway backup, and window saved as JSON file:!3kUwAabJ!bsHjSfYLSPwamaGd4ZOdgQ. I will keep this valid for at least a month or two

And one more thing is that we installed Ignition 8.0, by overwriting existing Ignition 7.8.5 gateway

Can I provide You any other informations? :wink:

OK, last update fixed the problem :slight_smile:

1 Like