Using runScript from alarm pipeline expression block

Hi all,

I’m trying to call an app.* script from an expression block.

In other parts of the client I can simply do:

runScript("app.utils.doSomething()")

But when I put that in an expression block in my alarm pipeline and then try to test it, the following gets put in the logs: NameError: name ‘app’ is not defined

Is there a way to call the app.* scripts from inside an alarm pipeline’s expression block?

Regards,
Charles

From what I can tell it is a scoping issue - the pipeline is global so it doesn’t know about the app.* modules.

If that’s the case - does anyone know if it is possible to trigger something when an alarm happens? My goal was to have an expression block that did a bit of SQL work whenever there was an alarm so all our other systems would be aware. Without being able to call a script from the pipeline I’m not sure how this could be done, other than a timer constantly checking if any new alarms have come in, which is a pretty kludgy solution.

Anyone else having fun trying to integrate the Ignition alarms with other systems?

Charles

You’re right - it’s a scoping issue.

Two things are coming that will help you out here:

  1. In 7.7 there’s going to be globally scoped scripting area, which should work in runScript calls from the pipelines.
  2. We’ve been meaning, all along, to add a new kind of pipeline block that’s dedicated to executing a script. This would be the more elegant solution you’re looking for. I don’t know the timeline on this, hopefully soon after the release.

Good to hear that some of that stuff is on the way down the pipe - now I don’t feel so bad about using a kludgy solution.

In the meantime the system.* scripts work fine in the expression blocks, so I’ve worked around with those to call my scripts.

Thanks,
Charles