Create alarms

To be able to create alarms, you need a variable from the PLC that is to trigger the alarm in the visualisation. Instead of a real process variable, you will create an internal variable in the following instructions, i.e. a variable that is defined in the Variables system module but has no counterpart in a PLC. You can manipulate the variable value using input controls in the application and thus trigger alarms.

  • To create an alarm:

  1. Create a new internal variable in your project.

    1. Expand the project explorer node VariablesWChannels.

    2. The table editor is opened in the workspace.

    3. Right-click on the table editor and select New in the context menu that opens.

    4. Double-click on the Internal node it contains.

    5. Under Alias, enter the name "AlarmSource" for the new variable.

    A new internal variable with the data type VT_I2 (value range: -32768 - +32767) was created. Some of the 16 available bits are used as triggering bits in step E.

  2. Create a new alarm group.

    In (Undefined variable: docInfo_DE.Produktname), each alarm must belong to an alarm group.

    1. Expand the Alarms node.

    2. Select the Alarm groups node it contains.

    3. Right-click and select New from the context menu.

    A new alarm group with the name "Alarm group1" has been created and the table editor opens. You can now create the individual alarms in the group.

  3. Create eight alarms in the alarm group.

    1. Click in the upper area of the table editor. Alarm definitions are created here. The lower area is responsible for alarm groups within the current alarm group (subgroups).

    2. Press F8 eight times in succession.

    Eight new alarm definitions have been created and appear as rows in the table editor.

  4. Create the triggering variable (event variable) for each alarm.

    1. In the first row, click on the cell in the Event variable column.

      The button E l l i p s e appears in the cell.

    2. Click on the button E l l i p s e.

      The Select variabledialogue appears.

    3. Expand the Internal node in the dialogue.

    4. Select the AlarmSource variable.

    5. Confirm with OK.

      The AlarmSource variable appears in the "Event variable" column of the first alarm definition.

    6. Specify the same event variable in the other seven alarm definitions.

      Use the Fill table editor function to apply a parameter value to all selected definitions:

      • Select the cell whose parameter value you want to use for other definitions.

      • Expand the selection to the area of the column for which you want to apply the parameter value (using the mouse or a keyboard command).

      • Right-click and select Fill in the context menu or press Ctrl+U.

    In each of the eight alarm definitions, the AlarmSource variable is now specified as the alarm-triggering variable.

  5. For each alarm definition, enter the bit number that is to trigger the alarm.

    1. Enter the value 0 for Alarm1 in the "Bit number" column.

    2. Increase the value for Alarm2... Alarm8by 1 in each case.

      Use the table editor function "Increment 1" to increase the parameter value by 1 for all selected definitions:

      • Select the cell whose parameter value you want to increase by 1 for other definitions.

      • Extend the selection to the area of the column for which you want to increase the parameter value by 1 (using the mouse or a keyboard command).

      • Right-click and select increment 1 in the context menu or press Ctrl+1.

    The respective bit that is to trigger the alarm is now specified in each of the eight alarm definitions.

    In (Undefined variable: docInfo_DE.Produktname), each alarm must now be assigned to an alarm class.

  6. Specify the alarm class for each alarm definition:

    1. Select "Alarm" in the "Alarm class" column for alarms 1 ... 3.

    2. Select the "Warning" alarm class for alarms 4 ... 6.

    3. Select the "Info" alarm class for alarms 7 ... 8.

    The "Alarm", "Warning" and "Info" classes are already defined in the project. These can be found in the project explorer node AlarmsWAlarm classes.