AlarmGenerateEx (statement)
Syntax |
AlarmGenerateEx Project$
,
AlarmId$
,
ResourceId$
,
Message$, DateTime, IsUTC
[
,
UserId$ [
,
RefId$ [
,
Master]]]
|
||||
Parameter | Description | ||||
Project$ |
String. The project to generate the alarm on.
An empty string "" indicates the current project
|
||||
AlarmId$ |
String. The ID of a non-point or point Alarm that is listed in the right-pane of the Workbench>Alarms section.
Note:
Non-point alarms must be a $CIMBASIC alarm type for all details, including the alarm message, to display correctly in an Alarm Viewer.
Point alarms are not $CIMBASIC alarms. As a result, there are limitations and guidelines to be aware of if those alarm IDs are used in the script.
|
||||
ResourceId$ | String. The Resource ID to generate the alarm against. Used to control routing of the alarm. | ||||
Message$ | String. The generated alarm message to display. Note: This string is substituted into the first variable field of the alarm's configured message. | ||||
DateTime | The DateTime parameter depends on the script type. | ||||
CimBasic |
Date
Variant
The Date and Now functions return the Date Variant type.
|
||||
.NET C# | System.DateTime type | ||||
VB .NET | System.DateTime type | ||||
IsUTC | BOOLEAN Whether or not the passed in timestamp is UTC. | ||||
TRUE | The DateTime parameter is a UTC timestamp | ||||
FALSE | The DateTime parameter is not a UTC timestamp | ||||
Note: If you do not use UTC time, you will be responsible for making sure your system’s Time Zone settings, including DST, are properly set.
|
|||||
UserId$ | String (optional). The User ID that generated the alarm. | ||||
RefId$ | String (optional). A Reference ID used to distinguish identical alarms. | ||||
Master | BOOLEAN (optional). By default on a computer with Server Redundancy, alarms sent by the standby computer's Event Manager are ignored. To allow an alarm to be generated from a script on a standby computer, set Master to True. | ||||
CimBasic Example 1 |
|
||||
Example 2 | 'This example displays time in microseconds.
|
||||
.NET C# Example 1 |
|
||||
Example 2 |
|
||||
VB .NET Example |
|
Guidelines: AlarmGenerateEx and AlarmUpdateEx
- Message$ limitations and guidelines.
- Non-Point alarm requirements.
- Point alarm guidelines.
Note: Guidelines also apply to
AlarmGenerate
and
AlarmUpdate
.
Message$ Limitations and Guidelines
Messages that display in the Alarm Viewer draw from the following sources and have the following limitations.
The message, which is a string, is substituted into the first variable field of the alarm's configured message.
Message: User-defined alarm
The substituted string will be the first %s in the Alarm Definition dialog box>Alarm Message field.
|
|||
Message
: Point alarm ID
The substituted string will be the first variable field (%VAL , %ID ) in an Alarm Definition dialog box (or Point Properties dialog box)>Alarm Message field.
However, if a point alarm ID is used in an AlarmGenerateEx or
AlarmUpdateEx
script, because the alarm is not a $CIMBASIC alarm, the message will most likely not display as you would expect.
Examples
The entry in the Alarm Message field includes text and more than one variable
POINT01 is %VAL : %STATE
If the code:
|
|||
Does not include a message |
POINT01 is :BAD FIELD
|
||
Does include a message "Point in alarm state." |
POINT01 is Point in alarm state. BAD FIELD
|
Non-Point Alarm Requirements
The alarm definition (in an Alarm Definition dialog box) for a non-point alarm must include the following values.
Alarm type |
$CIMBASIC alarm.
|
Alarm message |
%s
|
Point Alarm Guidelines
When an alarm is generated using a point alarm ID, the alarm that is generated is actually no longer a point alarm.
However, like its point alarm counterpart, it also is not a $CIMBASIC
alarm.
- The alarm message may not display correctly.
- A unique alarm in CIMPLICITY is defined by the Alarm ID, Resource ID and Reference ID combination.
Each unique alarm can be displayed as a distinct entry in the Alarm Viewer.
If the actual point alarm is in alarm state and displays in the Alarm Viewer, using the same alarm ID in:
-
AlarmGenerateEx
will generate a separate alarm from the point alarm. -
AlarmUpdateEx
will acknowledge and/or reset the actual alarm depending on the command(s).
Note: If only the generated alarm is listed
AlarmUpdateEx
will acknowledge and/or reset that alarm. Non-unique alarms are stacked, so that the user only sees the most recent occurrence. In general, the Resource ID is used to control the routing of alarms to users. The Reference ID is used by an application to distinguish between different instances of the same alarm.