Need to enable users to modify alarm dead band time for test

I have 61 pieces of similar equipment - Mold Temperature Controllers. If they are not within normal parameters an ALARM is created. The normal alarm deadband is 300 sec. When maintenance techs repair or replace an MTC they are required to test the alarm functions before restoring it to production. Testing of all possible fault conditions at 300 sec delay would take hours. They need to temporarily modify the alarm deadband to 2 sec. I started to create a screen to enable them to do this, but alarm deadband does not seem to modifiable from scripted functions.

Any ideas on how to implement this?

Thanks Ken P.

[attachment=0]Alarm Deadband.JPG[/attachment]

Could I do this from an SQL write? I would need to know how the tags are stored in SQL?

Thanks Ken P.

look at the ialabs scripting module, you should be able to use the edittag function to take care of this.

Yea, using the IA Scripting Module will do it. Assuming you are using Ignition 7.5.xxx, here’s the code:

system.tag.editTag(tagPath="MTC_ZONE_ALARM", alarmList="MTC ZONE ALARM;High;1.0;1.0;0;;;2.0;SEC$")

…and to change it back:

system.tag.editTag(tagPath="MTC_ZONE_ALARM", alarmList="MTC ZONE ALARM;High;1.0;1.0;0;;;300.0;SEC$")

I upgraded to Ignition 7.6.4 and installed the IA Labs Scripting Module. Yes this may be very usefull to more fully expose attributes to automated configuration.

After half a day of hacking around I have been able to get some new script functions to work such as using system.tag.editTag to modify “alarmConfig” but I still cannot modify “alarmList”. I have tried dozens of permutations. Is there some syntax problem or hidden dependency that I am not aware of. I realize these are relatively new functions, but more comprehensive documentation would save a lot of unproductive experimentation.

I have tested in both "Component Scripting "and “Interactive Script Tester”.

Can scripting be used in expressions?

#system.tag.editTag(“TEST_ANALOG_TAG”,alarmConfig={“Alarm”:[[“setpointA”, “Value”, 12.34]]}) THIS WORKS
system.tag.editTag(“TEST_ANALOG_TAG”,alarmList=“Alarm;High;0.0;15.0;2;;;19.87;SEC$”) NO SUCCESS NO ERROR MESSAGE

I want to programatically modify the tag alarm deadband “Active delay (seconds)” value which is “alarmList” fields 8 and 9 (19.87;SEC).

Thanks Ken P.

I’m not very familiar with 7.6.x, but you should be able to use this code to figure out the different attributes associated with your alarm:

tagDefs = system.tag.getAlarmStates("TagAlarm")
for tagDef in tagDefs:
    print tagDef.alarm
    for prop in tagDef.getAlarmProperties():
        print prop.property, prop.type, prop.value

…and then use this code to change the deadband value:

system.tag.editTag(parentPath="", name="TagAlarm", alarmConfig={"MyAlarm":[["timeDeadband", "Value", 2.0], ["timeDeadbandUnits", "Value", "SEC"]]})

If you run the top code and don’t see “timeDeadband”, then use whatever logically makes sense.

You can figure this out through some of the forum posts (thanks, tomt) and the online help for the IA Scripting Labs.