Calling Alarm Events in the Program

The Event monitoring type can also be selected for defining an alarm in the alarm group. In contrast to the other monitoring types, which trigger the alarm depending on a condition, you can trigger the alarm with the Event type via a function block call.

Defining the event alarm in the alarm group

  1. Create an alarm group.

  2. Define an alarm of the observation type Event in the alarm group.

  3. In the column Class, select an alarm class with the acknowledgment method ACK or create a new alarm class.

Program call to trigger the event alarm

  1. Set the cursor at the program position at which the function-block call is to take place.

  2. Use the RaiseEvent function from the AlarmManager library:

    Enter "AlarmManager" followed by a period.

    A window opens containing a list of all insertable elements ("List components" function).

    _cds_img_autocomplete_alarms.png
  3. Select AlarmGlobals and enter a period.

  4. In the same way, insert the elements g_AlarmHandler and RaiseEvent.

    You get the following line: Alarmmanager.AlarmGlobals.g_AlarmHandler.RaiseEvent.

  5. Now define the transfer variables AlarmGroup_ID and Alarm_ID. To do this, enter an opening parenthesis.

    A tooltip appears, showing information about the transfer variables

  6. Press F2

    The Input Assistant opens

  7. On the Categories tab (3), select the category Variables (4).

    _cds_img_input_assistant_alarms.png
  8. Select the desired group ID variable (1).

    The variable is applied into the program line.

  9. Enter a comma and insert the desired alarm ID variable (2) in the same way as in Step 7. Input a closing parenthesis and a semicolon.

    You get the following program line:

    Alarmmanager.AlarmGlobals.g_AlarmHandler.RaiseEvent(Alm_AlarmConfiguration_Alarmgroup_IDs.ID_AlarmGroup1, Alm_AlarmGroup1_Alarm_IDs.ID_0);