Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

Edge HMI

GetAlarmInfo

  • Last UpdatedOct 29, 2026
  • 3 minute read

This function gets information about an active alarm.

Function

Group

Execution

String Exp.

Windows

Windows Embedded

IoT View

Thin Clients

Mobile Access

GetAlarmInfo

Tags Database

Synchronous

Yes

Supported

Supported

Not supported (see Notes below)

Not supported (see Notes below)

Not supported (see Notes below)

Syntax

GetAlarmInfo(numIndex,numInfo)

GetAlarmInfo ( numIndex , { numInfo | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 } )

numIndex

The index number of the alarm about which you want to get information.

The index number must be between 0 and the total number of alarms minus 1. To get the total number of alarms, use the function GetAlarmCount. For example, if GetAlarmCount returns 6, then numIndex must be between 0 and 5.

The list of alarms is sorted by the times when the alarms first became active, so that the oldest alarm is index 0. When an alarm is both normalized and acknowledged, it is removed from the list and the remaining alarms are shifted accordingly. For example, when the alarm at index 3 is removed, the alarm at index 4 is shifted to index 3, the alarm at index 5 is shifted to index 4, and so on.

Note: It is possible for an alarm to be normalized (that is, become inactive) and then become active again without being acknowledged. That alarm will remain on the list of alarms throughout, and its Activation Time โ€” that is, time when the alarm first became active โ€” will not be updated.

numInfo

The information or alarm property that you want to get:

Value

Alarm Property

0

Alarm Group

1

Tag Name

2

Alarm Message

3

Alarm Type

4

Tag value when the alarm became active

5

Activation Time

6

Norm Time

7

Ack Time

8

Alarm Priority

9

Alarm Selection

10 to 19

Custom Field 1 to Custom Field 10

Tip: You can create custom fields in the Alarms worksheet.

Returned value

This function returns the current value of the specified property (numInfo) of the specified alarm (numIndex). For the property Alarm Type (that is, numInfo is 3), this function returns one of the following possible values:

Value

Alarm Type

1

HiHi

2

Hi

4

Lo

8

LoLo

16

Rate of change

32

Deviation+

64

Deviation-

For all other properties, this function returns the actual value of the property. As such, the project tag or VBScript variable that you configure to receive the returned value should be of the appropriate data type. For example, you may configure an Integer tag to receive the value of Alarm Group or Alarm Type, but you should configure a String tag to receive the value of Tag Name or Ack Time. It is safest to always configure a String tag to receive the value, because a String tag can hold any value as a string, but that might make it more difficult to process the value after it is received. Please keep this in mind as you design and develop your project.

If the specified alarm has not yet been normalized or acknowledged, this function returns no values at all for the properties Norm Time and Ack Time, respectively.

If the function is not executed successfully, it returns one of the following error codes:

Value

Description

-1

Function was called by a Graphics Script, Screen Script, or Command animation on a project client. (see Notes below.)

-2

Invalid alarm index (numIndex).

-3

Invalid alarm property (numInfo).

Notes

This function can only be executed on the project server โ€” it cannot be called by a Graphics Script, Screen Script, or Command animation running on a thin client. For more information, see Using TagsDB functions to edit the tags database during run time.

Also, this function is similar to the function TagsDBGetAlarm, except that it gets information about a specified alarm in the list of active alarms rather than about an alarm on a specified tag.

Examples

Get the type (for example, 2, meaning Hi) of the first alarm:

GetAlarmInfo(0,3)

Get the name of the project tag (for example, MyTag) that the second alarm is on:

GetAlarmInfo(1,1)

Get the date and time (for example, 12/05/2013 14:11:29) when the newest alarm became active, and then use the function DateTime2UTC to convert that from the current time zone to Coordinated Universal Time (UTC):

DateTime2UTC(GetAlarmInfo(GetAlarmCount()-1,5))

In This Topic