Skip to content

Functions

F_ClearAllEventsInClass

1
2
3
4
FUNCTION F_ClearAllEventsInClass
VAR_IN_OUT
    Alarms : ARRAY[*] OF FB_TcAlarm; //! Array of Alarms to be defined
END_VAR

Clears any events within Alarms that may have been raised.

F_CreateAllEventsInClass

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
FUNCTION F_CreateAllEventsInClass
VAR_IN_OUT
    Alarms : ARRAY[*] OF FB_TcAlarm; //! Array of Alarms to be defined
END_VAR

VAR_INPUT
    ClassSize  : UDINT;                   //! Size in bytes of the event class
    pInitEvent : POINTER TO TcEventEntry; //! Address of first event in Event Class (Should be the InitReferenceEvent)
    Prefix     : STRING;                  //! String Prefix for the Event Message -- Usually the Module ID and Name
END_VAR
Initializes all instances of FB_TcAlarm within Alarms.

F_GetMaxSeverityRaised

1
2
3
4
5
6
7
8
FUNCTION F_GetMaxSeverityRaised : TcEventSeverity //! Maximum severity
VAR_IN_OUT
    Alarms : ARRAY[*] OF FB_TcAlarm; //! Events to compare against
END_VAR

VAR_INPUT
    CurrentSeverity : TcEventSeverity; //! Current severity of module alarm
END_VAR

Returns the highest severity level of any events currently raised within Alarms.

F_RaiseAlarm

1
2
3
4
FUNCTION F_RaiseAlarm
VAR_IN_OUT
    Alarm : FB_TcAlarm; //! Alarm to be raised
END_VAR

Raises event associated with Alarm.

F_RaiseAlarmAndSetFlags

1
2
3
4
5
6
FUNCTION F_RaiseAlarmAndSetFlags
VAR_IN_OUT
    Alarm     : FB_TcAlarm; //! Alarm to be raised
    ErrorFlag : BOOL;       //! Error flag to set (VAR_IN_OUT, put the variable you want the function to SET here)
    ErrorID   : UDINT;      //! Error ID to set (VAR_IN_OUT, put the variable you want the function to SET here) - Will be set using the ID of the given fbAlarm
END_VAR

Raises event associated with Alarm, sets ErrorFlag to TRUE, and copies the eventID associated with Alarm into ErrorID.

F_RaiseAlarmWithStringParameters

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
FUNCTION F_RaiseAlarmWithStringParameters
VAR_IN_OUT
    Alarm : FB_TcAlarm; //! Alarm to be raised
END_VAR

VAR_INPUT
    String_1 : STRING; //! First string parameter
    String_2 : STRING; //! Second string parameter
    String_3 : STRING; //! Third string parameter
END_VAR

Raises event associated with Alarm and passes String_n as arguments for contextual information.

F_RaiseAlarmWithStringsAndFlags

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
FUNCTION F_RaiseAlarmWithStringsAndFlags
VAR_IN_OUT
    Alarm     : FB_TcAlarm; //! Alarm to be raised
    ErrorFlag : BOOL;       //! Error flag to set (VAR_IN_OUT, put the variable you want the function to SET here)
    ErrorID   : UDINT;      //! Error ID to set (VAR_IN_OUT, put the variable you want the function to SET here) - Will be set using the ID of the given fbAlarm
END_VAR

VAR_INPUT
    String_1 : STRING; //! First string parameter
    String_2 : STRING; //! Second string parameter
    String_3 : STRING; //! Third string parameter
END_VAR

Raises event associated with Alarm, sets ErrorFlag to TRUE, and copies the eventID associated with Alarm into ErrorID. String_n are passed as arguments for contextual information.