Professional Documents
Culture Documents
Alarm
User's Guide
Copyright 2020 General Electric Company and/or its affiliates (“GE”). All Rights Reserved. This document is the
confidential and proprietary information of GE and may not be reproduced, transmitted, stored, or copied in
whole or in part, or used to furnish information to others, without the prior written permission of GE.
Contents
About This Document ........................................................................................................ xi
Purpose of This Document ..............................................................................................................................xi
Who Should Use This Document ..................................................................................................................xi
Structure of This Document ............................................................................................................................xi
For More Information ...................................................................................................................................... xii
Conventions ....................................................................................................................................................... xiii
Change Summary ............................................................................................................................................ xiv
1. Introduction ...................................................................................................................... 1
1.1 What Is Alarm? ............................................................................................................................................. 1
1.2 Overview ......................................................................................................................................................... 1
1.3 Life Cycle of an Event ................................................................................................................................. 3
1.4 Terminology................................................................................................................................................... 4
1.5 Alarm Health Timer..................................................................................................................................... 6
Figures
Figure 1. Overview of Events Processing and Alarm Acknowledgment ........................................... 2
Figure 2. Life Cycle of an Event......................................................................................................................... 3
Figure 3. Overview of Event Processing ........................................................................................................ 7
Figure 4. UNACK vs. LOG-ONLY State ............................................................................................................ 9
Figure 5. Alarm and Browser Interaction ...................................................................................................18
Figure 6. Alarm and MRS Interaction ...........................................................................................................20
Figure 7. Alarm Acknowledgment .................................................................................................................26
Figure 8. Tones and Alarm ...............................................................................................................................37
Figure 9. Audio Alarm Tab in the Browser Viewer ...................................................................................39
Figure 10. ALARM Database ............................................................................................................................45
Figure 11. Use Long Names .............................................................................................................................55
Figure 12. Simple Return to Normal Example ...........................................................................................57
Figure 13. Complex Return to Normal Example .......................................................................................58
Figure 14. Indexed Query for Alarms ...........................................................................................................61
Tables
Table 1. Event Processing Options .................................................................................................................. 9
Command Prompts
Operating Prompt Description
System
Linux % All commands preceded by a percent sign prompt (%)
are issued from a Linux terminal window. Note that all
Linux commands are case sensitive.
Windows > All commands preceded by a greater-than sign prompt
(>) are issued from a Windows command line window.
All Operating The absence of any prompt character before a
Systems command indicates that the command is valid on all
operating systems.
Command Strings
Operating Delimiter Description
System
Linux Italics Text in italics indicates information you must supply. (*)
Linux [] Text enclosed in square brackets "[ ]" indicates optional
qualifiers, arguments, or data. (*)
All Operating Select When used in command strings, the term “Select”
Systems means placing the pointer over the specified item and
pressing the left (default) mouse button.
(*) Note: All Linux commands are case sensitive and must be typed exactly as shown.
1.2 Overview
Figure 1 provides an overview of the functions that the Alarm application performs.
The Alarm application follows the traditional client-server model, where clients send
messages and requests to a server, which in turn processes them.
The duties of the Alarm application can be separated into two categories:
• Alarm clients notify Alarm of events occurring in the system. The Alarm API sends these
events to the Alarm server. Each event is processed based on the attributes specified
with the event and the information available in the Alarm database for the
object/exception definition related to the event. Processing of an event may result in an
alarm, which in turn may require a notification to the operator. The notification can
optionally include audible alarms and visual indicators. The notification is sent to some
number of users based upon their permissions as defined by the PERMIT application. In
addition to this notification, the Alarm server may insert each event in one or more logs
that are viewed using Browser (formerly e-terrabrowser) displays.
• Users can acknowledge and delete alarms using Browser. The acknowledgment request
may go directly to the Alarm server or it may be received by an application that uses the
Alarm API to perform the acknowledgment. Also, some clients (Scada, for instance)
require that they be informed of acknowledgment operations, since they may maintain
their own list of exceptions based on an abnormal and/or an unacknowledged state. In
this case, the notification of the acknowledgment is passed by the Alarm server to the
Alarm API in the client’s process.
Note: Steps 3, 4, and 5 happen at the same time and their order is not guaranteed.
Note: This step may occur right after step 5, or many hours later.
7. The Alarm server changes the state of the alarm from unacknowledged to
acknowledged. This entails moving the alarm from its unack. lists to its ack. lists.
8. The client application is notified that the alarm has been acknowledged.
9. The operator deletes the acknowledged alarm.
10. The alarm server removes the alarm from the alarm list.
The above steps can be applied to a vast majority of the events generated in a typical
Energy Management System (EMS). However, the Alarm application provides some options
to skip or automate some of these steps. To provide more clarity, this example does not
indicate any permission checks or any of the steps related to the replication of the events
on the standby machine.
1.4 Terminology
The following terminology is used in this document:
Event
A notable occurrence at a single place and point in time that is detected by the application
software and forwarded to the Alarm application.
Alarm
An indication (visual, or visual and audible) that an event has occurred. In the context of the
Alarm application, an alarm is an event that needs to be brought to the attention of at least
one operator. This is accomplished by inserting the event in the alarm list.
Client
An Alarm client that uses the Alarm API services provided by the Alarm server. Alarm clients
can be on any computer within the site.
User
A human user of the Alarm application. This includes integrators as well as operators.
Alarm Viewer
A Microsoft Windows application used for querying and viewing event data from Habitat’s
(formerly e-terrahabitat) Alarm application. The Alarm Viewer can run as a stand-alone
application or as a display within the Browser viewer.
2.1.2 Auto-Acknowledgment
If it has been decided that the event will go to the alarm lists, the Alarm server considers the
AUTOACK flag in the exception definition associated with the event. If the AUTOACK flag is
set, then the Alarm server performs an automatic acknowledgment of the new alarm. This
acknowledgment is done as if it were performed by an operator, except that there are no
permission checks. If the AUTODELETE flag in the exception definition is also set, the alarm
is automatically deleted as well. Related alarms are acknowledged if the MULTIPLE ACK flag
in the event’s object definition is set.
If automatic acknowledgment is triggered, the end result for the incoming event may vary.
Table 1 summarizes the options and their final result, assuming that the NOLOG option is
not specified by the client when posting the event. When the NOLOG option is used, the
processing is the same, except that the event never gets inserted into any formatted log.
2.2 Formatting
Before being inserted into alarm lists or event logs, an event must be formatted — that is,
the data provided for the event by the client must be presented in a readable text format.
This text includes a description of the alarm and when the alarm occurred.
Note: To show the duplicated hour indicator (*) on the alarm lists and logs displays during
the change from Daylight Saving Time to Standard Time, the field DISTIFMT_ITEMS must
be configured with “%#R” at the end of the format. The modification of this field can only
be done with HdbRIO.
1
Alarm can support the e-terrahabitat 5.2 alarm archive output format. The ARCTIFMT field is only used if
ALARM is configured to use this older format. This older format is not compatible with Alarm Viewer and is not
recommended for use. This format will not be available in future releases.
2
For more information regarding the syntax used to define Alarm messages, see the Message Logging Facility
User’s Guide.
3
For more information regarding the LINK command, refer to the Habitat User’s Guide.
/*
** AlarmMridList - an ordered list of MRIDs. Each MRID is
** represented by a string object. The MRID itself is
** assumed to be a string representation of a UUID.
*/
typedef std::vector<AlarmMrid> AlarmMridList;
/*
** AlarmLongNameList - an ordered list of Long Names
*/
typedef std::vector<std::string> AlarmLongNameList;
/*
** AlarmCompositeKey - a structure to store the composite key
** of a power system object.
**
** The domain field identifies the domain in IMS (Identifier Mapping Service)
** where the composite_key field is defined.
**
** The composite_key field is the composite key string stored in IMS.
*/
struct AlarmCompositeKey
{
std::string domain; // IMS Domain
std::string composite_key; // IMS Alias
};
/*
** AlarmCompositeKeyList - an ordered list of AlarmCompositeKey's
*/
typedef std::vector<AlarmCompositeKey> AlarmCompositeKeyList;
/*
** Support for Replay, ETNAV, Historian
** ------------------------------------------
** The Alarm API client needs to provide the alarm object MRID and/or the
** alarm object full composite key.
** If only the full composite key is provided, the Alarm server will look
** up in IMS for the MRID.
** If only the MRID is provided, the Alarm server will look up in
** IMS for the full composite key
*/
AlarmMrid object_mrid;
AlarmCompositeKey object_comp_key;
/*
** Alarm Long Name support
** -----------------------
** The Alarm API client can choose one of the three options:
** (1) a long_name_list, or
** (2) a mrid_list, or
AlarmLongNameList long_name_list;
AlarmMridList mrid_list;
AlarmCompositeKeyList composite_key_list;
};
Note: In both cases, the replication of the events is not truly done by the MRS subsystem.
MRS and Alarm cooperate to perform some message tunneling, so that the server on the
standby can update its database and stay in synch with the primary.
The recovery of the Alarm database is performed by the MRS subsystem. The ALARMLST
database is entirely recovered once the appset on the standby machine transitions to the
standby role.
At first glance, you would think that the Alarm server on the primary should not need to
replicate events for clients that are using MRS, since these events should be replicated
through a transaction done from within the client’s process. However, there is a potential
timing problem with this approach if the following situation occurs:
1. The Scanner process, which is an Alarm client that uses MRS, posts an event. This event
synchronously gets to the MRS task, which discards it because at this time the Alarm
recovery set status is invalid.
2. The Alarm server on the primary also gets this event but is slow to process it. As a result,
the event sits in a queue and the database update is not done.
3. The MRS task initiates a recovery of the ALARMLST database and takes a snapshot
before the Alarm server processes the Scanner event.
4. Eventually, Alarm gets around to processing the Scanner event. Alarm believes that the
event has already been replicated, when in fact it has not.
To prevent this situation from happening, the Alarm server on the primary always replicates
the events it is processing, even if these events have already been replicated from within
the client’s context. Some intelligence has been added to the MRS task so that it does not
send the same replication message to the MRS task on the other node more than once.
Note: The API functions can be called from any computer within the local site, since
the Alarm API forwards the requests to the enabled server. This makes it possible to
acknowledge alarms from any computer.
4
If a new database is brought online and some records have been deleted, users should also consider that
they may receive an acknowledgment notification on an object that is no longer in their database.
3.3 Permissions
When posting events, clients can assign as many as five permission keys (i.e., PERMIT areas)
to the event, which are used by the Browser server to restrict the display of alarms based
on the permissions assigned to each user as defined by the PERMIT application.
Acknowledgment and deletion operations are subject to permission checks. For an operator
to acknowledge or delete an alarm, that operator needs to have the WRITE permission for
one or more of the permission keys assigned to that alarm. If a permission check fails, the
operator is notified through an RUSER pop-up message.
Permissions attached to a user can be changed by operators “on the fly” in the PERMIT
application. Alarm periodically checks the PERMIT database and rebuilds its lists when it
detects a change in the PERMIT database. Using the ALARM_MODEL_MISCELLANEOUS
display, the user can specify how often the PERMIT database should be checked.
Note: Alarm printouts can be lost if all printers assigned to a queue have failed and the
Logman buffers are full.
When the connection with the Logman server is lost and then re-established, the Alarm
server reprints the events of the last n seconds, as specified in the REPRDELT global field.
Caution: When using the Alarm Viewer to parse the archive files, the Periodic setting
should be used to keep the size of the archive files small. Using the Daily, Weekly, or
Monthly schedule may produce very large archive files, and the Alarm Viewer is required
to download the entire file even if only part of the file is required.
Integrators need to set the “Base time for opening a new archive file” for whichever option
is chosen. The “Base time for opening a new archive file” is used to compute when the first
archive file should be closed and a new file should be opened. At startup (or after a failover),
the enabled Alarm server creates an archive file and schedules the opening of a new one. It
uses the base time and the period specified for how long the same file should be used as
follows:
closing_time = base_time + n*period
Note: If Daylight Saving Time is observed, this time must be adjusted by a factor of one
hour (60 minutes) twice per year to maintain a consistent archiving time. For example, if
archiving is scheduled to occur every night at midnight, archiving begins at 1:00 a.m.
when Spring Daylight Saving Time is in effect.
Note: By default, the Alarm application aborts when it fails to write the archive file to the
archive directory. The write operation may fail when the archive directory is unavailable
or read-only, or when the current archive file is read-only. If the
ALARM_ARCHIVE_NOABORT environment variable is set, the alarm application ignores
this error.
5
The Browser viewer is delivered as part of the Browser client. For more details, refer to the Browser User’s
Guide.
Note: Alarm does not get the permissions for each application from Permit. Instead, Alarm
retrieves the permissions for each area. Therefore, changing the audible settings for a
particular application under a mode (from the “Mode_application” Permit display) does
not have any effect on the alarms for that application.
Note: The Browser viewer requires an AudioAlarm folder that contains .WAV files and the
priority.txt file.
The Browser AudioAlarm can be tested from its own user interface by issuing commands
from the command line.
To play a wave file once:
Oleauto/user=fg.audioalarm "wavefilename /AREA = area1,area2,area3,area4,area5"
To play a wave file continuously:
Oleauto/user=fg.audioalarm "wavefilename/c /AREA = area1,area2,area3,area4,area5"
To silence by playing the NoSound.wav file:
Oleauto/user=fg.audioalarm "/s"
The Browser AudioAlarm can handle from zero to five permission areas separated by
commas. The Alarm application automatically generates this command string using the
areas that were passed with the alarm that issued the tone.
Note: Regardless of the method chosen, the validation program can only be run
successfully while the Alarm server is not running. Given this restriction, it might be
convenient to perform the Alarm modeling tasks using a different clone than the one used
by the EMS.
• From Analyst Displays > Alarm Modeling, select a modeling display. To display the
validation pop-up, click Database Validation. To run the validation program, click Verify
Database Definition.
• Using TVIEW, run the validation program with the following command:
% tview run alarmval alarm family
where family is the family of the ALARM clone.
• Run the validation program interactively by setting the right context and running the
alarmval executable.
Note: For instances of Platform with APF, this setting takes precedence over the Mode
of the Audible profile defined in the APF Audible Configuration application.
• Priority of the tone: For instances of Platform with APF, the priority.txt file was
deprecated. The priority is now defined in the Audible profile of the APF Audible
Configuration application.
For instances of Platform without APF, the priority.txt file specifies the priority of tones to
be sounded in Browser. The first tone listed in the file has the highest priority; each
additional tone has a priority lower than the previous one.
For more information about Long Names and MRID Support, see section 2.3 Long-Name
and MRID Support.
The following describes in detail how the Alarm server handles the Simple Return to Normal
scenario shown in Figure 12.
1. Abnormal Alarm Settings
– The analog object definition has the multiple delete option on.
– The category definition has the Prevent Abnormal Alarm Deletion option on.
– The exception definition has the auto-delete option off.
– Issue the alarm with a specific object identifier number.
– Acknowledge the alarm from an alarm display.
– Ensure that the alarm cannot be deleted.
2. Return to Normal Alarm Settings
– The analog object definition is the same as the abnormal alarm.
– The category definition has the Prevent Abnormal Alarm Deletion option off.
– The exception definition has the auto-delete option on.
– Issue the alarm with the same object identifier as the abnormal alarm.
If there are two alarms in the list, related based on the same object identifier, then when the
Return to Normal alarm is acknowledged, the auto-delete function deletes it and any other
related alarms with the same object identifier, including the Abnormal alarm.
If the Abnormal alarm remains unacknowledged when the Return to Normal alarm is
acknowledged, the Abnormal alarm is not deleted. To compensate for this, set the multiple
ack and multiple delete settings on the object definition.
If the user does not need to be alerted about these alarms once they return to normal,
setting the auto-acknowledge and auto-delete options on the exception definition removes
The following describes in detail how the Alarm server handles the Complex Return to
Normal scenario shown in Figure 13:
1. Threshold Violation Alarm Settings
– The analog object definition has the Overlay Delete option on.
– The exception definition has no options selected.
– The category definition has no options selected.
– Issue the alarm with a specific object identifier number.
2. Return to Normal Alarm Settings
– The analog object definition has the Overlay Delete option on.
– The exception definition has the auto-acknowledge option on.
The general query syntax lists the time query first, then the attribute queries, followed by
the attribute filter values. If a specific attribute query is not needed, it can be omitted from
the query and no filter is applied. The ALL argument can also be used for the filter value that
returns all of the alarms under that attribute.
Syntax: sortOrder filter filterValues
Examples:
unacked_first_desc_time priority 1,3
asc_time priority_location 1,5 loc1,loc2
The general query syntax lists the time query first, then the startTime option, followed by
the attribute filter values. If a specific attribute query is not needed, it can be omitted from
the query and no filter is applied. The ALL argument can also be used for the filter value that
returns all of the alarms under that attribute.
Syntax: sortOrder startTime filter filterValues
Examples:
desc_time All category cat1,cat4
asc_time All location loc1,loc5
• Area Permissions: This control allows the user to switch between filtering on user-based
read permissions and showing all data. The OFF mode displays data regardless of
permission areas, and the ON mode filters on read permissions. When a user switches
modes, the entire contents of the Alarm Viewer are emptied and new data is requested
from the Browser server. This operation affects all viewports running in the Browser
client, because they all share the same data source.
When switching area filtering from OFF to ON, it is possible to have fewer categories
and locations, since these lists are populated based on data in the Alarm Viewer.
Therefore, selecting a category or location and then submitting the query may result in
the Results View not being filtered on the desired values because they do not exist in the
permission-filtered cache.
• Data Source: This drop-down menu appears only when DATA_SOURCE_ETA is enabled
in the configuration. This provides the ability to switch between ALARMLST and Historian
as the data source.
• Locations: A user can select one or more locations using the list of check boxes.
Additionally, the NOT, AND, and OR logical operators can be applied to the list of
locations.
9.4 Configuration
Before you attempt to run the Alarm Viewer, several configuration parameters must be set.
The AlarmViewer_config.txt file has comments and examples for these parameters; this file
is placed in the Alarm Viewer directory under the WebFGCache directory for Browser during
installation. Some parameters are required, while others are optional. Where possible, if a
property is not defined in the configuration file, a default value is provided in the code.
The configuration file to use is specified on the Configuration tab in the Browser viewer. This
file specification may include a URL or a directory specification to load the configuration file.
This specification must also include the configuration file to be loaded. If only the name of
the configuration file is specified, the Alarm Viewer loads the specified file from the
Eterra\webfg\webfgcache\alarmviewer directory on the client computer. If no file is
specified, the Alarm Viewer loads the AlarmViewer_config.txt file in that directory; this
allows each Browser client connection to use a different configuration for the Alarm Viewer.
Note: The following values are case-sensitive. Entering lowercase values causes
Browser to crash.
– ALARMLST: Get data only from the ALARMLST database. This is the default.
– ARCHIVE: Get data only from archive files.
– ALL: Get data from either.
– SMP: Get data from the Control server.
– SMP_ALL: Get data from Control or Control–generated archive files.
– SMP_ARCHIVE: Get data from Control–generated archive files only.
• HOST1: If data is to be acquired from ALARMLST, the host name must be provided. The
form of the name is <host>::<habitat group>.
• HOST2: If data is to be acquired from ALARMLST, the host name must be provided. The
form of the name is <host>::<habitat group>.
• PORT: Specifies the port on which the data server is listening. The port number is
specified in the definition for the Browser data server. This is required when not using
NIOARC and data is to be acquired from ALARMLST.
• DATASOURCENAME: This is an optional setting. It can be used to replace the three
settings host1, host2, and port. The value of this setting must match the data source ID
specified in the configuration file webfg_config.xml. DATASOURCENAME = default is an
example.
• NIOARC: Specifies whether the data server uses NIOARC. When using this feature, it is
possible to get a second logon screen when running in Browser after the initial logon to
Browser is performed.
• NAP_SERVER: Specifies the Network Access Point (NAP) defined for the Browser server
from which the data is going to be retrieved.
• DATA_SOURCE_ETA: If data is acquired from Historian, this property must be set to YES.
• ETAURL1/ ETAURL2: If data is acquired from Historian, a URL for the Web service must
be specified.
Note: These settings are not applied to data obtained from Control–generated archive
files and data obtained from Historian for the standalone Alarm Viewer.
• PERMISSION_AREAS: Specifies the permission startup mode of the Alarm Viewer. The
OFF option displays data for the entire system, and the ON option filters on permission
areas.
• PERMISSION_SWITCH: Specifies whether the user is allowed to switch between the two
permission modes at run time. When set to NO, the Area Permissions controls of the
Query View are inactive; when set to YES, these controls are active.
Note: This parameter has no effect when using Historian as a data source.
• REFRESH: Specifies whether the Results View and Query View are updated when refresh
events are received from the data server. The default value is ON.
• REFRESH_RATE: Specifies the refresh rate in seconds. The default value is 2 seconds.
• TIME_FORMAT_STRING: Specifies a formatting string for time values. This uses standard
codes for the C Run-Time Library function strftime (except for “%#R”, which is used to
indicate the repeated hour when Daylight Saving Time transitions to Standard Time).
The default formatting string is “%m/%d/%Y %H:%M:%S%#R”.
• USE_CTIME: Specifies if the time values are to be sent in CTime format. This is only
supported in later versions by the Browser data server, and it is required for the Alarm
Viewer to accurately display repeated hour information. It is recommended that this
option be enabled when available.
• REPEATED_HOUR_INDICATOR: This indicator is used for formatting time strings when
the repeated hour is encountered, if using the %#R in TIME_FORMAT_STRING. The
default value is *.
• TIME_ZONE_OFFSET: Specifies the time offset from the host machines in minutes. For
example, if the server is in PST and the client is running in EST, the correct setting is -
180.
• STARTUP_DATA_SOURCE: Specifies whether to start Alarm Viewer connected to
ALARMLST or ETA. This parameter is only relevant when DATA_SOURCE_ETA is YES.
• ETA_RETRY_CONNECT: Specifies the number of times Alarm Viewer tries to make
connections to one of the Web services defined by ETAURL1 and ETAURL2.
• ETA_PROMPT_USER_LOGIN: Set to YES if users should be allowed to enter credentials
for connecting to the Historian Web service. If not set, or if set to NO, the current user’s
Windows authentication is required.
• ETA_TIMEOUT: Specifies the number of seconds to wait for the Historian query to return.
Defaults to no timeout.
The name entered automatically has the avquery extension appended to it, unless the
name itself contains the extension. The file is saved in the directory specified by the
QUERY_DIR value in the configuration file. The Include Time Filter check box specifies
whether to store the current time settings with the saved query.
There are two locations in which the Alarm Viewer looks for available queries. The Local
location is the directory specified by the QUERY_DIR, and the Shared location is specified by
the QUERY_URL. Each location requires a query_list.txt file that contains the names of the
available queries. This file can be generated using the command “dir /b *.avquery >
query_list.txt”. When a query is saved, the Alarm Viewer updates the local copy of the
query_list.txt file.
When running within Browser, the Shared queries are loaded from the location specified by
the Alarm Viewer URL on the Configuration tab. Select the desired query and click OK. The
Submit Query button must still be clicked to execute the query.
Note: This is the only way to print the contents of the Alarm Viewer. The print commands
for printing normal displays do not work for the Alarm Viewer.
This figure demonstrates the recommended method for publishing archive files to the Web
server. Each Web server requests the archive files from both the primary and standby
Energy Management System (EMS) servers. Since the archive files are named after their
time values, there should never be a case where two files on different machines have the
same name. There are applications that perform this functionality, but they must be secure
and they must be able to exclude archive files that are still open; SAMPCOPY, or a third-
party SFTP-based application, is recommended.
For more information about archive files, see section 4.2 Archiving Events.
Inhibit: Prevents the application from processing the filter during execution. This setting
cannot be removed while the application is running, and it is only detected when the
application is started.
Exception: This is the exception that was issued with the event. This value matches the
exception definition values in the Alarm server database. In most cases, there is a one-to-
one correspondence between the exception and the event.
Category: This is the category ID that was issued with the event, not the category label. The
category ID is the two-character representation for the category.
Location: This is the location specified with the event. In some cases, it represents the
substation where the event was detected.
Text: This is the formatted text for the event as it is displayed on the Alarm Summary
displays.
Composite ID: The composite ID is used to relate similar alarms to one another. In the
context of SCADA applications, this represents the point that the event is generated for. This
allows the filter to monitor all the events that come from a particular point in SCADA.
Permission Areas: These are the five permission areas that are specified with the event.
Only one area is required, but up to five areas can be specified for each event.
Priority: This is the priority of the alarm that is determined by the category assigned to the
event. The valid values for the priority are 1–8, and they can be specified by a range of
Inhibit: Prevents the application from using the address during execution. This setting
cannot be removed while the application is running, and it is only detected when the
application is started.
Address: This is the label for the address record, and it is only used as a reference to the
record. This attribute should contain some information about whom and what the address
is designated for. For an address that is a mobile pager or a cellular phone, consider a label
such as “John’s Pager”. This attribute is used to associate the address with a filter or group.
E-mail: This is the e-mail address that is used for this address to send the page. This
attribute is the same as typing a recipient’s e-mail address into any e-mail application. To
page a cellular phone or mobile pager, specify the phone number and the proper address
for the phone carrier. This functionality is only supported if the mobile device supports SMS
messaging and if the device account allows text messaging.
Note: Additional charges may apply to text messaging depending on the type of account
with the mobile device carrier. This functionality is not provided by the Alarm Pager or by
GE.
Address Is a Pager: This setting is used to specify if this address only supports SMS
messaging. The majority of mobile devices only support SMS messaging, which limits the
amount of text that can be sent to the device. This setting removes the subject and
additional lines of text specified on the filter record and only sends the text of the alarm to
the device.
Inhibit: Prevents the application from using the script during execution. This setting cannot
be removed while the application is running, and it is only detected when the application is
started.
Script: This is the label for the script record. It is only used as a reference to the record.
Script Name: The name of the actual script to run as it appears on the system, including the
file extension.
Script Arguments: The optional arguments provided to the script.
Inhibit: Prevents the application from using the group during execution. This setting cannot
be removed while the application is running, and it is only detected when the application is
started.
Group: This is the label for the group that is used in the RUSER “PAGE” command.
Time Period: Periodic timer to check the application’s list of events received from the Alarm
server. When the timer expires, the list of events is compared against the modeled filters. If
there is no value specified, the default period is set to 30 seconds.
Mail Server: Network address of the mail client the application sends the SMTP messages
to. This is a mandatory field that must be defined for the Alarm Pager to pass validation. If
the Alarm Pager is only used for script execution, then define a dummy address that is not
valid.
Mail “From:” Address: Specifies the sender of the alarm sent with the page.
Page Time Format: Specifies the format to display the date and time of the alarm sent with
the page. This is a mandatory field that must be defined for the Alarm Pager to pass
validation.
Script Directory: Specifies the location of the script files that are to be executed by the
application. This is optional if the scripting functionality is not used or if the scripts are
contained in HABITAT_BINDIR.
ALMPAGER_LOG: Provides access to the application log, including execution and model
validation information.
This display is accessed from the pull-down menu from the Alarm text on the Alarm
Summary displays. To page the alarm, enter the desired address ID, e-mail address, or
group ID and click the Send button. After the page is sent, the display is closed.
Group Paging
This allows the operator to page an alarm from the Alarm Summary displays to a group of
e-mail addresses. This command is designed so that the operators do not need to know the
group IDs. The operator-initiated group pages can be added to the menus that are
attached to all alarms and events on the Alarm Summary displays. The command specifies
the group that the alarm is paged to. The syntax of the command is below, where the
<group> field is the group ID modeled for the application:
MAIL/USER=ALMPAGER_%DISFAM% “PAGE <group> %TXTFMT_ALMQ”
10.7.4.1 Addresses
Insert all of the addresses for receiving alarm messages, as shown in the image below. For
the addresses that only support SMS messaging, select the Address Is a Pager check box.
10.7.4.2 Scripts
Insert all scripts used by filters by entering the script name and arguments in the fields, as
shown in the image below.
10.7.4.5 Miscellaneous
From the ALMPAGER Database Editor display, select the Misc. tab and define all of the
information needed for the Alarm Pager to start successfully.
10.7.5 Troubleshooting
11.1 Dependencies
This section describes the subsystems that must be available for Alarm to function.
11.1.1 NETIO
Alarm uses the NIOSOCK API provided by NETIO for all communication paths with its clients.
To establish these connections, the three NETIO tasks (NIOARC, NIOCLERK, and NIOSERVE)
must be running and the NETIO server must have taken the enabled role.
Alarm also uses the NIONTS API, provided by NETIO, to establish its link with the MRS task
on the standby machine. To establish this connection, technically, only the NETIO Address
Registry Clerk (NIOARC) is required to be running on the standby machine.
11.1.2 Hdb
Hdb is the database subsystem within Habitat. Alarm uses the documented Hdb API to
access the ALARMLST database and update the alarm lists.
11.1.3 PERMIT
Alarm needs to check permissions before inserting alarms into the lists and for operator
actions such as acknowledgment and purging. Alarm does not map directly to the PERMIT
database; instead, the Alarm server uses the PERMIT API to perform its permission checks:
• Any given alarm can have up to five permission areas assigned to it when it is issued. As
long as a user has write permissions for one area, the alarm can be partially
acknowledged or deleted for that area.
• A user who has write permissions for all of the assigned areas can fully acknowledge or
delete the alarm.
• An alarm is not considered fully acknowledged or deleted until it has been
acknowledged or deleted for all of the assigned areas.
• Blank areas or non-assigned areas are treated as default values that are acknowledged
or deleted as soon as a user with at least one of the areas acknowledges or deletes that
alarm.
11.2.4 Hdb/MRS
The Alarm server uses the Memory Replication Service (MRS) to replicate the events on the
standby computer. It replicates events by attaching messages on top of the regular flow of
data going from the primary to the standby computer. To attach these messages, the Alarm
server uses a dedicated API function provided by MRS.
Calls to the MRS API can be disabled from the ALARM_MODEL_MISCELLANEOUS display, in
which case replication of events does not occur.
11.2.5 Logman
Alarm uses the Logman API to print events on the Logman queues. The Logman API can be
turned off using the ALARM_MODEL_MISCELLANEOUS display.
6
Dynamic Link Library (DLL) in Microsoft Windows.
Note: By default, the maximum number of events stored by the API AlarmStoreEvent
is 4,000. If the ALARM_EVENTS_BUFFERED_MAX environment variable is defined, the API
uses this value instead.
Syntax
status = alarm_acknowledge( object_name, object_handle, time, station )
C Binding
#include "alarm.h"
extern SCF_STATUS AlarmAcknowledge(
const char object_name_str[],
CCA_HANDLE object_handle,
TIMEDATE_HABTIME time,
const char station_str );
Fortran Binding
INTEGER*4 ALARM_ACKNOWLEDGE(
CHARACTER*(*) OBJECT_DEF,
INTEGER*4 OBJECT_HANDLE,
TIMEDATE_HABTIME TIME,
CHARACTER*(*) STATION )
Arguments
object_name
A character string identifying the object definition in the Alarm database. The maximum length of the
string is defined by the ALARM_OBJECT_NAME_MAXLEN constant.
object_handle
A handle identifying an instance of the object definition. This handle is passed at the time the event is
posted.
time
A TIMEDATE time indicating when the alarms on the object have been acknowledged. If a null value is
passed, the current time is assumed by the API.
station
A character string identifying the station where an operator executed the action that led to this
acknowledgment call. The maximum length of the string is defined by the
Description
This function acknowledges all the related alarms associated with a database object. Even if there
are no alarms on the object, the request goes to the Alarm server.
If some unacknowledged alarms are indeed associated with the object and if the client did an earlier
call to the alarm_enum_unack_objects function, the “ack” callback will be invoked once the Alarm
server has performed the acknowledgment operation.
If no unacknowledged alarm is associated with the object and if the client did an earlier call to the
alarm_enum_unack_objects function, the “ack” callback will be invoked with the
ALARM_W_NOUNACKFOUND status.
If an invalid object definition is specified, the request will be discarded and a message will be written
in the default application LOG.
Return Values
ALARM_S_NORMAL: The function completed normally and successfully.
ALARM_E_BADOBJ: Invalid object definition.
ALARM_E_SERVDOWN: The alarm server is not running.
See Also
alarm_store_acknowledgment
Syntax
status = alarm_acknowledge_ex( object_name, object_identifier,
ack_time, station, user_id, permission_key )
C Binding
#include "alarm.h"
extern SCF_STATUS AlarmAcknowledgeEx(
const char object_name_str[],
ALARM_64BIT_HANDLE object_identifier,
TIMEDATE_HABTIME ack_timetime,
const char station_str,
const char user_id,
const char permission_key );
Fortran Binding
INTEGER*4 ALARM_ACKNOWLEDGE_EX( CHARACTER*(*) OBJECT_DEF,
OBJ_ID OBJECT_IDENTIFIER,
TIMEDATE_HABTIME ACK_TIME,
CHARACTER*(*) STATION,
CHARACTER*(*) USER_ID,
CHARACTER*(*) PERMISSION_KEY )
Arguments
object_name
A character string identifying the object definition in the Alarm database. The maximum length of the
string is defined by the ALARM_OBJECT_NAME_MAXLEN constant.
object_identifier
A handle identifying an instance of the object definition. This handle is passed at the time the event is
posted.
station
A character string identifying the station where an operator executed the action that led to this
acknowledgment call. The maximum length of the string is defined by the
ALARM_STATION_NAME_MAXLEN constant. This argument is used for logging purposes only. A special
default name identified by the ALARM_DEFAULT_STATION can be used.
user_id
A character string that specifies either the OS user login ID or the subsystem permissions ID based on
how the system is configured.
permission_key
A character string that identifies the area under which the alarm is requested to be acknowledged.
An asterisk in this field will act as a wildcard and will acknowledge the alarm for all assigned
permission areas.
Description
This function acknowledges all the related alarms associated with a database object. Even if there
are no alarms on the object, the request goes to the Alarm server.
If some unacknowledged alarms are indeed associated with the object and if the client did an earlier
call to the alarm_enum_unack_objects_ex function, the “ack” callback will be invoked once the Alarm
server has performed the acknowledgment operation.
If no unacknowledged alarm is associated with the object and if the client did an earlier call to the
alarm_enum_unack_objects_ex function, the “ack” callback will be invoked with the
ALARM_W_NOUNACKFOUND status.
If an invalid object definition is specified, the request will be discarded and a message will be written
in the default application LOG.
This extended function should be used for events that are posted using the extended functions.
Return Values
ALARM_S_NORMAL: The function completed normally and successfully.
ALARM_E_BADOBJ: Invalid object definition.
ALARM_E_SERVDOWN: The alarm server is not running.
See Also
alarm_store_acknowledgment
alarm_store_acknowledgment_ex
alarm_acknowledge
Syntax
status = alarm_acknowledge_ex2( object_name, composite_id,
ack_time, user_id, permission_key )
C Binding
#include "alarm.h"
extern SCF_STATUS AlarmAcknowledgeEx2(
const char object_name_str[],
const char composite_id,
TIMEDATE_HABTIME ack_time,
USER_IDENTIFICATION user_id,
const char permission_key );
Fortran Binding
INTEGER*4 ALARM_ACKNOWLEDGE_EX2( CHARACTER*(*) OBJECT_DEF,
CHARACTER*(*) COMPOSITE_ID,
TIMEDATE_HABTIME ACK_TIME,
INTEGER*4 USER_ID,
CHARACTER*(*) PERMISSION_KEY )
Arguments
object_name
A character string identifying the object definition in the Alarm database. The maximum length of the
string is defined by the ALARM_OBJECT_NAME_MAXLEN constant.
composite_id
Represents a string identifying the object to acknowledge. This string is passed at the time the event
is posted. It could be either a composite id or an MRID.
ack_time
A TIMEDATE time indicating when the alarms on the object have been acknowledged. If a null value is
passed, the current time is assumed by the API.
permission_key
Represents a character string that identifies the area under which the alarm will be deleted.
Description
This function acknowledges all the related alarms associated with a database object. Even if there
are no alarms on the object, the request goes to the Alarm server.
If some unacknowledged alarms are indeed associated with the object and if the client did an earlier
call to the alarm_enum_unack_objects_ex2 function, the “ack” callback will be invoked once the
Alarm server has performed the acknowledgment operation.
If no unacknowledged alarm is associated with the object and if the client did an earlier call to the
alarm_enum_unack_objects_ex2 function, the “ack” callback will be invoked with the
ALARM_W_NOUNACKFOUND status.
If an invalid object definition is specified, the request will be discarded and a message will be written
in the default application LOG.
This extended function should be used for events that are posted using the extended functions.
Return Values
ALARM_S_NORMAL: The function completed normally and successfully.
ALARM_E_BADOBJ: Invalid object definition.
ALARM_E_SERVDOWN: The alarm server is not running.
See Also
alarm_store_acknowledgment
alarm_store_acknowledgment_ex
alarm_acknowledge
alarm_acknowledge_ex
Syntax
status = alarm_acknowledge_ex3( object_name, object_mrid,
object_comp_key, ack_time, user_id,
permission_key, application_name )
C Binding
#include "alarm.h"
extern SCF_STATUS AlarmAcknowledgeEx3(
const char object_name_str[],
AlarmMrid object_mrid[],
AlarmCompositeKey object_comp_key,
TIMEDATE_HABTIME ack_time,
USER_IDENTIFICATION user_id,
const char permission_key,
const char application_name_str[] );
Fortran Binding
None
Arguments
object_name
A character string identifying the object definition in the Alarm database. The maximum length of the
string is defined by the ALARM_OBJECT_NAME_MAXLEN constant.
object_mrid
Represents a string identifying the object to acknowledge. This string is passed at the time the event
is posted. The maximum length of the string is defined by the ALARM_MRID_MAXLEN constant. Either
object_mrid or object_comp_key must be provided.
ack_time
A TIMEDATE time indicating when the alarms on the object have been acknowledged. If a null value is
passed, the current time is assumed by the API.
user_id
This structure contains the user information for the event. This information includes the user name,
the PC name, and the station name. This is used for logging purposes only when filling in proxies in
the alarm text.
permission_key
Represents a character string that identifies the area under which the alarm will be deleted.
application_name
A character string identifying the application for the object definition in the Alarm database. The
maximum length of the string is defined by the ALARM_APPLICATION_NAME_MAXLEN constant. It is
only used by the Replay application.
Description
This function acknowledges all the related alarms associated with a database object. Even if there
are no alarms on the object, the request goes to the Alarm server.
If some unacknowledged alarms are indeed associated with the object and if the client did an earlier
call to the alarm_enum_unack_objects_ex3 function, the “ack” callback will be invoked once the
Alarm server has performed the acknowledgment operation.
If no unacknowledged alarm is associated with the object and if the client did an earlier call to the
alarm_enum_unack_objects_ex3 function, the “ack” callback will be invoked with the
ALARM_W_NOUNACKFOUND status.
If an invalid object definition is specified, the request will be discarded and a message will be written
in the default application LOG.
This extended function should be used for events that are posted using the extended functions.
Note: Acknowledge by composite key (object_comp_key) has not been implemented yet.
Return Values
ALARM_S_NORMAL: The function completed normally and successfully.
ALARM_E_BADOBJ: Invalid object definition.
ALARM_E_SERVDOWN: The alarm server is not running.
See Also
alarm_store_acknowledgment
alarm_store_acknowledgment_ex
alarm_store_acknowledgment_ex2
alarm_acknowledge
Syntax
status = alarm_category_exists( category_name)
C Binding
#include "alarm.h"
extern SCF_STATUS AlarmCategoryExists(
const char category_name_str[]);
Fortran Binding
INTEGER*4 FUNCTION ALARM_CATEGORY_EXISTS(
CHARACTER*(*) CATEGORY_NAME_STR)
Arguments
category_name
Name of the category needs to be checked.
Description
This function is provided to let clients of the Alarm verify if a specific category of the client(s) is known
by the Alarm server.
Return Values
ALARM_S_NORMAL: The function completed normally and successfully.
ALARM_W_INVALIDCAT: Category not defined in the Alarm database.
ALARM_E_STRLONG: Category name is too long.
See Also
alarm_location_exists
alarm_exception_exists
Syntax
alarm_delete( object_name, object_identifier, delete_time,
station, user_id, permission_key )
C Binding
#include "alarm.h"
extern SCF_STATUS AlarmDelete( const char object_name_str[],
ALARM_64BIT_HANDLE object_identifier,
TIMEDATE_HABTIME delete_time,
const char station_str,
const char user_id,
const char permission_key );
Fortran Binding
None
Arguments
object_name
A character string identifying the object definition in the Alarm database. The maximum length of the
string is defined by the ALARM_OBJECT_DEF_MAXLEN constant.
object_identifier
A handle identifying an instance of the object definition. This handle is passed at the time the event is
posted.
delete_time
A TIMEDATE time indicating when the alarms on the object have been acknowledged. If a null value is
passed, the current time is assumed by the API.
station
A character string identifying the station where an operator executed the action that led to this
acknowledgment call. The maximum length of the string is defined by the
user_id
A character string that specifies either the OS user login ID or the subsystem permissions ID based on
how the system is configured.
permission_key
A character string that identifies the area under which the alarm is requested to be deleted. An
asterisk in this field will act as a wildcard and will delete the alarm for all assigned permission areas.
Description
This function allows for the deletion of an alarm for the specified permission area. If the alarm has not
been previously acknowledged for this permission area or if the alarm does not contain the
permission area, then the purge operation will not be performed.
When the wildcard value is passed to this function, the alarm will be purged for all permission areas
that have been previously acknowledged.
Return Values
ALARM_S_NORMAL: The function completed normally and successfully.
ALARM_E_SERVDOWN: The alarm server is not running.
ALARM_E_BADOBJ: Invalid object definition.
See Also
alarm_delete
Syntax
alarm_delete_ex( object_name, object_identifier,
delete_time, user_id, permission_key )
C Binding
#include "alarm.h"
extern SCF_STATUS AlarmDeleteEx( const char object_name_str[],
const char composite_id,
TIMEDATE_HABTIME delete_time,
USER_IDENTIFICATION user_id,
const char permission_key );
Fortran Binding
None
Arguments
object_name
A character string identifying the object definition in the Alarm database. The maximum length of the
string is defined by the ALARM_OBJECT_DEF_MAXLEN constant.
composite_id
Represents a string identifying a particular instance of the object definition. This string is passed at
the time the event is posted. It could be either a composite id or an MRID.
delete_time
A TIMEDATE time indicating when the alarms on the object have been acknowledged. If a null value is
passed, the current time is assumed by the API.
user_id
This structure contains the user information for the event. This information includes the user name,
the PC name, and the station name. This is used for logging purposes only when filling in proxies in
the alarm text.
Description
This function allows for the deletion of an alarm that has been acknowledged by all users who have
permissions to the alarm. If five users have write access to a particular alarm and if each user
acknowledges the alarm, then the alarm will be deleted.
Prior to deletion, each alarm that is acknowledged by a single user is considered partially deleted and
each acknowledgment per user will be logged. Once the alarm has been acknowledged for all areas,
it will be considered deleted and removed from the alarm list.
Return Values
ALARM_S_NORMAL: The function completed normally and successfully.
ALARM_E_SERVDOWN: The alarm server is not running.
ALARM_E_BADOBJ: Invalid object definition.
See Also
alarm_delete
Syntax
alarm_delete_ex2( object_name, object_mrid,
object_comp_key, delete_time, user_id,
permission_key, application_name)
C Binding
#include "alarm.h"
extern SCF_STATUS AlarmDeleteEx2(
const char object_name_str[],
AlarmMrid object_mrid,
AlarmCompositeKey object_comp_key,
TIMEDATE_HABTIME delete_time,
USER_IDENTIFICATION user_id,
const char permission_key_str[],
const char application_name_str[] );
Fortran Binding
None
Arguments
object_name
A character string identifying the object definition in the Alarm database. The maximum length of the
string is defined by the ALARM_OBJECT_DEF_MAXLEN constant.
object_mrid
Represents a string identifying the object to acknowledge. This string is passed at the time the event
is posted. The maximum length of the string is defined by the ALARM_MRID_MAXLEN constant. Either
object_mrid or object_comp_key must be provided.
delete_time
A TIMEDATE time indicating when the alarms on the object have been acknowledged. If a null value is
passed, the current time is assumed by the API.
user_id
This structure contains the user information for the event. This information includes the user name,
the PC name, and the station name. This is used for logging purposes only when filling in proxies in
the alarm text.
permission_key
Represents a character string that identifies the area under which the alarm will be deleted.
application_name
A character string identifying the application for the object definition in the Alarm database. The
maximum length of the string is defined by the ALARM_APPLICATION_NAME_MAXLEN constant. It is
only used by the Replay application.
Description
This function allows for the deletion of an alarm that has been acknowledged by all users who have
permissions to the alarm. If five users have write access to a particular alarm and if each user
acknowledges the alarm, then the alarm will be deleted.
Prior to deletion, each alarm that is acknowledged by a single user is considered partially deleted and
each acknowledgment per user will be logged. Once the alarm has been acknowledged for all areas,
it will be considered deleted and removed from the alarm list.
Note: Delete by composite key (object_comp_key) has not been implemented yet.
Return Values
ALARM_S_NORMAL: The function completed normally and successfully.
ALARM_E_SERVDOWN: The alarm server is not running.
ALARM_E_BADOBJ: Invalid object definition.
See Also
alarm_delete
alarm_delete_ex
Syntax
alarm_dump_history( output_file )
C Binding
#include "alarm.h"
extern void AlarmDumpHistory(FILE * output_file_ptr);
Fortran Binding
ALARM_DUMP_HISTORY()
Arguments
output_file
Identifies where the output text is to be written. A value of zero is taken to mean that output should
be directed to standard output.
Description
This function formats and writes the history list maintained by the Alarm API to an output file.
This function may be invoked even before calling the AlarmRegisterClient function.
Return Value
None
Syntax
status = alarm_enum_unack_objects( ack_cb, userarg )
C Binding
#include "alarm.h"
extern SCF_STATUS AlarmEnumUnackObjects(
ALARM_ACK_CB ack_cb,
CCA_USERARG userarg );
Fortran Binding
INTEGER*4 ALARM_ENUM_UNACK_OBJECTS(
INTEGER*4 ACK_CB,
INTEGER*4 USERARG )
Arguments
ack_cb
Specifies the address of the enumeration callback function. This function has the following prototype:
typedef void (*ALARM_ACK_CB)(
SCF_STATUS status,
ALARM_ACK_STATE state,
const char object_type_str[],
CCA_HANDLE object_handle,
TIMEDATE_HABTIME ack_time,
CCA_USERARG userarg );
In Fortran, the callback should be declared as follows:
SUBROUTINE ACK_CB(INTEGER*4 STATUS,
INTEGER*4 STATE,
CHARACTER*(*) OBJECT_TYPE,
INTEGER*4 OBJECT_HANDLE,
INTEGER*4 ACK_TIME,
INTEGER*4 USERARG )
Where:
• status: One of the following values:
– ALARM_S_MORE: There are more callbacks to come.
userarg
Value that will be passed as an argument to the function invoked for the registration completion.
Description
This function queries the Alarm server for all the unack objects kept in the Alarm database for the
application the caller is running under. It can be called any time after the client registration callback
has been invoked.
This function is provided for clients that are maintaining a list of unacknowledged objects (such as the
exception list used by Scada). Calling this function implies that the client wants to be notified about
the unacknowledged state of the objects the client manages. The provided callback will be
subsequently used to notify the caller about any change of state (ack vs. unack) of any of the objects
of the caller’s application.
If this function is used, it should be called every time the “ready” callback is invoked, since it probably
indicates that a failover occurred.
The callback function will be invoked as a different PPM event because the Alarm server must be
queried.
7
It is assumed that the number of object definitions for a given application is small enough (13 for Scada in
EMP 1.5) that it is acceptable for the user to rely on string comparisons when processing an ACK/UNACK
notification.
See Also
alarm_register_client
alarm_enum_unack_objects_ex
alarm_enum_unack_objects_ex2
alarm_enum_unack_objects_ex3
alarm_enum_unack_objects_ex4
alarm_enum_unack_objects_ex5
Syntax
status = alarm_enum_unack_objects_ex( ack_cb, userarg )
C Binding
#include "alarm.h"
extern SCF_STATUS AlarmEnumUnackObjectsEx(
ALARM_ACK_CB_EX ack_cb,
CCA_USERARG userarg );
Fortran Binding
INTEGER*4 ALARM_ENUM_UNACK_OBJECTS_EX(
INTEGER*4 ACK_CB,
INTEGER*4 USERARG )
Arguments
ack_cb
Specifies the address of the enumeration callback function. This function has the following prototype:
typedef void (*ALARM_ACK_CB_EX)(
SCF_STATUS status,
ACK_INFO_BLOCK ack_info,
CCA_USERARG userarg );
In Fortran, the callback should be declared as follows:
SUBROUTINE ACK_CB_EX( INTEGER*4 STATUS,
INTEGER*4 ACK_INFO,
INTEGER*4 USERARG )
Where:
• status: One of the following values:
– ALARM_S_MORE: There are more callbacks to come.
– ALARM_S_DONE: The enumeration has been completed. When this status is passed, the
other arguments are meaningless (blank or null). This status indicates the end of the
enumeration or that there are no unack objects for the application.
– ALARM_S_NORMAL: Subsequent updates.
Description
This function queries the Alarm server for all the unack objects kept in the Alarm database for the
application the caller is running under. It can be called any time after the client registration callback
has been invoked.
This function is provided for clients that are maintaining a list of unacknowledged objects (such as the
exception list used by Scada). Calling this function implies that the client wants to be notified about
the unacknowledged state of the objects the client manages. The provided callback will be
subsequently used to notify the caller about any change of state (ack vs. unack) of any of the objects
of the caller’s application.
If this function is used, it should be called every time the “ready” callback is invoked, since it probably
indicates that a failover occurred.
The callback function will be invoked as a different PPM event since the Alarm server must be queried.
The extended functionality allows for the use of 64-bit object handle names inside the acknowledge
callback. The original function only allowed 32-bit object handle names and therefore will not allow
e-terramodeler OID object handles to be attached to the event. The extended function is added for
this purpose.
Return Values
• ALARM_S_NORMAL: The query went to the Alarm server.
• ALARM_E_SERVDOWN: The Alarm server is not running.
• ALARM_E_NOCOMMS: No connection with the Alarm server.
See Also
alarm_enum_unack_objects
alarm_enum_unack_objects_ex2
alarm_enum_unack_objects_ex3
alarm_enum_unack_objects_ex4
alarm_enum_unack_objects_ex5
Syntax
status = alarm_enum_unack_objects_ex2( ack_cb, userarg )
C Binding
#include "alarm.h"
extern SCF_STATUS AlarmEnumUnackObjectsEx2(
ALARM_ACK_CB_EX2 ack_cb,
CCA_USERARG userarg );
Fortran Binding
INTEGER*4 ALARM_ENUM_UNACK_OBJECTS_EX2(
INTEGER*4 ACK_CB,
INTEGER*4 USERARG )
Arguments
ack_cb
Specifies the address of the enumeration callback function. This function has the following prototype:
typedef void (*ALARM_ACK_CB_EX2)(
SCF_STATUS status,
ACK_INFO_BLOCK2 ack_info,
CCA_USERARG userarg );
In Fortran, the callback should be declared as follows:
SUBROUTINE ACK_CB_EX2( INTEGER*4 STATUS,
INTEGER*4 ACK_INFO,
INTEGER*4 USERARG )
Where:
• status: One of the following values:
– ALARM_S_MORE: There are more callbacks to come.
– ALARM_S_DONE: The enumeration has been completed. When this status is passed, the
other arguments are meaningless (blank or null). This status indicates the end of the
enumeration or that there are no unack objects for the application.
– ALARM_S_NORMAL: Subsequent updates.
TYPE ACK_INFO_BLOCK2
INTEGER*4 STATE
CHARACTER*8 OBJECT_TYPE_STR
CHARACTER*6 RECORD_NAME_STR
CHARACTER*8 DATABASE_NAME_STR
INTEGER*4 OBJECT_HANDLE
TYPE (OBJ_ID) OBJECT_IDENTIFIER
TYPE (OBJ_ID) GROUP_IDENTIFIER
CHARACTER*56 COMPOSITE_ID
INTEGER*4 ACK_TIME
CHARACTER*8 AREA1_STR
INTEGER*4 AREA1_HANDLE
CHARACTER*8 AREA2_STR
INTEGER*4 AREA2_HANDLE
userarg
Value that will be passed as an argument to the function invoked for the registration completion.
Description
This function queries the Alarm server for all the unack objects kept in the Alarm database for the
application the caller is running under. It can be called any time after the client registration callback
has been invoked.
This function is provided for clients that are maintaining a list of unacknowledged objects (such as the
exception list used by Scada). Calling this function implies that the client wants to be notified about
the unacknowledged state of the objects the client manages. The provided callback will be
subsequently used to notify the caller about any change of state (ack vs. unack) of any of the objects
of the caller’s application.
If this function is used, it should be called every time the “ready” callback is invoked, since it probably
indicates that a failover occurred.
The callback function will be invoked as a different PPM event since the Alarm server must be queried.
The extended functionality allows for the use of the composite ID to associate related alarms to one
another. The composite ID is a string value that is generated in Hdb.
Return Values
• ALARM_S_NORMAL: The query went to the Alarm server.
• ALARM_E_SERVDOWN: The Alarm server is not running.
• ALARM_E_NOCOMMS: No connection with the Alarm server.
See Also
alarm_enum_unack_objects
alarm_enum_unack_objects_ex
alarm_enum_unack_objects_ex3
alarm_enum_unack_objects_ex4
alarm_enum_unack_objects_ex5
Syntax
status = alarm_enum_unack_objects_ex3( ack_cb, userarg )
C Binding
#include "alarm.h"
extern SCF_STATUS AlarmEnumUnackObjectsEx3(
ALARM_ACK_CB_EX3 ack_cb,
CCA_USERARG userarg);
Fortran Binding
There is no Fortran binding for this function.
Arguments
ack_cb
Specifies the address of the enumeration callback function. This function has the following prototype:
typedef void (*ALARM_ACK_CB_EX3)(
SCF_STATUS status,
ACK_INFO_BLOCK3 ack_info,
CCA_USERARG userarg);
Where:
• status: One of the following values:
– ALARM_S_MORE: There are more callbacks to come.
– ALARM_S_DONE: The enumeration has been completed. When this status is passed, the
other arguments are meaningless (blank or null). This status indicates the end of the
enumeration or that there are no unack objects for the application.
– ALARM_S_NORMAL: Subsequent updates.
– ALARM_E_NOCOMMS: The communication link with the Alarm server has been lost during the
download of the unacknowledged objects. This implies that the download could not be
completed. When the link is formed again, the ready callback will be invoked and the user
should call the alarm_enum_unack_objects_ex3 again.
– ALARM_W_NOUNACKFOUND: A call to the alarm_acknowledge_ex3 function was made for
an object that had no associated unacknowledged alarm at the time the request reached the
Alarm server. This call may have been valid at the time of the call, but the alarms on the
typedef struct
{
ALARM_ACK_STATE state;
char object_type_str[ALARM_OBJECT_NAME_MAXLEN + 1];
char record_name_str[ALARM_RECORD_NAME_MAXLEN + 1];
char database_name_str[ALARM_DATABASE_NAME_MAXLEN + 1];
CCA_HANDLE object_handle;
ALARM_64BIT_HANDLE object_identifier;
ALARM_64BIT_HANDLE group_identifier;
char composite_id[ ALARM_COMPOSITE_ID_MAXLEN + 1];
TIMEDATE_HABTIME ack_time;
char area1_str[ ALARM_PERMISSION_KEY_MAXLEN + 1];
CCA_HANDLE area1_handle;
char area2_str[ ALARM_PERMISSION_KEY_MAXLEN + 1];
CCA_HANDLE area2_handle;
char area3_str[ ALARM_PERMISSION_KEY_MAXLEN + 1];
CCA_HANDLE area3_handle;
char area4_str[ ALARM_PERMISSION_KEY_MAXLEN + 1];
CCA_HANDLE area4_handle;
char area5_str[ ALARM_PERMISSION_KEY_MAXLEN + 1];
CCA_HANDLE area5_handle;
CCA_BOOL inhibit_alarm;
char station_name_str[ ALARM_STATION_NAME_MAXLEN + 1];
} ACK_INFO_BLOCK3;
• userarg: Specifies the user data to be passed to the enumeration callback when it is invoked.
userarg
Value that will be passed as an argument to the function invoked for the registration completion.
Description
This function queries the Alarm server for all the unack objects kept in the Alarm database for the
application the caller is running under. It can be called any time after the client registration callback
has been invoked.
This function is provided for clients that are maintaining a list of unacknowledged objects (such as the
exception list used by Scada). Calling this function implies that the client wants to be notified about
the unacknowledged state of the objects the client manages. The provided callback will be
subsequently used to notify the caller about any change of state (ack vs. unack) of any of the objects
of the caller’s application.
If this function is used, it should be called every time the “ready” callback is invoked, since it probably
indicates that a failover occurred.
The callback function will be invoked as a different PPM event since the Alarm server must be queried.
The extended functionality is used to notify the client to inhibit alarms.
See Also
alarm_enum_unack_objects
alarm_enum_unack_objects_ex
alarm_enum_unack_objects_ex2
alarm_enum_unack_objects_ex4
alarm_enum_unack_objects_ex5
Syntax
status = alarm_enum_unack_objects_ex4( ack_cb, userarg )
C Binding
#include "alarm.h"
extern SCF_STATUS AlarmEnumUnackObjectsEx4(
ALARM_ACK_CB_EX4 ack_cb,
CCA_USERARG userarg);
Fortran Binding
There is no Fortran binding for this function.
Arguments
ack_cb
Specifies the address of the enumeration callback function. This function has the following prototype:
typedef void (*ALARM_ACK_CB_EX4)(
SCF_STATUS status,
ACK_INFO_BLOCK4 ack_info,
CCA_USERARG userarg);
Where:
• status: One of the following values:
– ALARM_S_MORE: There are more callbacks to come.
– ALARM_S_DONE: The enumeration has been completed. When this status is passed, the
other arguments are meaningless (blank or null). This status indicates the end of the
enumeration or that there are no unack objects for the application.
– ALARM_S_NORMAL: Subsequent updates.
– ALARM_E_NOCOMMS: The communication link with the Alarm server has been lost during the
download of the unacknowledged objects. This implies that the download could not be
completed. When the link is formed again, the ready callback will be invoked and the user
should call the alarm_enum_unack_objects_ex4 again.
– ALARM_W_NOUNACKFOUND: A call to the alarm_acknowledge_ex4 function was made for
an object that had no associated unacknowledged alarm at the time the request reached the
Alarm server. This call may have been valid at the time of the call, but the alarms on the
typedef struct
{
ALARM_ACK_STATE state;
char object_type_str[ALARM_OBJECT_NAME_MAXLEN + 1];
char record_name_str[ALARM_RECORD_NAME_MAXLEN + 1];
char database_name_str[ALARM_DATABASE_NAME_MAXLEN + 1];
CCA_HANDLE object_handle;
ALARM_64BIT_HANDLE object_identifier;
ALARM_64BIT_HANDLE group_identifier;
char composite_id[ ALARM_COMPOSITE_ID_MAXLEN + 1];
TIMEDATE_HABTIME ack_time;
char area1_str[ ALARM_PERMISSION_KEY_MAXLEN + 1];
CCA_HANDLE area1_handle;
char area2_str[ ALARM_PERMISSION_KEY_MAXLEN + 1];
CCA_HANDLE area2_handle;
char area3_str[ ALARM_PERMISSION_KEY_MAXLEN + 1];
CCA_HANDLE area3_handle;
char area4_str[ ALARM_PERMISSION_KEY_MAXLEN + 1];
CCA_HANDLE area4_handle;
char area5_str[ ALARM_PERMISSION_KEY_MAXLEN + 1];
CCA_HANDLE area5_handle;
CCA_BOOL inhibit_alarm;
char station_name_str[ ALARM_STATION_NAME_MAXLEN + 1];
AlarmMrid object_mrid;
AlarmCompositeKey object_comp_key;
} ACK_INFO_BLOCK4;
• userarg: Specifies the user data to be passed to the enumeration callback when it is invoked.
userarg
Value that will be passed as an argument to the function invoked for the registration completion.
Description
This function queries the Alarm server for all the unack objects kept in the Alarm database for the
application the caller is running under. It can be called any time after the client registration callback
has been invoked.
This function is provided for clients that are maintaining a list of unacknowledged objects (such as the
exception list used by Scada). Calling this function implies that the client wants to be notified about
the unacknowledged state of the objects the client manages. The provided callback will be
subsequently used to notify the caller about any change of state (ack vs. unack) of any of the objects
of the caller’s application.
If this function is used, it should be called every time the “ready” callback is invoked, since it probably
indicates that a failover occurred.
The callback function will be invoked as a different PPM event since the Alarm server must be queried.
Return Values
• ALARM_S_NORMAL: The query went to the Alarm server.
• ALARM_E_SERVDOWN: The Alarm server is not running.
• ALARM_E_NOCOMMS: No connection with the Alarm server.
See Also
alarm_enum_unack_objects
alarm_enum_unack_objects_ex
alarm_enum_unack_objects_ex2
alarm_enum_unack_objects_ex3
alarm_enum_unack_objects_ex5
Syntax
status = alarm_enum_unack_objects_ex5( ack_cb, userarg )
C Binding
#include "alarm.h"
extern SCF_STATUS AlarmEnumUnackObjectsEx5(
ALARM_ACK_CB_EX5 ack_cb,
CCA_USERARG userarg);
Fortran Binding
There is no Fortran binding for this function.
Arguments
ack_cb
Specifies the address of the enumeration callback function. This function has the following prototype:
typedef void (*ALARM_ACK_CB_EX5)(
SCF_STATUS status,
ACK_INFO_BLOCK5 ack_info,
CCA_USERARG userarg);
Where:
• status: One of the following values:
– ALARM_S_MORE: There are more callbacks to come.
– ALARM_S_DONE: The enumeration has been completed. When this status is passed, the
other arguments are meaningless (blank or null). This status indicates the end of the
enumeration or that there are no unack objects for the application.
– ALARM_S_NORMAL: Subsequent updates.
– ALARM_E_NOCOMMS: The communication link with the Alarm server has been lost during the
download of the unacknowledged objects. This implies that the download could not be
completed. When the link is formed again, the ready callback will be invoked and the user
should call the alarm_enum_unack_objects_ex5 again.
– ALARM_W_NOUNACKFOUND: A call to the alarm_acknowledge_ex4 function was made for
an object that had no associated unacknowledged alarm at the time the request reached the
Alarm server. This call may have been valid at the time of the call, but the alarms on the
typedef struct
{
ALARM_ACK_STATE state;
char object_type_str[ALARM_OBJECT_NAME_MAXLEN + 1];
char record_name_str[ALARM_RECORD_NAME_MAXLEN + 1];
char database_name_str[ALARM_DATABASE_NAME_MAXLEN + 1];
CCA_HANDLE object_handle;
ALARM_64BIT_HANDLE object_identifier;
ALARM_64BIT_HANDLE group_identifier;
char composite_id[ ALARM_COMPOSITE_ID_MAXLEN + 1];
TIMEDATE_HABTIME ack_time;
char area1_str[ ALARM_PERMISSION_KEY_MAXLEN + 1];
CCA_HANDLE area1_handle;
char area2_str[ ALARM_PERMISSION_KEY_MAXLEN + 1];
CCA_HANDLE area2_handle;
char area3_str[ ALARM_PERMISSION_KEY_MAXLEN + 1];
CCA_HANDLE area3_handle;
char area4_str[ ALARM_PERMISSION_KEY_MAXLEN + 1];
CCA_HANDLE area4_handle;
char area5_str[ ALARM_PERMISSION_KEY_MAXLEN + 1];
CCA_HANDLE area5_handle;
CCA_BOOL inhibit_alarm;
char station_name_str[ ALARM_STATION_NAME_MAXLEN + 1];
char user_id_str[ ALARM_USER_ID_MAXLEN + 1];
char computer_name_str[ ALARM_COMPUTER_MAXLEN + 1];
AlarmMrid object_mrid;
AlarmCompositeKey object_comp_key;
} ACK_INFO_BLOCK5;
• userarg: Specifies the user data to be passed to the enumeration callback when it is invoked.
userarg
Value that will be passed as an argument to the function invoked for the registration completion.
Description
This function queries the Alarm server for all the unack objects kept in the Alarm database for the
application the caller is running under. It can be called any time after the client registration callback
has been invoked.
This function is provided for clients that are maintaining a list of unacknowledged objects (such as the
exception list used by Scada). Calling this function implies that the client wants to be notified about
the unacknowledged state of the objects the client manages. The provided callback will be
subsequently used to notify the caller about any change of state (ack vs. unack) of any of the objects
of the caller’s application.
If this function is used, it should be called every time the “ready” callback is invoked, since it probably
indicates that a failover occurred.
Return Values
• ALARM_S_NORMAL: The query went to the Alarm server.
• ALARM_E_SERVDOWN: The Alarm server is not running.
• ALARM_E_NOCOMMS: No connection with the Alarm server.
See Also
alarm_enum_unack_objects
alarm_enum_unack_objects_ex
alarm_enum_unack_objects_ex2
alarm_enum_unack_objects_ex3
alarm_enum_unack_objects_ex4
Syntax
status = alarm_enum_ack_objects( ack_cb, userarg )
C Binding
#include "alarm.h"
extern SCF_STATUS AlarmEnumAckObjects(
ALARM_ENUM_ACK_CB ack_cb,
CCA_USERARG userarg );
Fortran Binding
There is no Fortran binding for this function.
Arguments
ack_cb
Specifies the address of the enumeration callback function. This function has the following prototype:
typedef void (*ALARM_ENUM_ACK_CB)(
SCF_STATUS status,
ACK_INFO_BLOCK3 ack_info,
CCA_USERARG userarg );
Where:
• status: One of the following values:
– ALARM_S_MORE: There are more callbacks to come.
– ALARM_S_DONE: The enumeration has been completed. When this status is passed, the
other arguments are meaningless (blank or null). This status indicates the end of the
enumeration or that there are no ack objects for the application.
– ALARM_S_NORMAL: Subsequent updates.
– ALARM_E_NOCOMMS: The communication link with the Alarm server has been lost during the
download of the acknowledged objects. This implies that the download could not be
completed. When the link is formed again, the ready callback will be invoked and the user
should call the alarm_enum_ack_objects again.
• ack_info: Contains the information required for the acknowledge callback.
– C structure definition for ack_info callback:
userarg
Value that will be passed as an argument to the function invoked for the registration completion.
Description
This function queries the Alarm server for all the ack objects kept in the Alarm database for the
application the caller is running under. It can be called any time after the client registration callback
has been invoked.
This function is provided for clients that are maintaining a list of acknowledged objects. Calling this
function implies that the client wants to be notified about the acknowledged state of the objects the
client manages. The provided callback will be subsequently used to notify the caller about any
change of state (ack vs. unack) of any of the objects of the caller’s application.
If this function is used, it should be called every time the “ready” callback is invoked, since it probably
indicates that a failover occurred.
The callback function will be invoked as a different PPM event because the Alarm server must be
queried.
Return Values
• ALARM_S_NORMAL: The query went to the Alarm server.
• ALARM_E_SERVDOWN: The Alarm server is not running.
• ALARM_E_NOCOMMS: No connection with the Alarm server.
See Also
alarm_register_client
Syntax
status = alarm_enum_ack_objects_ex( ack_cb, userarg )
C Binding
#include "alarm.h"
extern SCF_STATUS AlarmEnumAckObjectsEx(
ALARM_ACK_CB_EX4 ack_cb,
CCA_USERARG userarg );
Fortran Binding
There is no Fortran binding for this function.
Arguments
ack_cb
Specifies the address of the enumeration callback function. This function has the following prototype:
typedef void (*ALARM_ACK_CB_EX4)(
SCF_STATUS status,
ACK_INFO_BLOCK4 ack_info,
CCA_USERARG userarg );
Where:
• status: One of the following values:
– ALARM_S_MORE: There are more callbacks to come.
– ALARM_S_DONE: The enumeration has been completed. When this status is passed, the
other arguments are meaningless (blank or null). This status indicates the end of the
enumeration or that there are no ack objects for the application.
– ALARM_S_NORMAL: Subsequent updates.
– ALARM_E_NOCOMMS: The communication link with the Alarm server has been lost during the
download of the acknowledged objects. This implies that the download could not be
completed. When the link is formed again, the ready callback will be invoked and the user
should call the alarm_enum_ack_objects_ex again.
• ack_info: Contains the information required for the acknowledge callback.
– C structure definition for ack_info callback:
userarg
Value that will be passed as an argument to the function invoked for the registration completion.
Description
This function queries the Alarm server for all the ack objects kept in the Alarm database for the
application the caller is running under. It can be called any time after the client registration callback
has been invoked.
This function is provided for clients that are maintaining a list of acknowledged objects. Calling this
function implies that the client wants to be notified about the acknowledged state of the objects the
client manages. The provided callback will be subsequently used to notify the caller about any
change of state (ack vs. unack) of any of the objects of the caller’s application.
If this function is used, it should be called every time the “ready” callback is invoked, since it probably
indicates that a failover occurred.
The callback function will be invoked as a different PPM event because the Alarm server must be
queried.
The extended functionality allows for the use of the MRID and Full Composite Key.
Return Values
• ALARM_S_NORMAL: The query went to the Alarm server.
• ALARM_E_SERVDOWN: The Alarm server is not running.
• ALARM_E_NOCOMMS: No connection with the Alarm server.
Syntax
status = alarm_enum_ack_objects_ex2( ack_cb, userarg )
C Binding
#include "alarm.h"
extern SCF_STATUS AlarmEnumAckObjectsEx2(
ALARM_ACK_CB_EX5 ack_cb,
CCA_USERARG userarg );
Fortran Binding
There is no Fortran binding for this function.
Arguments
ack_cb
Specifies the address of the enumeration callback function. This function has the following prototype:
typedef void (*ALARM_ACK_CB_EX5)(
SCF_STATUS status,
ACK_INFO_BLOCK5 ack_info,
CCA_USERARG userarg );
Where:
• status: One of the following values:
– ALARM_S_MORE: There are more callbacks to come.
– ALARM_S_DONE: The enumeration has been completed. When this status is passed, the
other arguments are meaningless (blank or null). This status indicates the end of the
enumeration or that there are no ack objects for the application.
– ALARM_S_NORMAL: Subsequent updates.
– ALARM_E_NOCOMMS: The communication link with the Alarm server has been lost during the
download of the acknowledged objects. This implies that the download could not be
completed. When the link is formed again, the ready callback will be invoked and the user
should call the alarm_enum_ack_objects_ex2 again.
• ack_info: Contains the information required for the acknowledge callback.
– C structure definition for ack_info callback:
userarg
Value that will be passed as an argument to the function invoked for the registration completion.
Description
This function queries the Alarm server for all the ack objects kept in the Alarm database for the
application the caller is running under. It can be called any time after the client registration callback
has been invoked.
This function is provided for clients that are maintaining a list of acknowledged objects. Calling this
function implies that the client wants to be notified about the acknowledged state of the objects the
client manages. The provided callback will be subsequently used to notify the caller about any
change of state (ack vs. unack) of any of the objects of the caller’s application.
If this function is used, it should be called every time the “ready” callback is invoked, since it probably
indicates that a failover occurred.
The callback function will be invoked as a different PPM event because the Alarm server must be
queried.
The extended functionality allows for the use of the MRID and Full Composite Key.
Return Values
• ALARM_S_NORMAL: The query went to the Alarm server.
• ALARM_E_SERVDOWN: The Alarm server is not running.
See Also
alarm_register_client
alarm_enum_ack_objects
alarm_enum_ack_objects_ex
Syntax
status = alarm_exception_exists( exception_name)
C Binding
#include "alarm.h"
extern SCF_STATUS AlarmExceptionExists(
const char exception_name_str[]);
Fortran Binding
INTEGER*4 FUNCTION ALARM_EXCEPTION_EXISTS(
CHARACTER*(*) EXCEPTION_NAME_STR)
Arguments
exception_name
Name of the exception definition needs to be checked.
Description
This function is provided to let clients of the Alarm verify if a specific exception definition of the
client(s) is known by the Alarm server.
Return Values
ALARM_S_NORMAL: The function completed normally and successfully.
ALARM_W_INVALIDEXC: Exception not defined in the Alarm database.
ALARM_E_STRLONG: Exception definition name is too long.
See Also
alarm_location_exists
alarm_category_exists
Syntax
status = alarm_flush_acknowledgments()
C Binding
#include "alarm.h"
extern SCF_STATUS AlarmFlushAcknowledgments();
Fortran Binding
INTEGER*4 ALARM_FLUSH_ACKNOWLEDGMENTS()
Arguments
None
Description
This function sends the buffer built by earlier calls to the alarm_store_acknowledgment function to
the Alarm server.
If the communication path with the Alarm server is not up, the requests in the buffer will not be sent
until a communication path is re-established.
Return Values
ALARM_S_NORMAL: The function completed normally and successfully.
ALARM_E_SERVDOWN: The alarm server is not running.
See Also
alarm_store_acknowledgment
alarm_acknowledge
Syntax
status = alarm_flush_events( )
C Binding
#include "alarm.h"
extern SCF_STATUS AlarmFlushEvents()
Fortran Binding
INTEGER*4 ALARM_FLUSH_EVENTS()
Arguments
None
Description
This function sends the buffer built by earlier calls to the alarm_store_event function to the Alarm
server. Calling this function when the buffer is empty is allowed and is a no-op.
If the client is using Hdb High Availability for replicating the events with the database objects
changes, this function can only be called from within an Hdb update transaction that is issuing an
Hdbwrite (an Hdb transaction with no related Hdbwrite will cause an abort in the MRS API).
If the communication path with the Alarm server is not up, the events in the buffer will not be
processed until a communication path is re-established.
Return Values
ALARM_S_NORMAL: The function completed normally and successfully.
ALARM_E_SERVDOWN: The alarm server is not running.
See Also
alarm_post_event
Syntax
status = alarm_get_event( event_cb, event_mrid, userarg )
C Binding
#include "alarm.h"
extern SCF_STATUS AlarmGetEvent( ALARM_GETEVENT_CALLBACK event_cb,
AlarmMRID event_mrid,
CCA_USERARG userarg );
Fortran Binding
None
Arguments
event_cb
A callback function that is executed when the information for the event is returned.
typedef void ( *ALARM_GETEVENT_CALLBACK ) (
ALARM_SUBSCRIBE_EVENT_BLOCK_EX *event_ptr,
CCA_USERARG userarg );
Where:
• event_ptr: Contains the information for the event required.
• ALARM_SUBSCRIBE_EVENT_BLOCK_EX structure is as follows:
See the description for the alarm_subscribe_ex function.
event_mrid
Represents a string identifying the required event. The maximum length of the string is defined by the
ALARM_MRID_MAXLEN constant.
userarg
Value that will be passed as an argument to the function invoked for the registration completion.
Description
This function returns information about the required event, which is found in the alarm list or any
formatted log. All items in the return structure of ALARM_SUBSCRIBE_EVENT_BLOCK_EX will be empty
or 0 if the event is not found.
Syntax
status = alarm_get_event_ex( event_cb, event_mrid, userarg )
C Binding
#include "alarm.h"
extern SCF_STATUS AlarmGetEventEx( ALARM_GETEVENT_CALLBACK_EX event_cb,
AlarmMRID event_mrid,
CCA_USERARG userarg );
Fortran Binding
None
Arguments
event_cb
A callback function that is executed when the information for the event is returned.
typedef void ( *ALARM_GETEVENT_CALLBACK_EX ) (
ALARM_SUBSCRIBE_EVENT_BLOCK_EX2 *event_ptr,
CCA_USERARG userarg );
Where:
• event_ptr: Contains the information about the required event.
• ALARM_SUBSCRIBE_EVENT_BLOCK_EX2
See the description for the alarm_subscribe_ex2 function.
event_mrid
Represents a string identifying the required event. The maximum length of the string is defined by the
ALARM_MRID_MAXLEN constant.
userarg
Value that will be passed as an argument to the function invoked for the registration completion.
Description
This function returns information about the required event, which is found in the alarm list or any
formatted log. All items in the return structure of ALARM_SUBSCRIBE_EVENT_BLOCK_EX2 will be
empty or 0 if the event is not found.
Syntax
status = alarm_location_exists( location_name)
C Binding
#include "alarm.h"
extern SCF_STATUS AlarmLocationExists(
const char location_name_str[]);
Fortran Binding
INTEGER*4 FUNCTION ALARM_LOCATION_EXISTS(
CHARACTER*(*) LOCATION_NAME_STR)
Arguments
location_name
Name of the location needs to be checked.
Description
This function is provided to let clients of the Alarm verify if a specific location name of the client(s) is
known by the Alarm server.
Return Values
ALARM_S_NORMAL: The function completed normally and successfully.
ALARM_W_INVALIDLOC: Location not defined in the Alarm database.
ALARM_E_STRLONG: Location name is too long.
See Also
alarm_category_exists
alarm_exception_exists
Syntax
status = alarm_post_event ( event_block, version )
C Binding
#include "alarm.h"
extern SCF_STATUS AlarmPostEvent(
ALARM_EVENT_BLOCK *event_block_ptr,
int version );
Fortran Binding
INTEGER*4 ALARM_POST_EVENT( INTEGER*4 EVENT_BLOCK,
INTEGER*4 VERSION )
Arguments
event_block
The event description that uses the following typedef:
typedef struct
{
/*
** Name of the exception definition in the ALARM database associated
** with the database object which is the subject of the event. May not
** be specified if the handle is provided.
*/
char exception_name_str[ ALARM_EXCEPTION_NAME_MAXLEN + 1];
/*
** Handle for the exception previously obtained through a call to
** the AlarmRegisterException() function. If the handle if specified
** the exception name field is not used.
*/
ALARM_EXCEPTION_HANDLE exception_handle;
/*
** A handle that identifies the instance of the object definition
** associated with the event. This handle will be returned to the user
** as an argument of the ack callback.
** A null handle is valid and implicitly implies that there is only
** one object for the associated object definition.
*/
CCA_HANDLE object_handle;
/*
** Name of the category in the ALARM database associated with the
** database object which is the subject of the event. It does not
** need to be specified if the handle is provided.
*/
char category_name_str[ ALARM_CATEGORY_NAME_MAXLEN + 1 ];
/*
** Handle for the category previously obtained through a call to
** the AlarmRegisterCategory() function. If the handle if specified
** the category name field is not used.
*/
ALARM_CATEGORY_HANDLE category_handle;
/*
** Name of the location associated with the database object which
** is the subject of the event. It does not need to be specified
** if the handle is provided.
*/
char location_name_str[ ALARM_LOCATION_NAME_MAXLEN + 1 ];
/*
** Handle for the location previously obtained through a call to
** the AlarmRegisterLocation() function. If the handle if specified
** the location name field is not used.
*/
ALARM_LOCATION_HANDLE location_handle;
/*
** The permission key (a PERMIT area) attached to the event.
*/
char permission_key[ ALARM_PERMISSION_KEY_MAXLEN + 1];
/*
** Timestamp attached to the event. Although a Timedate
** DTIME is used, the Alarm server only processes the first
** int (seconds) and ignore the second int (nanoseconds).
** This format is used to allow future use of a higher
** resolution.
/*
** Field timestamp. Some devices in the field are capable to timestamp
** status changes at the time they occur with sometimes a very good
** precision (milliseconds). This time may be specified and will be
** passed to the Alarm server but will not be used. The server will
** only write it in the database.
*/
TIMEDATE_HABDTIME field_time;
/*
** All the following fields are provided to convey information about
** the database object which the subject of the event. The time field
** and the fields that follow are used to create the character string
** that appears in the formatted LOGs as defined in the message
** definition (in a .ALMMSG file) attached to the exception.
*/
char text_string_str[ ALARM_STRING_MAXLEN + 1];
float real1;
float real2;
float real3;
float real4;
float real5;
float real6;
CCA_BOOL flag1;
CCA_BOOL flag2;
CCA_INT32 intval1;
CCA_INT32 intval2;
} ALARM_EVENT_BLOCK;
CHARACTER*8 PERMISSION_KEY
END STRUCTURE
version
Should have the value ALARM_API_VERSION directly from alarm.h or alarm.inc. This argument
identifies the version of the interface definition. If the structure that is part of the API changes in the
future, the ALARM_API_VERSION will change so that it will be possible for the API to determine
whether it must convert an old structure being referenced by the user into the latest structure prior to
processing.
Description
This function allows a client to notify the Alarm server about an event or an alarm that occurred in
the system. Some validation and lookup operations are performed on the structure passed by the
client, and the event is sent to the Alarm server for processing.
If the alarm_use_hdbha function has been called, then this function can only be called from within an
Hdb update transaction. Failure to do so will cause the task to abort.
A default location and category handle can be used by clients that do not know about locations and
categories.
If the Alarm server goes down after the client task has successfully registered with Alarm,
ALARM_S_NORMAL is returned (instead of ALARM_E_SERVDOWN), and the posted event is buffered
until Alarm comes back up and the connection is restored.
Return Values
ALARM_S_NORMAL: The function completed normally and successfully.
ALARM_E_SERVDOWN: The alarm server is not running.
ALARM_W_INVALIDEXC: Exception not defined in the Alarm database.
ALARM_W_INVALIDCAT: Category not defined in the Alarm database.
ALARM_W_INVALIDLOC: Location not defined in the Alarm database.
See Also
alarm_flush_events
Syntax
status = alarm_post_event_ex ( event_block, version )
C Binding
#include "alarm.h"
extern SCF_STATUS AlarmPostEventEx(
ALARM_EVENT_BLOCK_EX *event_block_ptr,
int version );
Fortran Binding
INTEGER*4 ALARM_POST_EVENT_EX( INTEGER*4 EVENT_BLOCK,
INTEGER*4 VERSION )
Arguments
event_block_ex
The event description that uses the following typedef:
typedef struct
{
/*
** Name of the exception definition in the ALARM database associated
** with the database object which is the subject of the event. May not
** be specified if the handle is provided.
*/
char exception_name_str[ ALARM_EXCEPTION_NAME_MAXLEN + 1];
/*
** Handle for the exception previously obtained through a call to
** the AlarmRegisterException() function. If the handle if specified
** the exception name field is not used.
** If a null handle is specified, the exception name must be provided.
*/
ALARM_EXCEPTION_HANDLE exception_handle;
/*
** A handle and an identifier in order to uniquely identify the instance
** of the object definition associated with the event.
**
** Why two and how are they used?
**
** The "object_identifier" is provided to make it possible for
** an application to use Hdb OIDs to uniquely identify a record.
/*
** A mask that can be built using the following values:
**
** - ALARM_NOTONE: This option indicates that the event should not result
** in a tone being sounded regardless of what is defined in the ALARM
** database.
*/
#define ALARM_NOTONE 1
/*
** - ALARM_NOWABNORNAL: This option indicates that the database object is
** in the abnormal state as a result of this event.
*/
#define ALARM_NOWABNORMAL 2
/*
** - ALARM_NOWUNACK: This option indicates that the database object is in
** the unacknowledged state as a result of this event.
*/
#define ALARM_NOWUNACK 4
/*
** - ALARM_NOLIST: This option indicates that the event is not an alarm.
** It should not be inserted in the alarm list and should only be
** logged.
*/
#define ALARM_NOLIST 8
/*
** - ALARM_NOLOG: This event should not be inserted in any formatted LOG.
** Note that it will be written in the archiving file and may be
** printed.
*/
#define ALARM_NOLOG 16
/*
** - ALARM_NOFIRST: This event is just posted to complement a previous
** one.
*/
#define ALARM_NOFIRST 32
/*
** - ALARM_NONOTIFY: This event should not trigger any notification
** (e-mail/pager).
*/
#define ALARM_NONOTIFY 64
/*
** Name of the category in the ALARM database associated with the
** database object which is the subject of the event. It does not
** need to be specified if the handle is provided.
** If neither the category name nor the handle are specified, the
** default category defined in the ALARM database will be used.
*/
char category_name_str[ ALARM_CATEGORY_NAME_MAXLEN + 1 ];
/*
** Handle for the category previously obtained through a call to
** the AlarmRegisterCategory() function. If the handle if specified
** the category name field is not used.
**
** A default category can be used when posting an event by using the
** default category handle: ALARM_DEFAULT_CATEGORY_HANDLE
**
*/
ALARM_CATEGORY_HANDLE category_handle;
/*
** Name of the location associated with the database object which
** is the subject of the event. It does not need to be specified
** if the handle is provided.
**
** A default location can be used when posting an event by using the
** default location handle: ALARM_DEFAULT_LOCATION_HANDLE
*/
char location_name_str[ ALARM_LOCATION_NAME_MAXLEN + 1 ];
/*
** Handle for the location previously obtained through a call to
** the AlarmRegisterLocation() function. If the handle if specified
** the location name field is not used.
*/
ALARM_LOCATION_HANDLE location_handle;
/*
** The permission keys (areas of responsibility) attached to the event.
** One or more (up to 5) can be specified.
** The area handle is optional and can be used for performance optimization
** for applications that are tracking the unack objects on a per area
** basis. These handles will be passed back in the unack callback but
** they are not used by Alarm.
*/
char permission_key[ ALARM_PERMISSION_KEY_MAXLEN + 1];
CCA_HANDLE area1_handle;
char permission_key2[ ALARM_PERMISSION_KEY_MAXLEN + 1];
CCA_HANDLE area2_handle;
char permission_key3[ ALARM_PERMISSION_KEY_MAXLEN + 1];
CCA_HANDLE area3_handle;
char permission_key4[ ALARM_PERMISSION_KEY_MAXLEN + 1];
CCA_HANDLE area4_handle;
char permission_key5[ ALARM_PERMISSION_KEY_MAXLEN + 1];
CCA_HANDLE area5_handle;
/*
** Field timestamp. Some devices in the field are capable to timestamp
** status changes at the time they occur with sometimes a very good
** precision (milliseconds). This time may be specified and will be
** passed to the Alarm server but will not be used. The server will
** only write it in the database.
*/
TIMEDATE_HABDTIME field_time;
/*
** All the following fields are provided to convey information about
** the database object which is the subject of the event. The time field
** and the fields that follow are used to create the character string
** that appears in the formatted LOGs as defined in the message
** definition attached to the exception.
** All the following fields are optional, but should match the message
** definition.
*/
char text_string_str[ ALARM_STRING_MAXLEN + 1];
float real1;
float real2;
float real3;
float real4;
float real5;
float real6;
CCA_UINT32 flag1;
CCA_UINT32 flag2;
CCA_UINT32 flag3; // Third flag introduced in HABITAT 5.2.1
CCA_INT32 intval1;
CCA_INT32 intval2;
/*
** The following field is considered as an URL that can be used to obtain
** information about the object being alarmed. The Alarm server will store
** this URL and the event/alarm will have a pointer to the record storing
** the URL so that it can be used by operators with just a mouse click
** (generating a DISPLAY/URL command)
*/
char url_str[ ALARM_URL_MAXLEN + 1];
} ALARM_EVENT_BLOCK_EX;
CHARACTER*8 PERMISSION_KEY
CHARACTER*8 PERMISSION_KEY2
CHARACTER*8 PERMISSION_KEY3
CHARACTER*8 PERMISSION_KEY4
CHARACTER*8 PERMISSION_KEY5
END STRUCTURE
version
Should have the value ALARM_API_VERSION directly from alarm.h or alarm.inc. This argument
identifies the version of the interface definition. If the structure that is part of the API changes in the
future, the ALARM_API_VERSION will change so that it will be possible for the API to determine
whether it must convert an old structure being referenced by the user into the latest structure prior to
processing.
Description
This function allows a client to notify the Alarm server about an event or an alarm that occurred in
the system. Some validation and lookup operations are performed on the structure passed by the
client, and the event is sent to the Alarm server for processing.
If the alarm_use_hdbha function has been called, then this function can only be called from within an
Hdb update transaction. Failure to do so will cause the task to abort.
A default location and category handle can be used by clients that do not know about locations and
categories.
Allows for use with the extended event structure.
If the Alarm server goes down after the client task has successfully registered with Alarm,
ALARM_S_NORMAL is returned (instead of ALARM_E_SERVDOWN), and the posted event is buffered
until Alarm comes back up and the connection is restored.
See Also
alarm_store_event_ex
Syntax
status = alarm_post_event_ex2 ( event_block, user identification,
version )
C Binding
#include "alarm.h"
extern SCF_STATUS AlarmPostEventEx2(
ALARM_EVENT_BLOCK_EX_EX *event_block_ptr,
USER_IDENTIFICATION user_id,
int version );
Fortran Binding
INTEGER*4 ALARM_POST_EVENT_EX2( INTEGER*4 EVENT_BLOCK,
INTEGER*4 USER_ID,
INTEGER*4 VERSION )
Arguments
event_block_ex2
The event description that uses the following typedef:
typedef struct
{
/*
** Name of the exception definition in the ALARM database associated
** with the database object which is the subject of the event. May not
** be specified if the handle is provided.
*/
char exception_name_str[ ALARM_EXCEPTION_NAME_MAXLEN + 1];
/*
** Handle for the exception previously obtained through a call to
** the AlarmRegisterException() function. If the handle if specified
** the exception name field is not used.
** If a null handle is specified, the exception name must be provided.
*/
ALARM_EXCEPTION_HANDLE exception_handle;
/*
** A handle and an identifier in order to uniquely identify the instance
** of the object definition associated with the event.
/*
** The Composite ID is used to relate alarms to one another instead of
** using the object identifier
*/
char composite_id[ ALARM_COMPOSITE_ID_MAXLEN + 1 ];
/*
** The group Identifier is used to associate a subset of alarms together
** based on their relation to one another.
*/
ALARM_64BIT_HANDLE group_identifier;
/*
** A mask that can be built using the following values:
**
** - ALARM_NOTONE: This option indicates that the event should not result
** in a tone being sounded regardless of what is defined in the ALARM
** database.
*/
#define ALARM_NOTONE 1
/*
** - ALARM_NOWABNORNAL: This option indicates that the database object is
** in the abnormal state as a result of this event.
*/
#define ALARM_NOWABNORMAL 2
/*
** - ALARM_NOWUNACK: This option indicates that the database object is in
** the unacknowledged state as a result of this event.
*/
#define ALARM_NOWUNACK 4
/*
** - ALARM_NOLIST: This option indicates that the event is not an alarm.
** It should not be inserted in the alarm list and should only be
** logged.
*/
#define ALARM_NOLIST 8
/*
** - ALARM_NONOTIFY: This event should not trigger any notification
** (e-mail/pager).
*/
#define ALARM_NONOTIFY 64
/*
** - ALARM_CUSTOM: These 10 flags are provided for customization purposes
*/
/*
** - ALARM_BADFIELDTIME: The Field Time associated with this event
** is invalid. Used when the time value of the device supplying
** the value is not trusted.
*/
#define ALARM_BADFIELDTIME 131072
/*
** A zero value is valid.
*/
int options;
/*
** Name of the category in the ALARM database associated with the
** database object which is the subject of the event. It does not
** need to be specified if the handle is provided.
** If neither the category name nor the handle are specified, the
** default category defined in the ALARM database will be used.
*/
char category_name_str[ ALARM_CATEGORY_NAME_MAXLEN + 1 ];
/*
** Handle for the category previously obtained through a call to
** the AlarmRegisterCategory() function. If the handle if specified
** the category name field is not used.
**
** A default category can be used when posting an event by using the
** default category handle: ALARM_DEFAULT_CATEGORY_HANDLE
/*
** Name of the location associated with the database object which
** is the subject of the event. It does not need to be specified
** if the handle is provided.
**
** A default location can be used when posting an event by using the
** default location handle: ALARM_DEFAULT_LOCATION_HANDLE
*/
char location_name_str[ ALARM_LOCATION_NAME_MAXLEN + 1 ];
/*
** Handle for the location previously obtained through a call to
** the AlarmRegisterLocation() function. If the handle if specified
** the location name field is not used.
*/
ALARM_LOCATION_HANDLE location_handle;
/*
** The permission keys (areas of responsibility) attached to the event.
** One or more (up to 5) can be specified. The area handle is optional
** and can be used for performance optimization for applications that
** are tracking the unack objects on a per area basis. These handles will
** be passed back in the unack callback but they are not used by Alarm.
*/
char permission_key[ ALARM_PERMISSION_KEY_MAXLEN + 1];
CCA_HANDLE area1_handle;
char permission_key2[ ALARM_PERMISSION_KEY_MAXLEN + 1];
CCA_HANDLE area2_handle;
char permission_key3[ ALARM_PERMISSION_KEY_MAXLEN + 1];
CCA_HANDLE area3_handle;
char permission_key4[ ALARM_PERMISSION_KEY_MAXLEN + 1];
CCA_HANDLE area4_handle;
char permission_key5[ ALARM_PERMISSION_KEY_MAXLEN + 1];
CCA_HANDLE area5_handle;
/*
** Timestamp attached to the event. Although a Timedate
** DTIME is used, the Alarm server only processes the first
** int (seconds) and ignore the second int (nanoseconds).
** This format is used to allow future use of a higher
** resolution.
*/
TIMEDATE_HABDTIME time;
/*
** Field timestamp. Some devices in the field are capable to timestamp
** status changes at the time they occur with sometimes a very good
** precision (milliseconds). This time may be specified and will be
** passed to the Alarm server but will not be used. The server will
** only write it in the database.
*/
TIMEDATE_HABDTIME field_time;
/*
** All the following fields are provided to convey information about
** the database object which is the subject of the event. The time field
** and the fields that follow are used to create the character string
/*
** The following field is considered as an URL that can be used to obtain
** information about the object being alarmed. The Alarm server will store
** this URL and the event/alarm will have a pointer to the record storing
** the URL so that it can be used by operators with just a mouse click
** (generating a DISPLAY/URL command)
*/
char url_str[ ALARM_URL_MAXLEN + 1];
} ALARM_EVENT_BLOCK_EX2;
CHARACTER*56 COMPOSITE_ID
CHARACTER*8 PERMISSION_KEY
CHARACTER*8 PERMISSION_KEY2
CHARACTER*8 PERMISSION_KEY3
CHARACTER*8 PERMISSION_KEY4
CHARACTER*8 PERMISSION_KEY5
END STRUCTURE
user_id
This structure contains the user information for the event. This information includes the user name,
the PC name, and the station name. This is used for logging purposes only when filling in proxies in
the alarm text.
version
Should have the value ALARM_API_VERSION directly from alarm.h or alarm.inc. This argument
identifies the version of the interface definition. If the structure that is part of the API changes in the
future, the ALARM_API_VERSION will change so that it will be possible for the API to determine
whether it must convert an old structure being referenced by the user into the latest structure prior to
processing.
Description
This function allows a client to notify the Alarm server about an event or an alarm that occurred in
the system. Some validation and lookup operations are performed on the structure passed by the
client, and the event is sent to the Alarm server for processing.
If the alarm_use_hdbha function has been called, then this function can only be called from within an
Hdb update transaction. Failure to do so will cause the task to abort.
A default location and category handle can be used by clients that do not know about locations and
categories.
Allows for use with the extended event structure.
If the Alarm server goes down after the client task has successfully registered with Alarm,
ALARM_S_NORMAL is returned (instead of ALARM_E_SERVDOWN), and the posted event is buffered
until Alarm comes back up and the connection is restored.
Return Values
ALARM_S_NORMAL: The function completed normally and successfully.
ALARM_E_SERVDOWN: The alarm server is not running.
ALARM_W_INVALIDEXC: Exception not defined in the Alarm database.
ALARM_W_INVALIDCAT: Category not defined in the Alarm database.
See Also
alarm_store_acknowledgment_ex2
Syntax
status = alarm_post_event_ex3 ( event_block, user identification,
version )
C Binding
#include "alarm.h"
extern SCF_STATUS AlarmPostEventEx3(
ALARM_EVENT_BLOCK_EX3 *event_block_ptr,
USER_IDENTIFICATION user_id,
int version );
Fortran Binding
Not Supported
Arguments
event_block_ex3
The event description that uses the following typedef:
struct ALARM_EVENT_BLOCK_EX3
{
/*
** A handle and an identifier are used to uniquely identify the instance
** of the object definition associated to the event.
**
** Why two and how are they used?
**
** The "object_identifier" is provided to make it possible for
** an application to use Hdb OIDs to uniquely identify a record.
** But using OIDs could be costly for an application to find the
** record the OID is identifying, which is why the "object_handle"
** is provided. For example the "object_handle" can be used to
** contain a record subscript while the "object_identifier" stores
** the OID. When an Ack callback fires, the application can get to the
** record using the "object_handle" and should verify that the OIDs
** are matching. Only a lookup will have to be done if they are not
** matching, which should be the exception.
**
** The Alarm server will correlate alarms using the object identifier.
** If a zero object identifier is used and a non-zero object handle
** is used, Alarm will copy the object handle into the identifier.
/*
** This OID is used as a generic identifier to link certain alarms
** together on a broader scale then the object_identifier.
** The proposed use is to link all alarms from a device together.
*/
ALARM_64BIT_HANDLE group_identifier;
CCA_HANDLE object_handle;
/*
** A mask that can be built using the following values:
**
** - ALARM_NOTONE: This option indicates that the event should not result
** in a tone being sounded regardless of what is defined in the ALARM
** database.
*/
#define ALARM_NOTONE 1
/*
** - ALARM_NOWABNORNAL: This option indicates that the database object is
** in the abnormal state as a result of this event.
*/
#define ALARM_NOWABNORMAL 2
/*
** - ALARM_NOWUNACK: This option indicates that the database object is in
** the unacknowledged state as a result of this event.
*/
#define ALARM_NOWUNACK 4
/*
** - ALARM_NOLIST: This option indicates that the event is not an alarm.
** It should not be inserted in the alarm list and should only be
** logged.
*/
#define ALARM_NOLIST 8
/*
** - ALARM_NOLOG: This event should not be inserted in any formatted LOG.
** Note that it will be written in the archiving file and may be
** printed.
*/
#define ALARM_NOLOG 16
/*
** - ALARM_NOFIRST: This event is just posted to complement a previous
** one.
*/
#define ALARM_NOFIRST 32
/*
** - ALARM_NONOTIFY: This event should not trigger any notification
** (e-mail/pager).
*/
#define ALARM_NONOTIFY 64
/*
** - ALARM_CUSTOM: These 10 flags are provided for customization purposes
*/
/*
** - ALARM_BADFIELDTIME: The Field Time associated with this event is
** invalid. Used when the time value of the device supplying the value
** is not trusted.
*/
#define ALARM_BADFLDTIME 131072
/*
** A zero value is valid.
*/
int options;
/*
** Handle for the exception previously obtained through a call to
** the AlarmRegisterException() function. If the handle if specified
** the exception name field is not used.
** If a null handle is specified, the exception name must be provided.
*/
ALARM_EXCEPTION_HANDLE exception_handle;
/*
** Handle for the category previously obtained through a call to
** the AlarmRegisterCategory() function. If the handle if specified
** the category name field is not used.
**
** A default category can be used when posting an event by using the
** default category handle: ALARM_DEFAULT_CATEGORY_HANDLE
**
*/
ALARM_CATEGORY_HANDLE category_handle;
/*
** Handle for the location previously obtained through a call to
** the AlarmRegisterLocation() function. If the handle if specified
** the location name field is not used.
*/
ALARM_LOCATION_HANDLE location_handle;
CCA_HANDLE area1_handle;
CCA_HANDLE area2_handle;
CCA_HANDLE area3_handle;
CCA_HANDLE area4_handle;
CCA_HANDLE area5_handle;
CCA_UINT32 flag1;
CCA_UINT32 flag2;
CCA_UINT32 flag3; // Third flag introduced in HABITAT 5.2.1
CCA_UINT32 flag4; // Fourth flag introduced in HABITAT 5.4
CCA_UINT32 flag5; // Fifth flag introduced in HABITAT 5.4
float real1;
float real2;
float real3;
float real4;
float real5;
float real6;
/*
** Timestamp attached to the event. Although a Timedate
** DTIME is used, the Alarm server only processes the first
** int (seconds) and ignore the second int (nanoseconds).
** This format is used to allow future use of a higher
** resolution.
*/
TIMEDATE_HABDTIME time;
/*
** Field timestamp. Some devices in the field are capable to timestamp
** status changes at the time they occur with sometimes a very good
** precision (milliseconds). This time may be specified and will be
** passed to the Alarm server but will not be used. The server will
** only write it in the database.
*/
TIMEDATE_HABDTIME field_time;
/*
** Name of the exception definition in the ALARM database associated
** with the database object which is the subject of the event. May not
** be specified if the handle is provided.
*/
char exception_name_str[ ALARM_EXCEPTION_NAME_MAXLEN + 1];
/*
** Name of the location associated with the database object which
** is the subject of the event. It does not need to be specified
** if the handle is provided.
**
** A default location can be used when posting an event by using the
** default location handle: ALARM_DEFAULT_LOCATION_HANDLE
*/
char location_name_str[ ALARM_LOCATION_NAME_MAXLEN + 1 ];
/*
** The permission keys (areas of responsibility) attached to the event.
** One or more (up to 5) can be specified. The area handle is optional
** and can be used for performance optimization for applications that are
** tracking the unack objects on a per area basis. These handles will be
** passed back in the unack callback but they are not used by Alarm.
*/
char permission_key[ ALARM_PERMISSION_KEY_MAXLEN + 1];
char permission_key2[ ALARM_PERMISSION_KEY_MAXLEN + 1];
char permission_key3[ ALARM_PERMISSION_KEY_MAXLEN + 1];
char permission_key4[ ALARM_PERMISSION_KEY_MAXLEN + 1];
char permission_key5[ ALARM_PERMISSION_KEY_MAXLEN + 1];
/*
** All the following fields are provided to convey information about
** the database object which the subject of the event. The time field
/*
** This character string is used to identify related alarms from a particular
** device to replace the object identifier as a way to associate related alarms
** together. The object identifier can still be used as it was in the past.
*/
char composite_id[ ALARM_COMPOSITE_ID_MAXLEN + 1 ];
/*
** There are two ways to identify the object of the alarm to the ALARM Server.
** These are the object's composite key and its MRID.
** When an alarm client calls AlarmPostEventEx3 or AlarmStoreEventEx3
** it can supply either the full composite key or its MRID. If only
** one or the other is specified the IMS can be used to look up the other.
** If both are specified then the MRID is used preferentially.
** Note that these identifiers are used for more than just long names.
** For example, Historian uses the MRID to preserve historical values
** in case a composite key or LongName is renamed.
** Replay uses on the MRID to allow ACK and DEL of alarms between sites which
** may be running different power system models. ETNAV will depend on the full
** composite key to locate displays containing the object being alarmed.
*/
AlarmMrid object_mrid;
AlarmCompositeKey object_comp_key;
/*
** Name of the category in the ALARM database associated with the
** database object which is the subject of the event. It does not
** need to be specified if the handle is provided.
** If neither the category name nor the handle are specified, the
** default category defined in the ALARM database will be used.
*/
char category_name_str[ ALARM_CATEGORY_NAME_MAXLEN + 1 ];
/*
** The following field is considered as an URL that can be used to obtain
** information on the object being alarmed. The Alarm server will store
** this URL and the event/alarm will have a pointer to the record storing
** the URL so that it can be used by operators with just a mouse click
** (generating a DISPLAY/URL command)
*/
char url_str[ ALARM_URL_MAXLEN + 1];
/*
** Alarm Long Name support
** -----------------------
** The Alarm API client can choose one of the three options:
** (1) a long_name_list, or
** (2) a mrid_list, or
** (3) a composite_key_list
**
** The API's precedence of resolving the long name is:
** if (1) exists, use long_name_list directly in the alarm message
** else if (2) exists, use mrid_list and ask IMS to translate MRIDs to LongNames
AlarmMridList mrid_list;
AlarmCompositeKeyList composite_key_list;
};
user_id
This structure contains the user information for the event. This information includes the user name,
the PC name, and the station name. This is used for logging purposes only when filling in proxies in
the alarm text.
version
This argument has the value ALARM_API_VERSION directly from alarm.h. It identifies the version of
the interface definition. If the structure that is part of the API changes in the future,
ALARM_API_VERSION changes so that it is possible for the API to determine whether it must convert
an old structure, being referenced by the user, into the latest structure prior to processing.
Description
This function allows a client to notify the Alarm server about an event or an alarm that occurred in
the system. Some validation and lookup operations are performed on the structure passed by the
client, and the event is sent to the Alarm server for processing.
If the alarm_use_hdbha function is called, this function can only be called from within an Hdb update
transaction. Failure to do so causes the task to abort.
A default location and category handle can be used by clients that do not know about locations and
categories.
If the Alarm server goes down after the client task has successfully registered with Alarm,
ALARM_S_NORMAL is returned (instead of ALARM_E_SERVDOWN) and the posted event is buffered
until Alarm comes back up and the connection is restored.
The EX3 version of this function is an extension of the EX2 version of the same function with added
support for entering MRIDs, a composite key list, or a long-name list.
The ALARM_EVENT_BLOCK_EX3 block structure provides additional fields and data types to support
the different ways to specify long name parameters. These new types are:
• AlarmLongNameList: A list of string objects representing the actual long names. This is used
when the Alarm client already has the long names available.
• AlarmMridList: A list of string objects where each represents an MRID. Alarm translates this MRID
to the equivalent long names.
• AlarmCompositeKeyList: A list of AlarmCompositeKey objects, where each object contains a
domain/composite key pair. Together, the domain and composite key is used by Alarm to locate
the MRID, which translates to a long name string.
• AlarmCompositeKey: A structure to hold the “domain” string and “composite key” string. The
“domain” identifies the name of the domain in which the “composite key” has meaning. For
example, the same Substation in SCADA and in NETWORK have different composite keys. The
AlarmCompositeKey in the SCADA domain may be { “hdb-scadamom”,
“SCADEK=SUBSTN;SUBSTN=KINCARD”}, and the same object in the NETWORK domain may be
Return Values
ALARM_S_NORMAL: The function completed normally and successfully.
ALARM_E_SERVDOWN: The alarm server is not running.
ALARM_W_INVALIDEXC: Exception not defined in the Alarm database.
ALARM_W_INVALIDCAT: Category not defined in the Alarm database.
ALARM_W_INVALIDLOC: Location not defined in the Alarm database.
See Also
alarm_store_event_ex3
Syntax
status = alarm_post_event_ex4 ( event_block, user identification,
version )
C Binding
#include "alarm.h"
extern SCF_STATUS AlarmPostEventEx4(
ALARM_EVENT_BLOCK_EX4 *event_block_ptr,
USER_IDENTIFICATION user_id,
int version );
Fortran Binding
Not Supported
Arguments
event_block_ex4
The event description that uses the following typedef:
struct ALARM_EVENT_BLOCK_EX4
{
/*
** A handle and an identifier are used to uniquely identify the instance
** of the object definition associated to the event.
**
** Why two and how are they used?
**
** The "object_identifier" is provided to make it possible for
** an application to use Hdb OIDs to uniquely identify a record.
** But using OIDs could be costly for an application to find the
** record the OID is identifying, which is why the "object_handle"
** is provided. For example the "object_handle" can be used to
** contain a record subscript while the "object_identifier" stores
** the OID. When an Ack callback fires, the application can get to the
** record using the "object_handle" and should verify that the OIDs
** are matching. Only a lookup will have to be done if they are not
** matching, which should be the exception.
**
** The Alarm server will correlate alarms using the object identifier.
** If a zero object identifier is used and a non-zero object handle
** is used, Alarm will copy the object handle into the identifier.
/*
** This OID is used as a generic identifier to link certain alarms
** together on a broader scale then the object_identifier.
** The proposed use is to link all alarms from a device together.
*/
ALARM_64BIT_HANDLE group_identifier;
CCA_HANDLE object_handle;
/*
** A mask that can be built using the following values:
**
** - ALARM_NOTONE: This option indicates that the event should not result
** in a tone being sounded regardless of what is defined in the ALARM
** database.
*/
#define ALARM_NOTONE 1
/*
** - ALARM_NOWABNORNAL: This option indicates that the database object is
** in the abnormal state as a result of this event.
*/
#define ALARM_NOWABNORMAL 2
/*
** - ALARM_NOWUNACK: This option indicates that the database object is in
** the unacknowledged state as a result of this event.
*/
#define ALARM_NOWUNACK 4
/*
** - ALARM_NOLIST: This option indicates that the event is not an alarm.
** It should not be inserted in the alarm list and should only be
** logged.
*/
#define ALARM_NOLIST 8
/*
** - ALARM_NOLOG: This event should not be inserted in any formatted LOG.
** Note that it will be written in the archiving file and may be
** printed.
*/
#define ALARM_NOLOG 16
/*
** - ALARM_NOFIRST: This event is just posted to complement a previous
** one.
*/
#define ALARM_NOFIRST 32
/*
** - ALARM_NONOTIFY: This event should not trigger any notification
** (e-mail/pager).
*/
#define ALARM_NONOTIFY 64
/*
** - ALARM_CUSTOM: These 10 flags are provided for customization purposes
*/
/*
** - ALARM_BADFIELDTIME: The Field Time associated with this event is
** invalid. Used when the time value of the device supplying the value
** is not trusted.
*/
#define ALARM_BADFLDTIME 131072
/*
** - ALARM_SAFETY: The option indicates that the event is safety related
*/
#define ALARM_SAFETY 262144
/*
** A zero value is valid.
*/
int options;
/*
** Handle for the exception previously obtained through a call to
** the AlarmRegisterException() function. If the handle if specified
** the exception name field is not used.
** If a null handle is specified, the exception name must be provided.
*/
ALARM_EXCEPTION_HANDLE exception_handle;
/*
** Handle for the category previously obtained through a call to
** the AlarmRegisterCategory() function. If the handle if specified
** the category name field is not used.
**
** A default category can be used when posting an event by using the
** default category handle: ALARM_DEFAULT_CATEGORY_HANDLE
**
*/
ALARM_CATEGORY_HANDLE category_handle;
/*
** Handle for the location previously obtained through a call to
** the AlarmRegisterLocation() function. If the handle if specified
** the location name field is not used.
*/
ALARM_LOCATION_HANDLE location_handle;
CCA_HANDLE area1_handle;
CCA_HANDLE area2_handle;
CCA_HANDLE area3_handle;
CCA_HANDLE area4_handle;
CCA_HANDLE area5_handle;
CCA_UINT32 flag1;
CCA_INT32 intval1;
CCA_INT32 intval2;
float real1;
float real2;
float real3;
float real4;
float real5;
float real6;
/*
** Timestamp attached to the event. Although a Timedate
** DTIME is used, the Alarm server only processes the first
** int (seconds) and ignore the second int (nanoseconds).
** This format is used to allow future use of a higher
** resolution.
*/
TIMEDATE_HABDTIME time;
/*
** Field timestamp. Some devices in the field are capable to timestamp
** status changes at the time they occur with sometimes a very good
** precision (milliseconds). This time may be specified and will be
** passed to the Alarm server but will not be used. The server will
** only write it in the database.
*/
TIMEDATE_HABDTIME field_time;
/*
** Name of the exception definition in the ALARM database associated
** with the database object which is the subject of the event. May not
** be specified if the handle is provided.
*/
char exception_name_str[ ALARM_EXCEPTION_NAME_MAXLEN + 1];
/*
** Name of the location associated with the database object which
** is the subject of the event. It does not need to be specified
** if the handle is provided.
**
** A default location can be used when posting an event by using the
** default location handle: ALARM_DEFAULT_LOCATION_HANDLE
*/
char location_name_str[ ALARM_LOCATION_NAME_MAXLEN_V6 + 1 ];
/*
** The permission keys (areas of responsibility) attached to the event.
** One or more (up to 5) can be specified. The area handle is optional
** and can be used for performance optimization for applications that are
** tracking the unack objects on a per area basis. These handles will be
** passed back in the unack callback but they are not used by Alarm.
*/
char permission_key[ ALARM_PERMISSION_KEY_MAXLEN + 1];
char permission_key2[ ALARM_PERMISSION_KEY_MAXLEN + 1];
char permission_key3[ ALARM_PERMISSION_KEY_MAXLEN + 1];
char permission_key4[ ALARM_PERMISSION_KEY_MAXLEN + 1];
/*
** All the following fields are provided to convey information about
** the database object which the subject of the event. The time field
** and the fields that follow are used to create the character string
** that appears in the formatted LOGs as defined in the message
** definition attached to the exception.
** All the following fields are optional.
*/
char text_string_str[ ALARM_STRING_MAXLEN + 1];
/*
** This character string is used to identify related alarms from a particular
** device to replace the object identifier as a way to associate related alarms
** together. The object identifier can still be used as it was in the past.
*/
char composite_id[ ALARM_COMPOSITE_ID_MAXLEN + 1 ];
/*
** There are two ways to identify the object of the alarm to the ALARM Server.
** These are the object's composite key and its MRID.
** When an alarm client calls AlarmPostEventEx3 or AlarmStoreEventEx3
** it can supply either the full composite key or its MRID. If only
** one or the other is specified the IMS can be used to look up the other.
** If both are specified then the MRID is used preferentially.
** Note that these identifiers are used for more than just long names.
** For example, Historian uses the MRID to preserve historical values
** in case a composite key or LongName is renamed.
** Replay uses on the MRID to allow ACK and DEL of alarms between sites which
** may be running different power system models. ETNAV will depend on the full
** composite key to locate displays containing the object being alarmed.
*/
AlarmMrid object_mrid;
AlarmCompositeKey object_comp_key;
/*
** Name of the category in the ALARM database associated with the
** database object which is the subject of the event. It does not
** need to be specified if the handle is provided.
** If neither the category name nor the handle are specified, the
** default category defined in the ALARM database will be used.
*/
char category_name_str[ ALARM_CATEGORY_NAME_MAXLEN + 1 ];
/*
** The following field is considered as an URL that can be used to obtain
** information on the object being alarmed. The Alarm server will store
** this URL and the event/alarm will have a pointer to the record storing
** the URL so that it can be used by operators with just a mouse click
** (generating a DISPLAY/URL command)
*/
char url_str[ ALARM_URL_MAXLEN + 1];
/*
** The 4 strings are for future use.
*/
char string1[ ALARM_EXTRA_STRING_MAXLEN + 1];
/*
** Alarm Long Name support
** -----------------------
** The Alarm API client can choose one of the three options:
** (1) a long_name_list, or
** (2) a mrid_list, or
** (3) a composite_key_list
**
** The API's precedence of resolving the long name is:
** if (1) exists, use long_name_list directly in the alarm message
** else if (2) exists, use mrid_list and ask IMS to translate MRIDs to LongNames
** else if (3) exists, use composite_key_list and ask IMS to translate CompKeys
** to LongNames else no long name translation.
*/
AlarmLongNameList long_name_list;
AlarmMridList mrid_list;
AlarmCompositeKeyList composite_key_list;
};
user_id
This structure contains the user information for the event. This information includes the user name,
the PC name, and the station name. This is used for logging purposes only when filling in proxies in
the alarm text.
version
This argument has the value ALARM_API_VERSION directly from alarm.h. It identifies the version of
the interface definition. If the structure that is part of the API changes in the future,
ALARM_API_VERSION changes so that it is possible for the API to determine whether it must convert
an old structure, being referenced by the user, into the latest structure prior to processing.
Description
This function allows a client to notify the Alarm server about an event or an alarm that occurred in
the system. Some validation and lookup operations are performed on the structure passed by the
client, and the event is sent to the Alarm server for processing.
If the alarm_use_hdbha function is called, this function can only be called from within an Hdb update
transaction. Failure to do so causes the task to abort.
A default location and category handle can be used by clients that do not know about locations and
categories.
If the Alarm server goes down after the client task has successfully registered with Alarm,
ALARM_S_NORMAL is returned (instead of ALARM_E_SERVDOWN) and the posted event is buffered
until Alarm comes back up and the connection is restored.
The EX4 version of this function is an extension of the EX3 version of the same function with added
support for safety flag and state string, and increased size for the location name.
These new types are:
• ALARM_SAFETY: A flag to indicate that the event is safety related.
Return Values
ALARM_S_NORMAL: The function completed normally and successfully.
ALARM_E_SERVDOWN: The alarm server is not running.
ALARM_W_INVALIDEXC: Exception not defined in the Alarm database.
ALARM_W_INVALIDCAT: Category not defined in the Alarm database.
ALARM_W_INVALIDLOC: Location not defined in the Alarm database.
See Also
alarm_store_event_ex4
Syntax
status = alarm_post_event_ex5 ( event_block, user identification,
version )
C Binding
#include "alarm.h"
extern SCF_STATUS AlarmPostEventEx5(
ALARM_EVENT_BLOCK_EX5 *event_block_ptr,
USER_IDENTIFICATION user_id,
int version );
Fortran Binding
Not Supported
Arguments
event_block_ex5
The event description that uses the following typedef:
struct ALARM_EVENT_BLOCK_EX5
{
/*
** A handle and an identifier are used to uniquely identify the instance
** of the object definition associated to the event.
**
** Why two and how are they used?
**
** The "object_identifier" is provided to make it possible for
** an application to use Hdb OIDs to uniquely identify a record.
** But using OIDs could be costly for an application to find the
** record the OID is identifying, which is why the "object_handle"
** is provided. For example the "object_handle" can be used to
** contain a record subscript while the "object_identifier" stores
** the OID. When an Ack callback fires, the application can get to the
** record using the "object_handle" and should verify that the OIDs
** are matching. Only a lookup will have to be done if they are not
** matching, which should be the exception.
**
** The Alarm server will correlate alarms using the object identifier.
** If a zero object identifier is used and a non-zero object handle
** is used, Alarm will copy the object handle into the identifier.
/*
** This OID is used as a generic identifier to link certain alarms
** together on a broader scale then the object_identifier.
** The proposed use is to link all alarms from a device together.
*/
ALARM_64BIT_HANDLE group_identifier;
CCA_HANDLE object_handle;
/*
** A mask that can be built using the following values:
**
** - ALARM_NOTONE: This option indicates that the event should not result
** in a tone being sounded regardless of what is defined in the ALARM
** database.
*/
#define ALARM_NOTONE 1
/*
** - ALARM_NOWABNORNAL: This option indicates that the database object is
** in the abnormal state as a result of this event.
*/
#define ALARM_NOWABNORMAL 2
/*
** - ALARM_NOWUNACK: This option indicates that the database object is in
** the unacknowledged state as a result of this event.
*/
#define ALARM_NOWUNACK 4
/*
** - ALARM_NOLIST: This option indicates that the event is not an alarm.
** It should not be inserted in the alarm list and should only be
** logged.
*/
#define ALARM_NOLIST 8
/*
** - ALARM_NOLOG: This event should not be inserted in any formatted LOG.
** Note that it will be written in the archiving file and may be
** printed.
*/
#define ALARM_NOLOG 16
/*
** - ALARM_NOFIRST: This event is just posted to complement a previous
** one.
*/
#define ALARM_NOFIRST 32
/*
** - ALARM_NONOTIFY: This event should not trigger any notification
** (e-mail/pager).
*/
#define ALARM_NONOTIFY 64
/*
** - ALARM_CUSTOM: These 10 flags are provided for customization purposes
*/
/*
** - ALARM_BADFIELDTIME: The Field Time associated with this event is
** invalid. Used when the time value of the device supplying the value
** is not trusted.
*/
#define ALARM_BADFLDTIME 131072
/*
** - ALARM_SAFETY: The option indicates that the event is safety related
*/
#define ALARM_SAFETY 262144
/*
** A zero value is valid.
*/
int options;
/*
** Handle for the exception previously obtained through a call to
** the AlarmRegisterException() function. If the handle if specified
** the exception name field is not used.
** If a null handle is specified, the exception name must be provided.
*/
ALARM_EXCEPTION_HANDLE exception_handle;
/*
** Handle for the category previously obtained through a call to
** the AlarmRegisterCategory() function. If the handle if specified
** the category name field is not used.
**
** A default category can be used when posting an event by using the
** default category handle: ALARM_DEFAULT_CATEGORY_HANDLE
**
*/
ALARM_CATEGORY_HANDLE category_handle;
/*
** Handle for the location previously obtained through a call to
** the AlarmRegisterLocation() function. If the handle if specified
** the location name field is not used.
*/
ALARM_LOCATION_HANDLE location_handle;
CCA_HANDLE area1_handle;
CCA_HANDLE area2_handle;
CCA_HANDLE area3_handle;
CCA_HANDLE area4_handle;
CCA_HANDLE area5_handle;
CCA_UINT32 flag1;
CCA_INT32 intval1;
CCA_INT32 intval2;
float real1;
float real2;
float real3;
float real4;
float real5;
float real6;
/*
** Timestamp attached to the event. Although a Timedate
** DTIME is used, the Alarm server only processes the first
** int (seconds) and ignore the second int (nanoseconds).
** This format is used to allow future use of a higher
** resolution.
*/
TIMEDATE_HABDTIME time;
/*
** Field timestamp. Some devices in the field are capable to timestamp
** status changes at the time they occur with sometimes a very good
** precision (milliseconds). This time may be specified and will be
** passed to the Alarm server but will not be used. The server will
** only write it in the database.
*/
TIMEDATE_HABDTIME field_time;
/*
** Name of the exception definition in the ALARM database associated
** with the database object which is the subject of the event. May not
** be specified if the handle is provided.
*/
char exception_name_str[ ALARM_EXCEPTION_NAME_MAXLEN + 1];
/*
** Name of the location associated with the database object which
** is the subject of the event. It does not need to be specified
** if the handle is provided.
**
** A default location can be used when posting an event by using the
** default location handle: ALARM_DEFAULT_LOCATION_HANDLE
*/
char location_name_str[ ALARM_LOCATION_NAME_MAXLEN_V6 + 1 ];
/*
** The permission keys (areas of responsibility) attached to the event.
** One or more (up to 5) can be specified. The area handle is optional
** and can be used for performance optimization for applications that are
** tracking the unack objects on a per area basis. These handles will be
** passed back in the unack callback but they are not used by Alarm.
*/
char permission_key[ ALARM_PERMISSION_KEY_MAXLEN + 1];
char permission_key2[ ALARM_PERMISSION_KEY_MAXLEN + 1];
char permission_key3[ ALARM_PERMISSION_KEY_MAXLEN + 1];
char permission_key4[ ALARM_PERMISSION_KEY_MAXLEN + 1];
/*
** All the following fields are provided to convey information about
** the database object which the subject of the event. The time field
** and the fields that follow are used to create the character string
** that appears in the formatted LOGs as defined in the message
** definition attached to the exception.
** All the following fields are optional.
*/
char text_string_str[ ALARM_STRING_MAXLEN + 1];
/*
** This character string is used to identify related alarms from a particular
** device to replace the object identifier as a way to associate related alarms
** together. The object identifier can still be used as it was in the past.
*/
char composite_id[ ALARM_COMPOSITE_ID_MAXLEN + 1 ];
/*
** Name of the category in the ALARM database associated with the
** database object which is the subject of the event. It does not
** need to be specified if the handle is provided.
** If neither the category name nor the handle are specified, the
** default category defined in the ALARM database will be used.
*/
char category_name_str[ ALARM_CATEGORY_NAME_MAXLEN + 1 ];
/*
** The following field is considered as an URL that can be used to obtain
** information on the object being alarmed. The Alarm server will store
** this URL and the event/alarm will have a pointer to the record storing
** the URL so that it can be used by operators with just a mouse click
** (generating a DISPLAY/URL command)
*/
char url_str[ ALARM_URL_MAXLEN + 1];
/*
** The 4 strings are for future use.
*/
char string1[ ALARM_EXTRA_STRING_MAXLEN + 1];
char string2[ ALARM_EXTRA_STRING_MAXLEN + 1];
char string3[ ALARM_EXTRA_STRING_MAXLEN + 1];
char string4[ ALARM_EXTRA_STRING_MAXLEN + 1];
/*
** There are two ways to identify the object of the alarm to the ALARM Server.
** These are the object's composite key and its MRID.
** When an alarm client calls AlarmPostEventEx3 or AlarmStoreEventEx3
** it can supply either the full composite key or its MRID. If only
** one or the other is specified the IMS can be used to look up the other.
** If both are specified then the MRID is used preferentially.
** Note that these identifiers are used for more than just long names.
** For example, Historian uses the MRID to preserve historical values
** in case a composite key or LongName is renamed.
** Replay uses on the MRID to allow ACK and DEL of alarms between sites which
** may be running different power system models. ETNAV will depend on the full
** composite key to locate displays containing the object being alarmed.
*/
AlarmCompositeKey object_comp_key;
/*
** Alarm Long Name support
** -----------------------
** The Alarm API client can choose one of the three options:
** (1) a long_name_list, or
** (2) a mrid_list, or
** (3) a composite_key_list
**
** The API's precedence of resolving the long name is:
** if (1) exists, use long_name_list directly in the alarm message
** else if (2) exists, use mrid_list and ask IMS to translate MRIDs to LongNames
** else if (3) exists, use composite_key_list and ask IMS to translate CompKeys
** to LongNames else no long name translation.
*/
AlarmLongNameList long_name_list;
AlarmMridList mrid_list;
AlarmCompositeKeyList composite_key_list;
user_id
This structure contains the user information for the event. This information includes the user name,
the PC name, and the station name. This is used for logging purposes only when filling in proxies in
the alarm text.
version
This argument has the value ALARM_API_VERSION directly from alarm.h. It identifies the version of
the interface definition. If the structure that is part of the API changes in the future,
ALARM_API_VERSION changes so that it is possible for the API to determine whether it must convert
an old structure, being referenced by the user, into the latest structure prior to processing.
Description
This function allows a client to notify the Alarm server about an event or an alarm that occurred in
the system. Some validation and lookup operations are performed on the structure passed by the
client, and the event is sent to the Alarm server for processing.
If the alarm_use_hdbha function is called, this function can only be called from within an Hdb update
transaction. Failure to do so causes the task to abort.
A default location and category handle can be used by clients that do not know about locations and
categories.
If the Alarm server goes down after the client task has successfully registered with Alarm,
ALARM_S_NORMAL is returned (instead of ALARM_E_SERVDOWN) and the posted event is buffered
until Alarm comes back up and the connection is restored.
The EX5 version of this function is an extension of the EX4 version of the same function with added
support for the alarm’s own MRID.
Return Values
ALARM_S_NORMAL: The function completed normally and successfully.
ALARM_E_SERVDOWN: The alarm server is not running.
ALARM_W_INVALIDEXC: Exception not defined in the Alarm database.
ALARM_W_INVALIDCAT: Category not defined in the Alarm database.
ALARM_W_INVALIDLOC: Location not defined in the Alarm database.
See Also
alarm_store_event_ex5
Syntax
status = alarm_register_category( category_name, category_handle_ptr )
C Binding
#include "alarm.h"
extern SCF_STATUS AlarmRegisterCategory(
const char category_name_str[],
ALARM_CATEGORY_HANDLE *category_handle_ptr);
Fortran Binding
INTEGER*4 ALARM_REGISTER_CATEGORY(
CHARACTER*(*) CATEGORY_NAME
INTEGER*4 CATEGORY_HANDLE )
Arguments
category_name
Name of the category as defined in the Alarm database.
category_handle
Location where the handle to the category will be returned. The handle should be retained for future
use (when posting an event). If the category was not found, the handle will be NULL.
Description
This function has two purposes:
• Verifies that the category is valid and known by the Alarm server.
• Provides a handle that the client can use when posting events. If the handle is retained and used,
the Alarm API does not need to perform a lookup at the time the client posts an event since the
handle will allow the Alarm server to quickly locate the category in its internal database.
The registration performed by this function is only valid for the Alarm server that the API is connected
to. If the API loses its connection and then re-establishes it (with the same server or not), the
registration is considered lost and should be done again.
Return Values
ALARM_S_NORMAL: The function completed normally and successfully.
ALARM_E_BADCAT: Category not defined in the Alarm database.
See Also
alarm_register_client
Syntax
status = alarm_register_client ( client_name, ready_cb, userarg)
C Binding
#include "alarm.h"
extern SCF_STATUS AlarmRegisterClient(
const char client_name_str[],
ALARM_READY_CB ready_cb,
CCA_USERARG userarg );
Fortran Binding
INTEGER*4 ALARM_REGISTER_CLIENT( CHARACTER*(*) CLIENT_NAME,
INTEGER*4 READY_CB,
INTEGER*4 USERARG )
Arguments
client_name
Name of the client to be registered with Alarm. This name is used by the Alarm server to display
statistics for each client. It should not duplicate the name used by another task using the same Alarm
server. Underscore (“_”) characters are not allowed in the client name.
ready_cb
Address of the function to be called when initialization is done, meaning that data about the client’s
application has been downloaded from the Alarm server into the API.
The function has two arguments:
typedef void (*ALARM_READY_CB ) (SCF_STATUS status,
CCA_USERARG userarg );
SUBROUTINE ALARM_READY_CB( INTEGER*4 STATUS,
INTEGER*4 USERARG )
The possible SCF statuses are:
• ALARM_S_NORMAL: Normal successful completion.
• ALARM_E_NOSUCHAPP: The application the user is running under is not defined in the Alarm
server.
• ALARM_E_DUPCLIENT: The client name duplicates an already registered client.
Description
This function initializes the Alarm API. It must be called after the ppm_init function and before any
other Alarm functions.
This function establishes a communication path with the Alarm server using the NIOSOCK API. It is
assumed that, within the site and for a given family, only one Alarm server is enabled at a given time.
The Alarm server that the API should connect to is identified according to the following rule:
• If the caller is started by PROCMAN, its PROCMAN family is assumed to be the family used by the
Alarm server.
• Otherwise, the caller’s family is used.
Once the communication path is established, the client is registered under this application. The Alarm
server downloads all the data related to this application and, once the download is complete, the
ready callback is invoked. Every time the communication path gets lost and is re-established (during a
failover, for example), a download is performed and the client callback is invoked.
Once the ready callback is invoked, the client can call the AlarmRegisterException,
AlarmRegisterCategory, and AlarmRegisterLocation functions. If the Alarm server is not running, the
user is notified. The connection attempt needs to be implemented on the user side. If the client is not
running on the computer where either the enabled or the standby Alarm server is running, the
ALARM_REMOTE_SERVER environment variable should be defined to prevent this call from returning a
SERVDOWN status.
By default, the API is set so that every client does NOT require bundling of the replication of database
object changes with the replication of the associated events. Therefore, by default, the API does not
use the Hdb High Availability services, but lets the Alarm server take care of the replication of the
events. If this is not the desired behavior, the client should call the alarm_use_hdbha function.
By default, it is assumed that the client does not need the acknowledged/unacknowledged state of a
database object. However, if a client needs to maintain its own list of unacknowledged objects, the
alarm_enum_unack_objects function should be called once the ready callback routine is invoked.
Calling this function more than once within the same process and without calling the
AlarmUnregisterClient function is a fatal error that causes the process to abort.
Environment
The caller must be a PPM-compliant application.
Return Values
• ALARM_S_NORMAL: Normal successful completion.
• ALARM_E_SERVDOWN: The Alarm server is not running.
See Also
ppm_init
alarm_enum_unack_objects
Syntax
status = alarm_register_exception( exception_id, exception_handle_ptr )
C Binding
#include "alarm.h"
extern SCF_STATUS AlarmRegisterException(
const char exception_id_str[],
ALARM_EXCEPTION_HANDLE *exception_handle_ptr);
Fortran Binding
INTEGER*4 ALARM_REGISTER_EXCEPTION(
CHARACTER*(*) EXCEPTION_ID,
INTEGER*4 EXCEPTION_HANDLE )
Arguments
exception_id
Identifier of the exception definition as defined in the Alarm database.
exception_handle
Location where the handle to the exception will be returned. The handle should be retained for future
use (when posting an event). If the exception was not found, the handle will be NULL.
Description
This function has two purposes:
• Verifies that the exception ID is valid and known by the Alarm server.
• Provides a handle that the client can use when posting events. If the handle is retained and used,
then the Alarm API does not need to perform a lookup at the time the client posts an event, since
the handle will allow the Alarm server to quickly locate the exception definition in its internal
database.
The registration performed by this function is only valid for the Alarm server the API is connected to. If
the API loses its connection and then re-establishes it (with the same server or not), the registration is
considered lost and should be done again.
Return Values
ALARM_S_NORMAL: The function completed normally and successfully.
See Also
alarm_register_client
Syntax
status = alarm_register_location( location_name, location_handle_ptr )
C Binding
#include "alarm.h"
extern SCF_STATUS AlarmRegisterLocation(
const char location_name_str[],
ALARM_LOCATION_HANDLE *location_handle_ptr);
Fortran Binding
INTEGER*4 ALARM_REGISTER_LOCATION(
CHARACTER*(*) LOCATION_NAME
INTEGER*4 LOCATION_HANDLE )
Arguments
location_name
Name of the location as defined in the Alarm database.
location_handle
Location where the handle to the location will be returned. The handle should be retained for future
use (when posting an event). If the location was not found, the handle will be NULL.
Description
This function has two purposes:
• Verifies that the location is valid and known by the Alarm server.
• Provides a handle that the client can use when posting events. If the handle is retained and used,
then the Alarm API does not need to perform a lookup at the time the client posts an event, since
the handle will allow the Alarm server to quickly locate the location in its internal database.
The registration performed by this function is only valid for the Alarm server the API is connected to. If
the API loses its connection and then re-establishes it (with the same server or not), the registration is
considered lost and should be done again.
Return Values
ALARM_S_NORMAL: The function completed normally and successfully.
ALARM_E_BADLOC: Location not defined in the Alarm database.
See Also
alarm_register_client
Syntax
status = alarm_reset_lists()
C Binding
#include "alarm.h"
extern SCF_STATUS AlarmResetLists();
Fortran Binding
INTEGER*4 ALARM_RESET_LISTS()
Arguments
None
Description
This function resets the alarm list and the formatted LOGs maintained by the Alarm server. It is
intended to be used for testing purposes, and possibly by Grid Simulation when it is restarting or
when it is initializing to a new start time.
Return Values
ALARM_S_NORMAL: The function completed normally and successfully.
ALARM_E_NOCOMMS: No connection with the Alarm server.
ALARM_E_SERVDOWN: The Alarm server is not running.
Syntax
status = alarm_store_acknowledgment( object_name, object_handle,
time, station )
C Binding
#include "alarm.h"
extern SCF_STATUS AlarmStoreAcknowledgment(
const char object_name_str[],
CCA_HANDLE object_handle,
TIMEDATE_HABTIME time,
const char station_str );
Fortran Binding
INTEGER*4 ALARM_STORE_ACKNOWLEDGMENT(
CHARACTER*(*) OBJECT_DEF,
INTEGER*4 OBJECT_HANDLE,
TIMEDATE_HABTIME TIME,
CHARACTER*(*) STATION )
Arguments
object_name
A character string identifying the object definition in the Alarm database. The maximum length of the
string is defined by the ALARM_OBJECT_DEF_MAXLEN constant.
object_handle
A handle identifying an instance of the object definition. This handle is passed at the time the event is
posted.
time
A TIMEDATE time indicating when the alarms on the object have been acknowledged. If a null value is
passed, the current time is assumed by the API.
station
A character string identifying the station where an operator executed the action that led to this
acknowledgment call. The maximum length of the string is defined by the
Description
This function stores an acknowledgment request of all the related alarms associated with a database
object. It is assumed that the client will at some point invoke the alarm_flush_acknowledgments
function to send to the Alarm server all the requests that have been previously stored.
If some unacknowledged alarms are indeed associated with the object and if the client did an earlier
call to the alarm_enum_unack_objects function, the “ack” callback will be invoked once the Alarm
server has performed the acknowledgment operation.
If no unacknowledged alarm is associated with the object and if the client did an earlier call to the
alarm_enum_unack_objects function, the “ack” callback will be invoked with the
ALARM_W_NOUNACKFOUND status.
If an invalid object definition is specified, the request will be discarded and a message will be written
in the default application LOG.
Return Values
ALARM_S_NORMAL: The function completed normally and successfully.
ALARM_E_SERVDOWN: The alarm server is not running.
ALARM_E_BADOBJ: Invalid object definition.
See Also
alarm_acknowledge
Syntax
status = alarm_store_acknowledgment_ex( object_name, object_identifier,
ack_time, station, user_id,
permission_key )
C Binding
#include "alarm.h"
extern SCF_STATUS AlarmStoreAcknowledgmentEx(
const char object_name_str[],
ALARM_64BIT_HANDLE object_identifier,
TIMEDATE_HABTIME ack_time,
const char station_str,
const char user_id,
const char permission_key );
Fortran Binding
INTEGER*4 ALARM_STORE_ACKNOWLEDGMENT_EX(
CHARACTER*(*) OBJECT_DEF,
OBJ_ID OBJECT_IDENTIFIER,
TIMEDATE_HABTIME ACK_TIME,
CHARACTER*(*) STATION,
CHARACTER*(*) USER_ID,
CHARACTER*(*) PERMISSION_KEY )
Arguments
object_name
A character string identifying the object definition in the Alarm database. The maximum length of the
string is defined by the ALARM_OBJECT_DEF_MAXLEN constant.
object_identifier
A handle identifying an instance of the object definition. This handle is passed at the time the event is
posted.
station
A character string identifying the station where an operator executed the action that led to this
acknowledgment call. The maximum length of the string is defined by the
ALARM_STATION_NAME_MAXLEN constant. This argument is used for logging purposes only. A special
default name identified by the ALARM_DEFAULT_STATION can be used.
user_id
A character string that specifies either the OS user login ID or the subsystem permissions ID based on
how the system is configured.
permission_key
A character string that identifies the area under which the alarm is requested to be acknowledged.
An asterisk in this field will act as a wildcard and will acknowledge the alarm for all assigned
permission areas.
Description
This function stores an acknowledgment request of all the related alarms associated with a database
object. It is assumed that the client will at some point invoke the alarm_flush_acknowledgments
function to send to the Alarm server all the requests that have been previously stored.
If some unacknowledged alarms are indeed associated with the object and if the client did an earlier
call to the alarm_enum_unack_objects_ex function, the “ack” callback will be invoked once the Alarm
server has performed the acknowledgment operation.
If no unacknowledged alarm is associated with the object and if the client did an earlier call to the
alarm_enum_unack_objects_ex function, the “ack” callback will be invoked with the
ALARM_W_NOUNACKFOUND status.
If an invalid object definition is specified, the request will be discarded and a message will be written
in the default application LOG.
This extended function should be used for events that are posted using the extended functions.
Return Values
ALARM_S_NORMAL: The function completed normally and successfully.
ALARM_E_SERVDOWN: The alarm server is not running.
ALARM_E_BADOBJ: Invalid object definition.
See Also
alarm_store_acknowledgment
alarm_acknowledge
Syntax
status = alarm_store_acknowledgment_ex2( object_name, composite_id,
ack_time, user_id,
permission_key )
C Binding
#include "alarm.h"
extern SCF_STATUS AlarmStoreAcknowledgmentEx2 (
const char object_name_str[],
const char composite_id,
TIMEDATE_HABTIME ack_time,
USER_IDENTIFICATION user_id,
const char permission_key );
Fortran Binding
INTEGER*4 ALARM_STORE_ACKNOWLEDGMENT_EX2(
CHARACTER*(*) OBJECT_DEF,
CHARACTER*(*) COMPOSITE_ID,
TIMEDATE_HABTIME ACK_TIME,
INTEGER*4 USER_ID,
CHARACTER*(*) PERMISSION_KEY )
Arguments
object_name
A character string identifying the object definition in the Alarm database. The maximum length of the
string is defined by the ALARM_OBJECT_DEF_MAXLEN constant.
composite_id
Represents a string identifying a particular instance of the object definition. This string is passed at
the time the event is posted.
user_id
This structure contains the user information for the event. This information includes the user name,
the PC name, and the station name. This is used for logging purposes only when filling in proxies in
the alarm text.
permission_key
A character string that identifies the area under which the alarm is requested to be deleted.
Description
This function stores an acknowledgment request of all the related alarms associated with a database
object. It is assumed that the client will at some point invoke the alarm_flush_acknowledgments
function to send to the Alarm server all the requests that have been previously stored.
If some unacknowledged alarms are indeed associated with the object and if the client did an earlier
call to the alarm_enum_unack_objects_ex function, the “ack” callback will be invoked once the Alarm
server has performed the acknowledgment operation.
If no unacknowledged alarm is associated with the object and if the client did an earlier call to the
alarm_enum_unack_objects_ex function, the “ack” callback will be invoked with the
ALARM_W_NOUNACKFOUND status.
If an invalid object definition is specified, the request will be discarded and a message will be written
in the default application LOG.
This extended function should be used for events that are posted using the extended functions.
Return Values
ALARM_S_NORMAL: The function completed normally and successfully.
ALARM_E_SERVDOWN: The alarm server is not running.
ALARM_E_BADOBJ: Invalid object definition.
See Also
alarm_store_acknowledgment
alarm_store_acknowledgment_ex
alarm_acknowledge
alarm_acknowledge_ex
Syntax
status = alarm_store_acknowledgment_ex3( object_name, object_mrid,
object_comp_key, ack_time,
user_id, permission_key,
application_name )
C Binding
#include "alarm.h"
extern SCF_STATUS AlarmStoreAcknowledgmentEx3 (
const char object_name_str[],
AlarmMrid object_mrid[],
AlarmCompositeKey object_comp_key,
TIMEDATE_HABTIME ack_time,
USER_IDENTIFICATION user_id,
const char permission_key,
const char application_name_str[] );
Fortran Binding
None
Arguments
object_name
A character string identifying the object definition in the Alarm database. The maximum length of the
string is defined by the ALARM_OBJECT_DEF_MAXLEN constant.
object_mrid
Represents a string identifying the object to acknowledge. This string is passed at the time the event
is posted. The maximum length of the string is defined by the ALARM_MRID_MAXLEN constant. Either
object_mrid or object_comp_key must be provided.
ack_time
A TIMEDATE time indicating when the alarms on the object have been acknowledged. If a null value is
passed, the current time is assumed by the API.
user_id
This structure contains the user information for the event. This information includes the user name,
the PC name, and the station name. This is used for logging purposes only when filling in proxies in
the alarm text.
permission_key
A character string that identifies the area under which the alarm is requested to be deleted.
application_name
A character string identifying the application for the object definition in the Alarm database. The
maximum length of the string is defined by the ALARM_APPLICATION_NAME_MAXLEN constant. It is
only used by the Replay application.
Description
This function stores an acknowledgment request of all the related alarms associated with a database
object. It is assumed that the client will at some point invoke the alarm_flush_acknowledgments
function to send to the Alarm server all the requests that have been previously stored.
If some unacknowledged alarms are indeed associated with the object and if the client did an earlier
call to the alarm_enum_unack_objects_ex3 function, the “ack” callback will be invoked once the
Alarm server has performed the acknowledgment operation.
If no unacknowledged alarm is associated with the object and if the client did an earlier call to the
alarm_enum_unack_objects_ex3 function, the “ack” callback will be invoked with the
ALARM_W_NOUNACKFOUND status.
If an invalid object definition is specified, the request will be discarded and a message will be written
in the default application LOG.
This extended function should be used for events that are posted using the extended functions.
Return Values
ALARM_S_NORMAL: The function completed normally and successfully.
ALARM_E_SERVDOWN: The alarm server is not running.
ALARM_E_BADOBJ: Invalid object definition.
See Also
alarm_store_acknowledgment
alarm_store_acknowledgment_ex
alarm_store_acknowledgment_ex2
alarm_acknowledge
Syntax
status = alarm_store_event ( event_block, version )
C Binding
#include "alarm.h"
extern SCF_STATUS AlarmStoreEvent(
ALARM_EVENT_BLOCK event_block,
version );
Fortran Binding
INTEGER*4 ALARM_STORE_EVENT( INTEGER*4 EVENT_BLOCK,
INTEGER*4 VERSION )
Arguments
event_block
See the description for the alarm_post_event function.
version
Should have the value ALARM_API_VERSION directly from alarm.h or alarm.inc. This argument
identifies the version of the interface definition. If the structure that is part of the API changes in the
future, the ALARM_API_VERSION will change so that it will be possible for the API to determine
whether it must convert an old structure being referenced by the user into the latest structure prior to
processing.
Description
This function stores an event in an internal buffer managed by the Alarm API. Multiple events can be
stored in this buffer and can then be sent to the Alarm server with a call to the alarm_flush_events
function. By default, the maximum number of events stored is 4000. If the environment variable
alarm_events_buffered_max is defined, the API will use this value instead.
This function should be used by clients that have called the alarm_use_hdbha function when they
detect an event outside of an Hdb update transaction. It can also be used by a regular client for
optimization purposes, since the number of I/O operations is reduced compared to multiple calls to
the alarm_post_event function.
A “sanity check” and a lookup for exceptions, categories, and locations will be performed before
storing the buffer.
See Also
alarm_post_event
Syntax
status = alarm_store_event_ex ( event_block, version )
C Binding
#include "alarm.h"
extern SCF_STATUS AlarmStoreEventEx(
ALARM_EVENT_BLOCK_EX event_block,
int version );
Fortran Binding
INTEGER*4 ALARM_STORE_EVENT_EX( INTEGER*4 EVENT_BLOCK,
INTEGER*4 VERSION )
Arguments
event_block_ex
See the description for the alarm_post_event_ex function.
version
Should have the value ALARM_API_VERSION directly from alarm.h or alarm.inc. This argument
identifies the version of the interface definition. If the structure that is part of the API changes in the
future, the ALARM_API_VERSION will change so that it will be possible for the API to determine
whether it must convert an old structure being referenced by the user into the latest structure prior to
processing.
Description
This function stores an event in an internal buffer managed by the Alarm API. Multiple events can be
stored in this buffer and can then be sent to the Alarm server with a call to the alarm_flush_events
function. By default, the maximum number of events stored is 4000. If the environment variable
alarm_events_buffered_max is defined, the API will use this value instead.
This function should be used by clients that have called the alarm_use_hdbha function when they
detect an event outside of an Hdb update transaction. It can also be used by a regular client for
optimization purposes, since the number of I/O operations is reduced compared to multiple calls to
the alarm_post_event_ex function.
A “sanity check” and a lookup for exceptions, categories, and locations will be performed before
storing the buffer.
Return Values
ALARM_S_NORMAL: The function completed normally and successfully.
ALARM_E_SERVDOWN: The alarm server is not running.
ALARM_W_INVALIDEXC: Exception not defined in the Alarm database.
ALARM_W_INVALIDCAT: Category not defined in the Alarm database.
ALARM_W_INVALIDLOC: Location not defined in the Alarm database.
See Also
alarm_post_event_ex
alarm_post_event
Syntax
status = alarm_store_event_ex2 ( event_block, user_id, version )
C Binding
#include "alarm.h"
extern SCF_STATUS AlarmStoreEventEx2(
ALARM_EVENT_BLOCK_EX2 event_block,
USER_IDENTIFICATION user_id,
int version );
Fortran Binding
INTEGER*4 ALARM_STORE_EVENT_EX2( INTEGER*4 EVENT_BLOCK,
INTEGER*4 USER_ID,
INTEGER*4 VERSION )
Arguments
event_block_ex2
See the description for the alarm_post_event_ex2 function.
user_id
This structure contains the user information for the event. This information includes the user name,
the PC name, and the station name. This is used for logging purposes only when filling in proxies in
the alarm text.
version
Should have the value ALARM_API_VERSION directly from alarm.h or alarm.inc. This argument
identifies the version of the interface definition. If the structure that is part of the API changes in the
future, the ALARM_API_VERSION will change so that it will be possible for the API to determine
whether it must convert an old structure being referenced by the user into the latest structure prior to
processing.
Description
This function stores an event in an internal buffer managed by the Alarm API. Multiple events can be
stored in this buffer and can then be sent to the Alarm server with a call to the alarm_flush_events
function. By default, the maximum number of events stored is 4000. If the environment variable
alarm_events_buffered_max is defined, the API will use this value instead.
Return Values
ALARM_S_NORMAL: The function completed normally and successfully.
ALARM_E_SERVDOWN: The alarm server is not running.
ALARM_W_INVALIDEXC: Exception not defined in the Alarm database.
ALARM_W_INVALIDCAT: Category not defined in the Alarm database.
ALARM_W_INVALIDLOC: Location not defined in the Alarm database.
See Also
alarm_post_event
alarm_post_event_ex
alarm_post_event_ex2
Syntax
status = alarm_store_event_ex3 ( event_block, user_id, version )
C Binding
#include "alarm.h"
extern SCF_STATUS AlarmStoreEventEx3(
ALARM_EVENT_BLOCK_EX3* event_block,
USER_IDENTIFICATION user_id,
int version );
Fortran Binding
Not supported
Arguments
event_block_ex3
See the description for the alarm_post_event_ex3 function.
user_id
This structure contains the user information for the event. This information includes the user name,
the PC name, and the station name. This is used for logging purposes only when filling in proxies in
the alarm text.
version
This argument has the value ALARM_API_VERSION directly from alarm.h. It identifies the version of
the interface definition. If the structure that is part of the API changes in the future,
ALARM_API_VERSION changes so that it is possible for the API to determine whether it must convert
an old structure, being referenced by the user, into the latest structure prior to processing.
Description
This function stores an event in an internal buffer managed by the Alarm API. Multiple events can be
stored in this buffer and can then be sent to the Alarm server with a call to the alarm_flush_events
function. By default, the maximum number of stored events is 4000. If the environment variable
alarm_events_buffered_max is defined, the API uses this value instead.
This function should be used by clients that have called the alarm_use_hdbha function when they
detect an event outside of an Hdb update transaction. It can also be used by a regular client for
Return Values
ALARM_S_NORMAL: The function completed normally and successfully.
ALARM_E_SERVDOWN: The alarm server is not running.
ALARM_W_INVALIDEXC: Exception not defined in the Alarm database.
ALARM_W_INVALIDCAT: Category not defined in the Alarm database.
ALARM_W_INVALIDLOC: Location not defined in the Alarm database.
See Also
alarm_post_event_ex3
Syntax
status = alarm_store_event_ex4 ( event_block, user_id, version )
C Binding
#include "alarm.h"
extern SCF_STATUS AlarmStoreEventEx4(
ALARM_EVENT_BLOCK_EX4* event_block,
USER_IDENTIFICATION user_id,
int version );
Fortran Binding
Not supported.
Arguments
event_block_ex4
See the description for the alarm_post_event_ex4 function.
user_id
This structure contains user information for the event. This information includes the user name, the
PC name, and the station name. This is used for logging purposes only when filling in proxies in the
alarm text.
version
This argument has the value ALARM_API_VERSION directly from alarm.h. It identifies the version of
the interface definition. If the structure that is part of the API changes in the future,
ALARM_API_VERSION changes so that it is possible for the API to determine whether it must convert
an old structure, being referenced by the user, into the latest structure prior to processing.
Description
This function stores an event in an internal buffer managed by the Alarm API. Multiple events can be
stored in this buffer and can then be sent to the Alarm server with a call to the alarm_flush_events
function. By default, the maximum number of stored events is 4,000. If the environment variable
alarm_events_buffered_max is defined, the API uses this value instead.
This function should be used by clients that have called the alarm_use_hdbha function when they
detect an event outside of an Hdb update transaction. It can also be used by a regular client for
Return Values
ALARM_S_NORMAL: The function completed normally and successfully.
ALARM_E_SERVDOWN: The alarm server is not running.
ALARM_W_INVALIDEXC: Exception not defined in the Alarm database.
ALARM_W_INVALIDCAT: Category not defined in the Alarm database.
ALARM_W_INVALIDLOC: Location not defined in the Alarm database.
See Also
alarm_post_event_ex4
Syntax
status = alarm_store_event_ex5 ( event_block, user_id, version )
C Binding
#include "alarm.h"
extern SCF_STATUS AlarmStoreEventEx5(
ALARM_EVENT_BLOCK_EX5* event_block,
USER_IDENTIFICATION user_id,
int version );
Fortran Binding
Not supported.
Arguments
event_block_ex5
See the description for the alarm_post_event_ex4 function.
user_id
This structure contains user information for the event. This information includes the user name, the
PC name, and the station name. This is used for logging purposes only when filling in proxies in the
alarm text.
version
This argument has the value ALARM_API_VERSION directly from alarm.h. It identifies the version of
the interface definition. If the structure that is part of the API changes in the future,
ALARM_API_VERSION changes so that it is possible for the API to determine whether it must convert
an old structure, being referenced by the user, into the latest structure prior to processing.
Description
This function stores an event in an internal buffer managed by the Alarm API. Multiple events can be
stored in this buffer and can then be sent to the Alarm server with a call to the alarm_flush_events
function. By default, the maximum number of stored events is 4,000. If the environment variable
alarm_events_buffered_max is defined, the API uses this value instead.
This function should be used by clients that have called the alarm_use_hdbha function when they
detect an event outside of an Hdb update transaction. It can also be used by a regular client for
Return Values
ALARM_S_NORMAL: The function completed normally and successfully.
ALARM_E_SERVDOWN: The Alarm server is not running.
ALARM_W_INVALIDEXC: Exception not defined in the Alarm database.
ALARM_W_INVALIDCAT: Category not defined in the Alarm database.
ALARM_W_INVALIDLOC: Location not defined in the Alarm database.
See Also
alarm_post_event_ex5
Syntax
alarm_subscribe( event_cb, ack_cb, del_cb, options, userarg )
C Binding
#include "alarm.h"
void AlarmSubscribe( ALARM_SUBSCRIBE_EVENT_CALLBACK event_cb,
ALARM_SUBSCRIBE_ACK_CALLBACK ack_cb,
ALARM_SUBSCRIBE_DEL_CALLBACK del_cb,
int options,
CCA_USERARG userarg );
Fortran Binding
None
Arguments
event_cb
A callback function to be executed when the alarm has been signaled. If the address of this function is
set to 0, then no callback will be sent.
typedef void ( *ALARM_SUBSCRIBE_EVENT_CALLBACK ) (
ALARM_SUBSCRIBE_EVENT_BLOCK *event_ptr,
CCA_USERARG userarg );
Where:
• Event_ptr: Contains the information required for the acknowledge callback.
• ALARM_SUBSCRIBE_EVENT_BLOCK structure:
typedef struct
{
char exception_name_str[ ALARM_EXCEPTION_NAME_MAXLEN + 1];
char category_name_str[ ALARM_CATEGORY_NAME_MAXLEN + 1];
char location_name_str[ ALARM_LOCATION_NAME_MAXLEN + 1];
char objdef_name_str[ ALARM_OBJECT_NAME_MAXLEN + 1];
int priority;
CCA_UINT16 ackdel_state; // This is what should
// used by the Alarm
// viewer
CCA_UINT32 color_flags;
#define ALARM_CAT_WHITE 1
#define ALARM_CAT_GREEN 2
#define ALARM_CAT_YELLOW 4
#define ALARM_CAT_ORANGE 8
#define ALARM_CAT_MAGENTA 16
#define ALARM_CAT_RED 32
#define ALARM_CAT_CYAN 64
#define ALARM_CAT_BLUE 128
ALARM_64BIT_HANDLE object_handle;
TIMEDATE_HABDTIME time;
TIMEDATE_HABDTIME field_time;
/*
** The following field is used by the Callout server.
** (it contains the notification list ID),
*/
char additional_info[ 8 + 1];
} ALARM_SUBSCRIBE_EVENT_BLOCK;
Where:
• userarg: Specifies the user data to be passed to the enumeration callback when it is invoked.
ack_cb
A callback function to be executed when the alarm has been acknowledged. If the address of this
function is set to 0, then no callback will be sent.
typedef void ( *ALARM_SUBSCRIBE_ACK_CALLBACK ) (
CCA_UINT32 sequence_number,
const char area_str[ ALARM_PERMISSION_KEY_MAXLEN + 1],
const char area2_str[ ALARM_PERMISSION_KEY_MAXLEN + 1],
const char area3_str[ ALARM_PERMISSION_KEY_MAXLEN + 1],
const char area4_str[ ALARM_PERMISSION_KEY_MAXLEN + 1],
const char area5_str[ ALARM_PERMISSION_KEY_MAXLEN + 1],
CCA_USERARG userarg );
Where:
• sequence_number: An unsigned 32-bit integer that corresponds to a particular event.
• area_str(n): Areas under which the alarm is requested to be deleted.
• userarg: Specifies the user data to be passed to the enumeration callback when it is invoked.
del_cb
A callback function to be executed when the alarm has been selected for deletion. If the address of
this function is set to 0, then no callback will be sent.
typedef void ( *ALARM_SUBSCRIBE_DEL_CALLBACK ) (
CCA_UINT32 sequence_number,
const char area_str[ ALARM_PERMISSION_KEY_MAXLEN + 1],
const char area2_str[ ALARM_PERMISSION_KEY_MAXLEN + 1],
const char area3_str[ ALARM_PERMISSION_KEY_MAXLEN + 1],
const char area4_str[ ALARM_PERMISSION_KEY_MAXLEN + 1],
const char area5_str[ ALARM_PERMISSION_KEY_MAXLEN + 1],
CCA_USERARG userarg );
Where:
• sequence_number: An unsigned 32-bit integer that corresponds to a particular event.
• area_str(s): Areas under which the alarm is requested to be deleted.
options
An integer argument that can have one of two values.
ALARM_SUBSCRIBE_ALL 1
Subscribe all alarms and events available.
ALARM_SUBSCRIBE_CALLOUT 2
Subscribe only those events that will trigger an e-mail or pager message.
userarg
Value that will be passed as an argument to the function invoked for the registration completion.
Description
This function allows an application to subscribe to all events processed by the Alarm server. In
addition, it allows an application to acknowledge and delete notifications generated by the Alarm
server. When the subscription is complete, the Alarm server will return all of the events to the client in
the past x minutes specified by the ALARM_SUBSCRIBE_TIME environment variable. When this
variable is not defined, then no events are returned until an incoming event is detected.
Return Value
None
See Also
alarm_subscribe_ex
alarm_subscribe_ex2
Syntax
alarm_subscribe_ex( event_cb, ack_cb, del_cb, options, userarg )
C Binding
#include "alarm.h"
extern SCF_STATUS AlarmSubscribeEx(
ALARM_SUBSCRIBE_EVENT_CALLBACK_EX event_cb,
ALARM_SUBSCRIBE_ACK_CALLBACK ack_cb,
ALARM_SUBSCRIBE_DEL_CALLBACK del_cb,
int options,
CCA_USERARG userarg );
Fortran Binding
None
Arguments
event_cb
A callback function to be executed when the alarm has been signaled. If the address of this function is
set to 0, then no callback will be sent.
typedef void ( *ALARM_SUBSCRIBE_EVENT_CALLBACK_EX ) (
ALARM_SUBSCRIBE_EVENT_BLOCK_EX *event_ptr,
CCA_USERARG userarg );
Where:
• Event_ptr: Contains the information required for the acknowledge callback.
• ALARM_SUBSCRIBE_EVENT_BLOCK_EX structure:
typedef struct
{
char exception_name_str[ ALARM_EXCEPTION_NAME_MAXLEN + 1];
char category_name_str[ ALARM_CATEGORY_NAME_MAXLEN + 1];
char location_name_str[ ALARM_LOCATION_NAME_MAXLEN + 1];
char objdef_name_str[ ALARM_OBJECT_NAME_MAXLEN + 1];
int priority;
CCA_UINT16 ackdel_state; // This is what should
// used by the Alarm
CCA_UINT32 color_flags;
#define ALARM_CAT_WHITE 1
#define ALARM_CAT_GREEN 2
#define ALARM_CAT_YELLOW 4
#define ALARM_CAT_ORANGE 8
#define ALARM_CAT_MAGENTA 16
#define ALARM_CAT_RED 32
#define ALARM_CAT_CYAN 64
#define ALARM_CAT_BLUE 128
ALARM_64BIT_HANDLE object_handle;
TIMEDATE_HABDTIME time;
TIMEDATE_HABDTIME field_time;
/*
** The following field is used by the Callout server.
** (it contains the notification list ID),
*/
char additional_info[ 8 + 1];
char url_str[ ALARM_URL_MAXLEN + 1];
char guid_str[ ALARM_GUID_MAXLEN + 1];
AlarmMrid object_mrid;
AlarmCompositeKey object_comp_key;
} ALARM_SUBSCRIBE_EVENT_BLOCK_EX;
Where:
• userarg: Specifies the user data to be passed to the enumeration callback when it is invoked.
ack_cb
A callback function to be executed when the alarm has been acknowledged. If the address of this
function is set to 0, then no callback will be sent.
typedef void ( *ALARM_SUBSCRIBE_ACK_CALLBACK ) (
CCA_UINT32 sequence_number,
const char area_str[ ALARM_PERMISSION_KEY_MAXLEN + 1],
const char area2_str[ ALARM_PERMISSION_KEY_MAXLEN + 1],
const char area3_str[ ALARM_PERMISSION_KEY_MAXLEN + 1],
const char area4_str[ ALARM_PERMISSION_KEY_MAXLEN + 1],
const char area5_str[ ALARM_PERMISSION_KEY_MAXLEN + 1],
CCA_USERARG userarg );
Where:
• sequence_number: An unsigned 32-bit integer that corresponds to a particular event.
• area_str(n): Areas under which the alarm is requested to be deleted.
• userarg: Specifies the user data to be passed to the enumeration callback when it is invoked.
del_cb
A callback function to be executed when the alarm has been selected for deletion. If the address of
this function is set to 0, then no callback will be sent.
typedef void ( *ALARM_SUBSCRIBE_DEL_CALLBACK ) (
CCA_UINT32 sequence_number,
const char area_str[ ALARM_PERMISSION_KEY_MAXLEN + 1],
const char area2_str[ ALARM_PERMISSION_KEY_MAXLEN + 1],
const char area3_str[ ALARM_PERMISSION_KEY_MAXLEN + 1],
const char area4_str[ ALARM_PERMISSION_KEY_MAXLEN + 1],
const char area5_str[ ALARM_PERMISSION_KEY_MAXLEN + 1],
CCA_USERARG userarg );
options
An integer argument that can have one of two values.
ALARM_SUBSCRIBE_ALL 1
Subscribe all alarms and events available.
ALARM_SUBSCRIBE_CALLOUT 2
Subscribe only those events that will trigger an e-mail or pager message.
userarg
Value that will be passed as an argument to the function invoked for the registration completion.
Description
This function allows an application to subscribe to all events processed by the Alarm server. In
addition, it allows an application to acknowledge and delete notifications generated by the Alarm
server. When the subscription is complete, the Alarm server will return all of the events to the client in
the past x minutes specified by the ALARM_SUBSCRIBE_TIME environment variable. When this
variable is not defined, no events are returned until an incoming event is detected.
The extended functionality allows for the use of the MRID and Full Composite Key.
Return Value
ALARM_S_NORMAL: The function completed normally and successfully.
ALARM_E_SERVDOWN: The alarm server is not running.
ALARM_E_NOCOMMS: Communication with the Alarm server has been lost.
See Also
alarm_subscribe
alarm_subscribe_ex2
Syntax
alarm_subscribe_ex2( event_cb, ack_cb, del_cb, options, userarg )
C Binding
#include "alarm.h"
extern SCF_STATUS AlarmSubscribeEx2(
ALARM_SUBSCRIBE_EVENT_CALLBACK_EX2 event_cb,
ALARM_SUBSCRIBE_ACK_CALLBACK ack_cb,
ALARM_SUBSCRIBE_DEL_CALLBACK del_cb,
int options,
CCA_USERARG userarg );
Fortran Binding
None
Arguments
event_cb
A callback function to be executed when the alarm has been signaled. If the address of this function is
set to 0, then no callback will be sent.
typedef void ( *ALARM_SUBSCRIBE_EVENT_CALLBACK_EX2 ) (
ALARM_SUBSCRIBE_EVENT_BLOCK_EX2 *event_ptr,
CCA_USERARG userarg );
Where:
• Event_ptr: Contains the information required for the acknowledge callback.
• ALARM_SUBSCRIBE_EVENT_BLOCK_EX2 structure:
typedef struct
{
char exception_name_str[ ALARM_EXCEPTION_NAME_MAXLEN + 1];
char category_name_str[ ALARM_CATEGORY_NAME_MAXLEN + 1];
char location_name_str[ ALARM_LOCATION_NAME_MAXLEN_V6 + 1];
char objdef_name_str[ ALARM_OBJECT_NAME_MAXLEN + 1];
int priority;
CCA_UINT16 ackdel_state; // This is what should
// used by the Alarm
CCA_UINT32 color_flags;
#define ALARM_CAT_WHITE 1
#define ALARM_CAT_GREEN 2
#define ALARM_CAT_YELLOW 4
#define ALARM_CAT_ORANGE 8
#define ALARM_CAT_MAGENTA 16
#define ALARM_CAT_RED 32
#define ALARM_CAT_CYAN 64
#define ALARM_CAT_BLUE 128
ALARM_64BIT_HANDLE object_handle;
TIMEDATE_HABDTIME time;
TIMEDATE_HABDTIME field_time;
/*
** The following field is used by the Callout server.
** (it contains the notification list ID),
*/
char additional_info[ 8 + 1];
char url_str[ ALARM_URL_MAXLEN + 1];
char guid_str[ ALARM_GUID_MAXLEN + 1];
AlarmMrid object_mrid;
AlarmCompositeKey object_comp_key;
} ALARM_SUBSCRIBE_EVENT_BLOCK_EX2;
Where:
• userarg: Specifies the user data to be passed to the enumeration callback when it is invoked.
ack_cb
A callback function to be executed when the alarm has been acknowledged. If the address of this
function is set to 0, then no callback will be sent.
typedef void ( *ALARM_SUBSCRIBE_ACK_CALLBACK ) (
CCA_UINT32 sequence_number,
const char area_str[ ALARM_PERMISSION_KEY_MAXLEN + 1],
const char area2_str[ ALARM_PERMISSION_KEY_MAXLEN + 1],
const char area3_str[ ALARM_PERMISSION_KEY_MAXLEN + 1],
const char area4_str[ ALARM_PERMISSION_KEY_MAXLEN + 1],
const char area5_str[ ALARM_PERMISSION_KEY_MAXLEN + 1],
CCA_USERARG userarg );
Where:
• sequence_number: An unsigned 32-bit integer that corresponds to a particular event.
• area_str(n): Areas under which the alarm is requested to be deleted.
• userarg: Specifies the user data to be passed to the enumeration callback when it is invoked.
del_cb
A callback function to be executed when the alarm has been selected for deletion. If the address of
this function is set to 0, then no callback will be sent.
typedef void ( *ALARM_SUBSCRIBE_DEL_CALLBACK ) (
CCA_UINT32 sequence_number,
const char area_str[ ALARM_PERMISSION_KEY_MAXLEN + 1],
options
An integer argument that can have one of two values.
ALARM_SUBSCRIBE_ALL 1: Subscribe all alarms and events available.
ALARM_SUBSCRIBE_CALLOUT 2: Subscribe only those events that will trigger an e-mail or pager
message.
userarg
Value that will be passed as an argument to the function invoked for the registration completion.
Description
This function allows an application to subscribe to all events processed by the Alarm server. In
addition, it allows an application to acknowledge and delete notifications generated by the Alarm
server. When the subscription is complete, the Alarm server will return all of the events to the client in
the past x minutes specified by the ALARM_SUBSCRIBE_TIME environment variable. When this
variable is not defined, no events are returned until an incoming event is detected.
The extended functionality allows for the use of the MRID and Full Composite Key.
Return Value
ALARM_S_NORMAL: The function completed normally and successfully.
ALARM_E_SERVDOWN: The alarm server is not running.
ALARM_E_NOCOMMS: Communication with the Alarm server has been lost.
See Also
alarm_subscribe
alarm_subscribe_ex
Syntax
alarm_unregister_client ( )
C Binding
#include "alarm.h"
extern void AlarmUnregisterClient();
Fortran Binding
SUBROUTINE ALARM_UNREGISTER_CLIENT()
Arguments
None
Description
This function un-initializes the Alarm API and guarantees the caller that no Alarm-related callbacks
will be invoked after calling this function.
This function is intended to be used by clients that are running on the standby machine in an idle
state and that only want to deal with Alarm callbacks when they are running on the primary machine.
Such clients are typically running under Cfgman control and would only register with Alarm once they
received the enable role. It also allows clients to not connect to the enabled Alarm server when they
are running on the standby with a different database than the one currently used on the primary and
it would not make sense to try to register exceptions, categories, or locations with this Alarm server.
If a client uses the alarm_store_event or alarm_store_ack function, all buffers must be flushed prior
to unregister with Alarm.
The only Alarm API function that can be called after invoking this function is the alarm_register_client
function.
Environment
The caller must be a PPM-compliant application.
Return Value
None
See Also
alarm_register_client
Syntax
alarm_use_hdbha()
C Binding
#include "alarm.h"
extern void AlarmUseHdbha();
Fortran Binding
SUBROUTINE ALARM_USE_HDBHA()
Arguments
None
Description
A client should only call this function if the client has a need to bundle the replication of each event
with the replication of the associated database object. For example, it is critical that a change of state
for a point and the event signaling that change are both replicated on the standby machine. If only
the state were going to the standby before a failover occurs, the alarm would be lost. (However, if
neither of the two reaches the standby machine before a failover, then the alarm will be reissued by
Scada.)
This function should be called before posting any events.
Calling this function has the following implications:
• The client must be an Hdb user.
• Replication only occurs as a result of an Hdb update transaction. To replicate the events, the
alarm client should store its events when outside of an Hdb transaction using the
alarm_store_event function and can only call the alarm_flush_events function from within an
update transaction; failure to do so will result in the task aborting. A single event posting can still
be done using the alarm_post_event function as long as it is invoked from within an update
transaction.
It is possible to disable the calls to the MRS API by defining the ALMAPI_DONT_USE_MRSAPI
environment variable. This should only be used for testing purposes or within a single-computer
environment (such as Grid Simulation).
Return Value
None
See Also
alarm_register_client
8
Refer to the document Introduction to Habitat Programming.
The purpose of the functions provided in the Alarm Performance Test menu is to register
exceptions, categories, and locations to the Alarm API, and then to direct the test program
so that it posts a number of events over a period of time using the exceptions, categories,
and locations that have been registered.
To streamline the registration of exceptions, categories, and locations, an /ALL option is
provided. It instructs the test program to register all the exceptions or categories that are
defined under the application that has been chosen to run the test program. The same
The Alarm API Validation Test menu allows the user to verify whether the specified entries
for the exception, category, or location are valid. The entire list of valid exceptions,
categories, or locations can also be checked.
The purpose of the Alarm Extended Function Test menu is to allow the user to test functions
in addition to those tested on the Alarm API Test menu. These tests allow the user to specify
that a 64-bit object identifier for the alarm be used instead of the object handle. With the
extended functions, it is possible to enter up to five permission areas for each alarm to test
the multiple areas that are now available in Alarm.
The purpose of the Alarm Subscribe Function Test menu is to allow the testing of single
alarm functionality. These functions allow alarms to be deleted, formatted, and
acknowledged, bypassing any displays.
The purpose of the Alarm Extended Ex3 Function Test is to allow users to test functions that
post or store an event with an MRID or a long name.
The purpose of the Alarm Extended Ex5 Function Test is to allow users to test functions that
post or store an event with safety and state flags.
9
In this discussion, it is assumed that only the ALARM codeset needs to be customized. GE recommends that
the ALMAPI codeset not be customized, since it could have ramifications deep into some Habitat tasks that
use the ALARM API.
Important Note: These two scripts require Perl and zip/unzip to be available from the
command line.
Note: The “old” flags in alarm.dbdef have been renamed to start with an “X”. They are
unused in the latest Alarm code.
For more information about changes in Alarm behavior when onlining a new Alarm model,
see section 7.9 Onlining the Alarm Database.
Note: You will need to edit the file from a command prompt with administrator
privileges or you will not be able to save your changes at the end of the editing
session.
6. Once in the editor, locate the <audibleService> tag that designates the beginning of the
default Audible profiles available to all APF users on the console. Paste the Audible
profiles previously copied after the <audibleService> tag.
7. Save the file with these changes.
B L
list full, 21, 22, 25, 27, 28, 29
Browser viewer, 38
log, 27
BUILDLST Command, 16
logging of acknowledgments, 27
C M
category, 5
Memory Replication Service, 104
CIRCLG record, 19
MLF Daemon, 103
client, defined, 4
MLFDMN. See MLF Daemon
Configuration Manager, 103
MLFDMN task, 103
console, 30
MRS, 102
customizing the Alarm source code, 254
MRS task, 20, 21
D N
database object, 5
NIOSOCK, 102
Daylight Saving Time, 10
NOLOG, 8, 9
R
replication, 4, 19, 20, 21, 106, 107, 108, 203, 243, 245