Gets the contents of the specified field in the specified alarm record.
This is a blocking function. If the function is called from a foreground task that is unable to block, the return value will be -1 and a hardware alarm set. Use IsError() to retrieve the error code.
Syntax
STRING AlarmGetFieldRec(LONG Record, STRING Field [, INT Ver [, STRING ClusterName]])
Record:
The alarm record number, returned from any of the following alarm functions:
To store this value, use data type Int in Cicode or Long for variable tags (Long needs 4 bytes).
Field:
The name of the field from which the data is retrieved.
Field | Description |
---|---|
AckDate | The date when the alarm was acknowledged |
AckDateExt | The date (in extended format) when the alarm was acknowledged (dd/mm/yyyy) |
AckTime | The time when the alarm was acknowledged |
AlmComment | The text entered into the Comment field of the alarm properties dialog. |
Area | The area to which the alarm belongs |
Category | Alarm category |
Cause1..8 |
An alarm response property that describes the cause of an alarm. You need to append a number (1–8) to indicate which set of properties will be referenced, as more than one alarm response can be configured for an alarm tag. The value reflects the order in which the alarm responses were configured. |
Comment | Operator comments attached to the Alarm Log entry (if any) |
Consequence1..8 |
An alarm response property that describes the likely outcome if an alarm is not acted upon within the specified response time (RespTime). You need to append a number (1–8) to indicate which set of properties will be referenced, as more than one alarm response can be configured for an alarm tag. The value reflects the order in which the alarm responses were configured. |
Custom1..8 | Custom filter fields |
Date | The date that the alarm changed state (dd/mm/yyyy) |
DateExt | The date that the alarm changed state in extended format |
Deadband | Deadband (Only Valid on Analog Alarms) |
DeltaTime | The time difference between OnDate/OnTime and OffDate/OffTime, in seconds |
Desc | Alarm description |
Deviation | Deviation Alarm trigger value (Only Valid on Analog Alarms) |
DisableComment | Can be used to describe the reason why the alarm was disabled. |
DisableEndDate | The date when the alarm will no longer be disabled. |
DisableEndDateExt | The date when the alarm will no longer be disabled in extended format (mm/dd/yyyy). |
DisableEndTime | The time when the alarm will no longer be disabled. |
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). |
Help | Alarm help page |
High | High Alarm trigger value (Only Valid on Analog Alarms) |
HighHigh | High High Alarm trigger value (Only Valid on Analog Alarms) |
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 |
Native_Comment | Native language comments the operator adds to an Alarm Summary entry during runtime. |
Native_SumDesc | A description of the alarm summary, in the native language |
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) |
OffMilli | Adds milliseconds to the time the alarm returned to its normal state. |
OffTime | The time when the alarm returned to its normal state |
OnDate | The date when alarm was activated |
OnDateExt | The date (in extended format) when the alarm was activated (dd/mm/yyyy) |
OnMilli | Adds milliseconds to the time the alarm was activated. |
OnTime | The time when the alarm was activated |
Priority | Governs the order in which alarms are displayed, acknowledged, enabled, etc. |
Rate | Rate of change trigger value (Only Valid on Analog Alarms) |
Response1..8 |
An alarm response property that describes the appropriate response to an alarm. You need to append a number (1–8) to indicate which set of properties will be referenced, as more than one alarm response can be configured for an alarm tag. The value reflects the order in which the alarm responses were configured. |
ResponseNum |
Indicates the number of alarm responses that are associated with an alarm tag (0–8). Each alarm response incorporates a set of properties including Cause, Consequence, Response and RespTime. |
RespTime1..8 |
An alarm response property that indicates the period of time in which the specified response should be acted upon. You need to append a number (1–8) to indicate which set of properties will be referenced, as more than one alarm response can be configured for an alarm tag. The value reflects the order in which the alarm responses were configured. |
State | The current state of the alarm |
State_desc | The configured description (for example, healthy or stopped) of a particular state |
SumDesc | A description of the alarm summary |
SumState | Describes the state of the alarm when it occurred |
Tag | Alarm tag |
Time | The time that the alarm changed state (hh:mm:ss) |
Type | The type of alarm or condition |
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). |
Value | The current value of the alarm variable |
nVer:
The version of an alarm.
If an alarm has been triggered more than once in a given period, the version lets you distinguish between different instances of the alarm's activity.
The version is used in filtering alarms for display. A query function passes a value to this parameter in order to get field information for a particular alarm.
This parameter is not needed when you use AlarmGetFieldRec() for purposes other than filtering. It will default to 0 if omitted.
ClusterName:
Specifies the name of the cluster in which the Alarm Server resides. This is optional if you have one cluster or are resolving the alarm server via the current cluster context. The argument is enclosed in quotation marks "".
Return Value
The alarm field data (as a string) or empty string "".
Related Functions
AlarmFirstTagRec, AlarmNextTagRec,
Example
FUNCTION
GetNameFromTag(STRING sTag)
INT record;
STRING sName
record = AlarmFirstTagRec(sTag, "", "");
IF record <> -1 THEN
sName = AlarmGetFieldRec(record,"NAME");
ELSE
sName = "";
END
RETURN sName;
END
See Also
Published June 2018