Expressions in Alarm Server

Discussion of application development using iX Developer, including but not limited to getting started, using the functions tab, properties, objects and installation.
Post Reply
nongluck
Posts: 2
Joined: Sun Apr 01, 2012 12:24 am

Expressions in Alarm Server

Post by nongluck »

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))

mark.monroe
Posts: 824
Joined: Tue Mar 13, 2012 9:53 am

Re: Expressions in Alarm Server

Post by mark.monroe »

How are you referencing the tags? The below code will & together the AlarmTag1 and AlarmTag2 tag values.
Globals.Tags.AlarmTag1.Value & Globals.Tags.AlarmTag2.Value
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'.

The 'condition' tests what your expression evaluates to against the 'trigger value'.
trigger.png
trigger.png (136.09 KiB) Viewed 8768 times
Thanks,
Mark
Best Regards,
Mark Monroe

Beijer Electronics, Inc. | Applications Engineer

nongluck
Posts: 2
Joined: Sun Apr 01, 2012 12:24 am

Re: Expressions in Alarm Server

Post by nongluck »

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?
Attachments
expression.PNG
expression.PNG (151.23 KiB) Viewed 8764 times

mark.monroe
Posts: 824
Joined: Tue Mar 13, 2012 9:53 am

Re: Expressions in Alarm Server

Post by mark.monroe »

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.
alarm.png
alarm.png (124.48 KiB) Viewed 8763 times
Best Regards,
Mark Monroe

Beijer Electronics, Inc. | Applications Engineer

Post Reply