I created a UDT that contains 4 tags. One of the tags is configured to start an alarm pipeline when its value reaches zero. Once the pipeline has been activated, I would like to use an Expression block to determine if the rest of the pipeline should be executed. Inside of the expression, I would like to evaluate the Boolean value of the other "sibling" tags in the UDT. The issue I am having is it doesn't seem like I can successfully evaluate the tags. I have script blocks connected to both the True and False outputs of the expression block, but I cannot reach either of them. Both of them log to the gateway once reached. As a test, I have placed a script block before the expression block that is logging to the gateway once the pipeline has been activated, so I know that I am reaching the pipeline. But, I never reach the script connected to the True and False outputs. In the expression, I have unsuccessfully tried using the following:
if({path_to_the_sibling_Tag} == True, 1, 0)
if({source:/../SiblingTagName} == True, 1, 0)
if({source:/SiblingTagName} == True, 1, 0)
I have also tried creating "Associated Data" on the tag that has the alarm configured and then tried to reference the value in the expression block as follows:
if ({eventData:SiblingTagName} == True, 1, 0)
But that does not work either. Can someone please tell me what I am doing wrong?
Alarm data bindings evaluate (only) when the alarm triggers. That snapshots the associated data. Which then is available in the pipeline. You can't pick up later changes.
Thank you for responding to my question. I am actually counting on the evaluation happening when the alarm is triggered. If I am understanding you correctly, when the alarm is triggered on the UDT instance, the alarm pipeline expression block will look at the sibling tag in the instance that trigged the alarm and as long as the associated data key name matches the name being used in the alarm pipeline expression block, the bound value for the sibling tag in the UDT instance will be evaluated. This is only if the bound value has been configured as
[.]sibling_tag_name
If I am correct in my understanding, I would have expected to reach either the True or False script blocks that I set up. I am not reaching either of those after the alarm is triggered. I still feel like something is not right. Looking at what I have shown, would you say that I am doing things correctly?
Do also simplify your if expressions--any time you have if({something}, 1, 0) and both {something} and the result are to be boolean, just put {something}. No if() at all.
I have simplified my expression block. I went from using an if statement
if ({eventData:SiblingTagName} == True, 1, 0)
to
{eventData:testValue}
where "testValue" is the Assiociated Data key.
This key is located in UDT tag Alarm and is bound using
[.]the_sibling_tag_name
I created an instance of the UDT to test with and set the value of the tag that has the alarm configured to zero. This triggers the alarm. In the instance I set the Boolean value of the sibling tag equal to True. This should have allowed the script block after the expression block to execute. But it doesn't. The expression block returned False. It will return False regardless if the Boolean value is True or False. Is there any other information that I can provide that would help in getting the result that I am looking for?