Cicode Programming Reference > Cicode Function Categories > Alarm Functions Introduction > AlarmGetDsp

AlarmGetDsp

Gets field data from the alarm record that is displayed at the specified AN. You can use this function for both Alarm Pages and Alarm Summaries (an Alarm Page or Alarm Summary needs to be displayed before this function can be used).

You can call this function on an Alarms Server or a client to get the contents of any field in the alarm record at that AN.

You can return the record number of the alarm record for use in other alarm functions, for example, to acknowledge, disable, or enable an alarm (on an Alarms Server).

The AlarmGetDsp() function does not support hardware alarms.

Syntax

AlarmGetDsp(AN, sField)

AN:

AN number of an ALMCB Alarm record. Equal to AN where actual ALMCB resides + Offset into the list of ALMCB records.

sField:

The name of the field from which the data is retrieved. The contents of the following fields can be retrieved when the Alarm Page is displayed:

Field Description
Area The area to which the alarm belongs. The user needs to have access to this area to access this alarm data.
AlmComment The text entered into the Comment field of the alarm properties dialog.
Category Alarm category
Comment Operator comments attached to the Alarm Log entry (if any)
Custom1..8 Custom Filter Fields
Date The date that the alarm changed state (mm/dd/yyyy)
DateExt The date that the alarm changed state in extended format
Deadband Deadband (Only Valid on Analog Alarms)
Deviation Deviation Alarm trigger value (Only Valid on Analog Alarms)
Desc Alarm description
Font Font of alarm.
Format Format of alarm.
High High Alarm trigger value (Only Valid on Analog Alarms)
HighHigh High High Alarm trigger value (Only Valid on Analog Alarms)
Help Alarm help page
LogState The last state that the alarm passed through
Low Low Alarm trigger value (Only Valid on Analog Alarms)
LowLow Low Low Alarm trigger value (Only Valid on Analog Alarms)
Name Alarm name
Priority The alarm priority
Rate Rate of change trigger value (Only Valid on Analog Alarms)
RecNo The alarm record number
State The current state of the alarm
State_desc The configured description (for example, healthy or stopped) of a particular state
Tag Alarm tag
Time The time that the alarm changed state (hh:mm:ss)
Type The type of alarm or condition
Value The current value of the alarm variable

The contents of the any of the above fields (except for State) and the following fields can be retrieved when the Alarm Summary is displayed:

Field Description
UserName The name of the user (User Name) who was logged on and performed some action on the alarm (for example, acknowledging the alarm or disabling the alarm, etc.). Be aware that when the alarm is first activated, the user name is set to "system" (because the operator did not trip the alarm).
FullName The full name of the user (Full Name) who was logged on and performed some action on the alarm (for example, acknowledging the alarm or disabling the alarm, etc.). Be aware that when the alarm is first activated, the full name is set to "system" (because the operator did not trip the alarm).
UserDesc The text related to the user event
OnDate The date when alarm was activated
OnDateExt The date (in extended format) when the alarm was activated (dd/mm/yyyy)
OffDate The date when the alarm returned to its normal state
OffDateExt The date (in extended format) when the alarm returned to its normal state (dd/mm/yyyy)
OnTime The time when the alarm was activated
OffTime The time when the alarm returned to its normal state
DeltaTime The time difference between OnDate/OnTime and OffDate/OffTime, in seconds
OnMilli Adds milliseconds to the time the alarm was activated.
OffMilli Adds milliseconds to the time the alarm returned to its normal state.
AckTime The time when the alarm was acknowledged
AckDate The date when the alarm was acknowledged
AckDateExt The date (in extended format) when the alarm was acknowledged (dd/mm/yyyy)
SumState Describes the state of the alarm when it occurred
SumDesc A description of the alarm summary
Native_SumDesc A description of the alarm summary, in the native language
Native_Comment Native language comments the operator adds to an Alarm Summary entry during runtime.

Return Value

Field data from the alarm entry (as a string). Current font handle for alarm record depending on state.

Related Functions

AlarmDsp

Example

! Display the tag and category for the alarm at the specified AN.
FUNCTION
AlarmData(INT AN)
STRING Category;
STRING Tag;
Category=AlarmGetDsp(AN,"Category");
Tag=AlarmGetDsp(AN,"Tag");
Prompt("Alarm "+Tag+" is Category "+Category);
END

See Also

Alarm Functions