Here is the result:
Thanks guys, appreciate it.
Code:
// Loop for checking active alarm and transfer alarm number
#AlarmActive := FALSE;
FOR #I := 0 TO 199 DO
IF "SCADA_LiveData".Alarm_Status[#I] = TRUE THEN
"SCADA_ExtendedData".ErrorCode := "SCADA_Ext".AlarmNumber[#I];
#AlarmActive := TRUE;
EXIT;
END_IF;
END_FOR;
IF NOT #AlarmActive THEN
"SCADA_ExtendedData".ErrorCode := 0;
END_IF;
Thanks guys, appreciate it.