Configuring the Alarm Management

Creating alarm configurations

  1. Select an application in the device tree.

  2. Click Project ‣ Add Object ‣ Alarm configuration .

    ⇒ The Add alarm configuration dialog box opens.

  3. Click Add.

    ⇒ CODESYS adds the Alarm Configuration to the device tree below the application.

    In addition, CODESYS inserts the predefined alarm classes (Error, Info, and Warning) and the alarm storage AlarmStorage below the alarm configuration. The predefined objects are available to you if you need them.

Configuring alarm classes

  1. Select the Alarm Configuration object in the device tree.

  2. Click Project ‣ Add Object ‣ Alarm class .

    Type in a name (example: “PartsDeficit”) and click Add

    ⇒ The PartsDeficit alarm class is added to the device tree. The object opens in the editor.

  3. Set the following parameters for the class. These apply to all alarms that belong to this class group:

    • Priority: 10
    • Archiving
    • Acknowledgment method: REP_ACK
    • acknowledge separately:
  4. In the following, you define that the bPartsDeficit variable has the value TRUE when alarm messages occur: Double-click the Action column in the Notification actions group.

    Select the Variable action.

    Press the Enter key.

    ⇒ The action is added and all options are activated.

  5. Select the activate check box, and clear the deactivate and confirm check boxes.

  6. Click inside the input field Variable and enter bPartsDeficit or select the variable with the help of the input assistant

    Enter the value TRUE into the right field.

    ⇒ The ...bPartsDeficit := TRUE statement is displayed in the Details column.

  7. Select the Background color “Red” in the Active row of the Display options group.

    Select the Background color “Yellow” in the Wait for confirmation row in the Presentation options group.

All messages in the PartsDeficit class set the variable bPartsDeficit to TRUE. Active messages are highlighted in red in the “Alarm table” visualization element. Deactivated messages that are not acknowledged are highlighted in yellow.

See also

Configuring alarm groups

In the following, you define an alarm group with an alarm for monitoring PartsDeficit. You have already created the applicable alarm class above.

  1. Select the Alarm Configuration object in the device tree.

  2. Click Project ‣ Add Object ‣ Alarm group .

    Type in the name “PartsDeficit” and click Add

    ⇒ The PartsDeficit alarm group is added to the device tree. The object opens in the editor.

    CODESYS creates the text list PartsDeficit.

  3. Set the following parameters:

    • Archiving: (none)
  4. Double-click in the Observation type field.

    Select the Digital monitoring type.

  5. Configure the alarm as follows:

    • Class: PartsDeficit
    • Message: PartsDeficit at Station 1 - level: <LATCH1> (“<LATCH1>” is a placeholder for latch variable 1.)
    • Min. pend. time: t#5s
    • Latch var 1: ...iFuellstand
  6. In the Digital group, click the Expression field and type in bPart1Empty or select the variable by using the input assistant.

    Type in the value TRUE in the right field.

    ⇒ The ...bTeil1Leer = TRUE statement is displayed in the Details column.

If the bTeil1Leer variable switches to TRUE, then CODESYS triggers a message. The value of the iFuellstand variable is printed with the message. The acknowledgment response and the display are executed according to the PartsDeficit alarm class. The alarm is not archived.

See also

Configuring alarm storage

  1. Select the Alarm Storage object in the device tree.

  2. To change the name, select the Properties command in the context menu.

    Change the name from “AlarmStorage” (example: “DatabaseFileAlarmStorage”) and click OK.

  3. Double-click the DatabaseFileAlarmStorage object in the device tree to open the editor.

  4. Configure as follows:

    • Subdirectory: Leave this field blank. Specifying a directory is optional only on the PLC where the alarm storage file will be saved.
    • Limit group: Select the No limit check box.

    ⇒ The alarm storage is configured. In this case, CODESYS saves the alarms internally in an unlimited buffer.

See also