Alarm Horn Not Sounding Upon Alarm Initialization, Help Required

Currently my alarm pipeline is configured to pick up an alarm and call the function below regardless of priority:

system.tag.write("_Misc/Alarm_CR_HORN", 1)

this is as simple as I can make the system, but somehow the horn ALWAYS fails to activate when an alarm is picked up. The other scripts for activation of the alarm light, activation of the alarm states themselves, etc. run every time, but the only way I can produce a response from the horn is by manually writing the Horn boolean from 0 to 1 within Designer. Every time an alarm state would make this change via the pipeline, no change occurs.

Some notes: I implemented the pipeline at the beginning of this week, and all features including horn sound were operational. To my knowledge no changes have been made to the alarming, but I have not had response from the horn since that first day. Additionally, the pipeline is certainly enabled, the script is called by any and all priorities, and I even attempted to remove all dropout conditions with no luck. As far as I can tell: I have the simplest alarm pipeline I can have; every alarm I trigger moves through it, activating warning lights and appearing in the Alarm Journal; the horn hardware is functional and can be triggered manually.

I'm at my wit's end, and have checked every alarmed tag/alarm/gateway script in the system for any discrepancies to no avail. I am rather new to Ignition, so any suggestions would be greatly appreciated. This is one of those issues that is so tantalizingly simple yet frustrating, and I'm sure there's a quick fix that I am missing.

Thank you in advance!

Capture the return value to see the write status.

I ran the script in the script console; I received a return value of '2' and the script did cause horn to sound.

I also set up a dummy integer tag and alarm, and altered the pipeline to test them: I configured the pipeline to write to the dummy integer AND sound the horn upon alarm initialization, and ran into the same issue. No change occurred in the integer or horn until I entered the scripts to the console.

The issue must be with the pipeline executing the script? If this is the case though I'm unsure what piece might be missing.

Pipelines are executed on the gateway, and as a whoopsie on our part post migration in 8.x, don't know about your project's default tag provider.

Try qualifying your write with the name of the tag provider in square brackets, e.g:

system.tag.writeBlocking("[default]_Misc/Alarm_CR_HORN", 1)

I'm assuming your default tag provider is the default one autocreated for you named default. It's possible that your system is different.

I've edited both scripts from

system.tag.write("_Misc/Alarm_CR_HORN",1)
system.tag.write("_Misc/alarmtestdummy", 123)

to

system.tag.writeBlocking("[default]_Misc/Alarm_CR_HORN",1)
system.tag.writeBlocking("[default]_Misc/alarmtestdummy", 123)

with no effect

NOTE: this is the tag path directly copied from the tag browser: [default]_Misc/Alarm_CR_HORN

Log each value from the returned list of quality codes you get from writeBlocking.

Tag quality for the Horn and the Dummy are both 'Good' and both return '2' in the script console.

I am unsure if this is what you meant.

Not the script console. You need to be testing (and logging) from the actual place you're experiencing issues, the pipeline.

3 Likes

When trying to actuate the horn via normal pipeline, the logs return this message:

Error writing tags Error writing to tag '_Misc/Alarm_CR_HORN': Error_Configuration("Tag provider '' not found")

I set up a button on a vision screen to set the tag value to 1 on action, and the button auto-generated this script instead of mine:

value = 1
system.tag.writeBlocking(['[default]_Misc/Alarm_CR_HORN'], [value])

I've placed this script in the alarm pipeline as well, with no changes. The script works perfectly when run from the button, and does not work when an alarm is in the pipeline

The logs return the following when an alarm hits the pipeline:

[Pipeline: project:BazeHMI:/pipeline:Alarms] Error executing scriptable block.

an expansion of that log yields:

com.inductiveautomation.ignition.common.script.JythonExecException: Traceback (most recent call last): File "", line 2, in handleAlarm at com.inductiveautomation.ignition.common.TypeUtilities.coerce(TypeUtilities.java:1417) at com.inductiveautomation.ignition.common.script.builtin.PyArgumentMap.coerce(PyArgumentMap.java:125) at com.inductiveautomation.ignition.common.script.builtin.PyArgumentMap.interpretPyArgs(PyArgumentMap.java:81) at com.inductiveautomation.ignition.common.script.builtin.PyArgumentMap.interpretPyArgs(PyArgumentMap.java:39) at com.inductiveautomation.ignition.common.script.builtin.AbstractTagUtilities.writeBlocking(AbstractTagUtilities.java:388) at jdk.internal.reflect.GeneratedMethodAccessor54.invoke(Unknown Source) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.base/java.lang.reflect.Method.invoke(Unknown Source) java.lang.ClassCastException: java.lang.ClassCastException: Cannot coerce value '[default]_Misc/alarmtestdummy' into type: interface java.util.List

at org.python.core.Py.JavaError(Py.java:552)

at org.python.core.Py.JavaError(Py.java:543)

at org.python.core.PyReflectedFunction.call(PyReflectedFunction.java:190)

at com.inductiveautomation.ignition.common.script.ScriptManager$ReflectedInstanceFunction.call(ScriptManager.java:524)

at org.python.core.PyObject.call(PyObject.java:497)

at org.python.core.PyObject.call(PyObject.java:501)

at org.python.pycode._pyx32.handleAlarm$1(:2)

at org.python.pycode._pyx32.call_function()

at org.python.core.PyTableCode.call(PyTableCode.java:171)

at org.python.core.PyBaseCode.call(PyBaseCode.java:308)

at org.python.core.PyFunction.function___call__(PyFunction.java:471)

at org.python.core.PyFunction.call(PyFunction.java:466)

at org.python.core.PyFunction.call(PyFunction.java:461)

at com.inductiveautomation.ignition.common.script.ScriptManager.runFunction(ScriptManager.java:822)

at com.inductiveautomation.ignition.common.script.ScriptManager.runFunction(ScriptManager.java:806)

at com.inductiveautomation.ignition.gateway.project.ProjectScriptLifecycle$TrackingProjectScriptManager.runFunction(ProjectScriptLifecycle.java:687)

at com.inductiveautomation.ignition.common.script.ScriptManager$ScriptFunctionImpl.invoke(ScriptManager.java:965)

at com.inductiveautomation.ignition.gateway.project.ProjectScriptLifecycle$AutoRecompilingScriptFunction.invoke(ProjectScriptLifecycle.java:752)

at com.inductiveautomation.ignition.alarming.pipelines.blocks.ScriptableBlock$EvaluationContext.onEvaluate(ScriptableBlock.java:97)

at com.inductiveautomation.ignition.alarming.pipelines.blocks.AbstractEvaluationContext.evaluate(AbstractEvaluationContext.java:78)

at com.inductiveautomation.ignition.alarming.pipelines.SingleThreadAlarmPipeline$QueueEvaluator.run(SingleThreadAlarmPipeline.java:187)

at java.base/java.lang.Thread.run(Unknown Source)

Caused by: org.python.core.PyException: Traceback (most recent call last): File "", line 2, in handleAlarm at com.inductiveautomation.ignition.common.TypeUtilities.coerce(TypeUtilities.java:1417) at com.inductiveautomation.ignition.common.script.builtin.PyArgumentMap.coerce(PyArgumentMap.java:125) at com.inductiveautomation.ignition.common.script.builtin.PyArgumentMap.interpretPyArgs(PyArgumentMap.java:81) at com.inductiveautomation.ignition.common.script.builtin.PyArgumentMap.interpretPyArgs(PyArgumentMap.java:39) at com.inductiveautomation.ignition.common.script.builtin.AbstractTagUtilities.writeBlocking(AbstractTagUtilities.java:388) at jdk.internal.reflect.GeneratedMethodAccessor54.invoke(Unknown Source) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.base/java.lang.reflect.Method.invoke(Unknown Source) java.lang.ClassCastException: java.lang.ClassCastException: Cannot coerce value '[default]_Misc/alarmtestdummy' into type: interface java.util.List

... 22 common frames omitted

Caused by: java.lang.ClassCastException: Cannot coerce value '[default]_Misc/alarmtestdummy' into type: interface java.util.List

at com.inductiveautomation.ignition.common.TypeUtilities.coerce(TypeUtilities.java:1417)

at com.inductiveautomation.ignition.common.script.builtin.PyArgumentMap.coerce(PyArgumentMap.java:125)

at com.inductiveautomation.ignition.common.script.builtin.PyArgumentMap.interpretPyArgs(PyArgumentMap.java:81)

at com.inductiveautomation.ignition.common.script.builtin.PyArgumentMap.interpretPyArgs(PyArgumentMap.java:39)

at com.inductiveautomation.ignition.common.script.builtin.AbstractTagUtilities.writeBlocking(AbstractTagUtilities.java:388)

at jdk.internal.reflect.GeneratedMethodAccessor54.invoke(Unknown Source)

at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.base/java.lang.reflect.Method.invoke(Unknown Source)

at org.python.core.PyReflectedFunction.call(PyReflectedFunction.java:188)

... 19 common frames omitted

I suspect stale code somewhere. Consider restarting your tag provider. Or, perhaps, the whole gateway.

1 Like

yes sir, there was stale code elsewhere and a couple Save All's seemed to have fixed the issue. Thank you all so much for the help!

system.tag.write() has been depricated in 8.0 hasn't it?

Write blocking also takes a list not a single value.

try:

system.tag.writeBlocking(["[default]_Misc/Alarm_CR_HORN"],[1])
system.tag.writeBlocking(["[default]_Misc/alarmtestdummy"], [123])

This is true, but to save training some time explaining that each time there's a hidden, deliberately-not-documented overload where a single path and value will work. It's still encouraged to use the list syntax each time, especially if you're writing to multiple tags in a row.

2 Likes