Feeling the need to clarify this thread a bit for the sake of anyone else who finds it.
Dave's first comment would apply if you were configuring an I/O tag, where the expression would have been created as a tag parameter expression. That has the optimize checkbox, and I strongly encourage anyone who is thinking of deselecting that option to read the relevant help topics first.
In this example, we're working with an Analog Status tag, where there's a Constant / Expression / Tag selection below the Enable / Disable parameter.
The expression is nearly fineyou'd want to wrap the tag name in a PickValid so that you don't get errors on startup or communications loss. The expression would then become:
PickValid([SDC2_RUN], 0) == 0
Because Invalid isn't True and Invalid isn't False.
Now, you're only going to turn Disabled off when the tag has a valid value of 1
And going back to the original, original question... Your expression was imperfect, but it would work and the alarm is disabled when SDC2_RUN is running. But that won't erase it from the History list. What you'd see there is the alarm activating, then another line for the alarm being disabled.
Feeling the need to clarify this thread a bit for the sake of anyone else who finds it.
Dave's first comment would apply if you were configuring an I/O tag, where the expression would have been created as a tag parameter expression. That has the optimize checkbox, and I strongly encourage anyone who is thinking of deselecting that option to read the relevant help topics first.
In this example, we're working with an Analog Status tag, where there's a Constant / Expression / Tag selection below the Enable / Disable parameter.
The expression is nearly fineyou'd want to wrap the tag name in a PickValid so that you don't get errors on startup or communications loss. The expression would then become:
PickValid([SDC2_RUN], 0) == 0
Because Invalid isn't True and Invalid isn't False.
Now, you're only going to turn Disabled off when the tag has a valid value of 1
And going back to the original, original question... Your expression was imperfect, but it would work and the alarm is disabled when SDC2_RUN is running. But that won't erase it from the History list. What you'd see there is the alarm activating, then another line for the alarm being disabled.