Memory boolean tag alarm enabled

Hi, new to Ignition and I'm probably missing something, but I'm trying to access the enabled flag on an alarm set on a boolean memory tag. What am I doing wrong? Here comes a simple test variable

{
"valueSource": "memory",
"dataType": "Boolean",
"alarms": [
{
"setpointA": 1.0,
"name": "Alarm",
"label": "t",
"displayPath": "t"
}
],
"name": "ttt",
"value": false,
"tagType": "AtomicTag"
}
seems there are none??

it works on my opc tags. {
"valueSource": "opc",
"opcItemPath": "nsu\u003dCODESYSSPV3/3S/IecVarAccess;s\u003d|var|LAH_SRV_KNAR.Application.HMI.M1_L_D",
"Invert": "0",
"alarms": [
{
"notes": "Knäred RV M1 Driftlarm",
"timeOnDelaySeconds": 5.0,
"priority": "High",
"enabled": true,
"name": "M1_L_D",
}
],
"tooltip": "Driftlarm",
"tagType": "AtomicTag",
"historyProvider": "MSSQL",
"dataType": "Boolean",
"name": "M1_L_D",
"historyEnabled": true,
"opcServer": "LAH_SRV_KNAR_PLC1"
}

How are you trying to access the attribute?
Please post formatted code, it makes life so much easier.

Thanks!


try:
    tagValue = system.tag.readBlocking([tagPath])[0]
    result["current_value"] = tagValue.value
    result["tag_quality"] = str(tagValue.quality)
    system.util.getLogger("MessageHandler").info("Tag value: {}, Quality: {}".format(tagValue.value, tagValue.quality))
except Exception as e:
    result["tag_read_error"] = str(e)

# Debug alarm config
if "alarms" in result:
    system.util.getLogger("MessageHandler").info("Alarm config: {}".format(result["alarms"]))
    
    if len(result["alarms"]) > 0:
        alarm = result["alarms"][0]
        all_keys = list(alarm.keys())
        system.util.getLogger("MessageHandler").info("All alarm keys: {}".format(all_keys))
        
        # Check specifically for enabled
        has_enabled = "enabled" in alarm
        system.util.getLogger("MessageHandler").info("Enabled exists: {}".format(has_enabled))
        if has_enabled:
            system.util.getLogger("MessageHandler").info("Enabled value: {}".format(alarm["enabled"]))
        else:
            # Check for other possible variants
            possible_enabled_keys = [k for k in all_keys if 'enable' in k.lower()]
            system.util.getLogger("MessageHandler").info("Possible enabled keys: {}".format(possible_enabled_keys))

If I print the system.tag.readBlocking() response object as json I get:
{"value":false,"quality":{"code":192},"timestamp":"Jun 25, 2025, 9:22:47 AM"}

This doesn't contain alarm information.
Perhaps system.tag.getConfiguration | Ignition User Manual could get you the information you require?

Ok, seems like I found the error. When I created the tag, enabled was true in the GUI but wasn't stored on the tag. If I changed the status on it and saved, then it was stored for the tag and could be accessed."

So it sounds like there was a GUI issue where the enabled flag wasn't actually being persisted to the tag configuration until you explicitly changed and saved it.

Not a GUI issue. Default values are deliberately not persisted as a storage optimization - but are stored once you change them (and evidently not cleaned up).

So in my case the logic in my script should be:

if (alarms && !enabled) {
    enabled = true;
}
something like that. 
Thanks for the answer, it explains the matter.