Hi, everybody!
Please, help me to write an expression, which compares values of two or greater number of BOOL tags and then put it into Alarm Server.
I have tried to write some expressions myself, but I have not saw any changes in Alarm Viewer when tags were modified.
Exampes:
1. I want to see event (Tag1.Value & Tag2.Value)
2. I want to see event (Tag1.Value & (Tag2.Value or Tag3.Value))
Expressions in Alarm Server
-
- Posts: 824
- Joined: Tue Mar 13, 2012 9:53 am
Re: Expressions in Alarm Server
How are you referencing the tags? The below code will & together the AlarmTag1 and AlarmTag2 tag values.
The 'condition' tests what your expression evaluates to against the 'trigger value'.
Thanks,
Mark
Can you post an example of the expression code you are using to trigger the alarm? Also, take note that in the Alarm Server window you also have a 'Condition' you need to set and a 'Trigger Value'.Globals.Tags.AlarmTag1.Value & Globals.Tags.AlarmTag2.Value
The 'condition' tests what your expression evaluates to against the 'trigger value'.
Thanks,
Mark
Best Regards,
Mark Monroe
Beijer Electronics, Inc. | Applications Engineer
Mark Monroe
Beijer Electronics, Inc. | Applications Engineer
Re: Expressions in Alarm Server
Sorry for my shorted expressions! I had wrote the idea of my expressions.
Now I shall try to show in the image my attempt to write expression, which don't work.
I see in your picture that you use a tag called Trigger_alarm. What is it?
Now I shall try to show in the image my attempt to write expression, which don't work.
I see in your picture that you use a tag called Trigger_alarm. What is it?
- Attachments
-
- expression.PNG (151.23 KiB) Viewed 10094 times
-
- Posts: 824
- Joined: Tue Mar 13, 2012 9:53 am
Re: Expressions in Alarm Server
In the 'Alarm Server' tab you need to have a tag in the 'Tag' column of the alarm. And you are doing a bit wise 'and' when you use '&' not a logical 'and'. If you look at the operators in the Expressions dialog box it will give you a list of them.
The 'Tag' column is what you want to alarm on. When it changes the expression gets evaluated. The expression column is normally used to modify the tag in the 'Tag' column. What comes out of the Expression column is what gets compared to the Trigger Value.
If you do not use the tag you listed in the 'Tag' column in your expression, then changing its value will only trigger the expression to be evaluated.
Because you want to 'and' a bunch of tag values together in an expression, the 'Tag' column would end up simply being a way for you to trigger the expression to be evaluated.
The 'Tag' column is what you want to alarm on. When it changes the expression gets evaluated. The expression column is normally used to modify the tag in the 'Tag' column. What comes out of the Expression column is what gets compared to the Trigger Value.
If you do not use the tag you listed in the 'Tag' column in your expression, then changing its value will only trigger the expression to be evaluated.
Because you want to 'and' a bunch of tag values together in an expression, the 'Tag' column would end up simply being a way for you to trigger the expression to be evaluated.
Best Regards,
Mark Monroe
Beijer Electronics, Inc. | Applications Engineer
Mark Monroe
Beijer Electronics, Inc. | Applications Engineer