I’m trying understand how the alarmEvent.get() function works inside a filterAlarm extension.
I have a ‘line’ UDT comprised of several ‘station’ UDTs. In the station UDT I program several alarms. In order to determine which line an alarm belongs to, in each alarm I add an Associated Data property called ‘linenum’ that is configured with a UDT Parameter (this is an integer parameter passed from the parent line UDT.)
My question is: what type is being returned by alarmEvent(‘linenum’) in the code below? The if clause fails unless I cast it to string; I cannot seem to get int to work (e.g. == 3).
I have this code in an Alarm Status table (in the filterAlarm script):
def filterAlarm(self, alarmEvent):
linenum = alarmEvent.get('linenum')
if str(linenum) == "3":