PDA

View Full Version : get Alarmclass name at RT start



cisnetandazo
17th October 2014, 11:00
Hello,
is there a way to get the name (and not the ID) of the alarmclass designated for a variable when it reaches a Limit at the RT?

I have to alarm classes in my Project:
0 - Info
1 - Error

myVar has at Limit 1 the Alarm 1 - Error.

With this I get the ID at starting the RT:
this.Project.Variables().Item("myVar").Limits().Item(1).AlarmClass

So I get a 1 and I would like to get the name (Error).

Is there a way to do this?

Thanks.

Cis

christian.bauer
20th October 2014, 07:49
Hi cisnetandazo,

yes, it is possible.
You can get the name of an AlarmClass in the following way:


this.Variables().Item("myVar").get_DynProperties("Limits[1].ClassName")



BR
Christian

cisnetandazo
27th October 2014, 07:52
Hi Christian,
that is exactly what I needed. Thanks a lot.
Cis