Multiple alarms for a single I/O tag requires a separate module per alarm, so you can support unique names as required by the VTS alarm system. To arrange this in your application's code, follow the guidelines below.
Run multiple alarm modules (i.e. in the I/O tag's main state).
AlarmObj[0] = AlarmModule0();
AlarmObj[0] = AlarmModule1();
Within each of these alarm modules, declare the variables required by the Alarm Manager (i.e. Name, Area, Message, Type, and Priority), and build the unique AlarmName. An example is displayed below.
<
{======================== AlarmModule0 =======================}
{ A sample Alarm }
{=============================================================}
AlarmModule0
[
Name;
Area;
Message;
Type;
Priority;
]
Init [
If 1 Main;
[
Return(Self());
{ Build unique based on Tag Name }
Name = Concat(Root\Name, \AlarmSeperatorString, 0);
...etc
These alarms will now operate; however, to get the Acknowledge working, you need to declare a further module/subroutine within the tag called GetAlarmObjVal. An example is displayed below.
<
{========================= GetAlarmObjVal =========================}
{ Subroutine to resolve Alarm module objects for the AlarmName }
{ format chosen is <tagname ALarmSeperatorString> }
{==================================================================}
GetAlarmObjVal
(
AlarmIndex { VTS extracts the portion after the AlarmSeperatorAlarm index };
)
GetAlarmObjValOnly [
Return(AlarmObjects[AlarmIndex]);
]
{ End of GetAlarmObjVal }
>