Setting up alarm pipeline and connecting to tag

Here is what I have done:

-I created an alarm pipeline with one function block (script), the function block writes to a memory tag giving a value of 1.
-I assigned the alarm pipeline to a tag in the PLC so that when the value of the tag is 1, the alarm is triggered.

The problem is that the memory tag is not being written to when the alarm condition is met. The alarm is being triggered because an alarm alert comes up in the client. If I run the script in the function block in the script console, it sets the memory tag to 1, so the problem is not with the script.

What is wrong? I’m stuck so any ideas would be great!

Thanks

The script console is a client-scope environment, while alarm pipelines are gateway-scope. There are many differences. You probably need to wrap your script in a “try: … except:” block and send the exception to the gateway log. Get an appropriate logger in any scope with system.util.getLogger().

It may just be that you are not using the full tag path like you need to do within the gateway-scope when referring to tags. When you’re inside a project if you don’t specify a provider in your tag path that you want to use the project default. When you reference a tag from a gateway-scope and don’t include a provider it usually doesn’t know where to find the tag and so it just fails. Try referencing your tag like [providerName]path\to\tag

Also it’s worth noting that there are Tag Events on tags that fire on the following conditions: Alarm Active, Alarm Cleared, Alarm Acknowledged. So if you don’t actually need to set the value in the pipeline itself then you may want to consider taking a look at adding a script to the Tag Event that best fits your needs.