SignedAlarmAck()
- Last UpdatedJul 22, 2024
- 4 minute read
Acknowledges one or more alarms on tags or attributes, optionally requiring a signature if any of the indicated alarms falls within a designated priority range.
This function is supported only for client scripting and not object scripting.
Category
Miscellaneous
Syntax
int SignedAlarmAck(String Alarm_List,
Boolean Signature_Reqd_for_Range,
Integer Min_Priority,
Integer Max_Priority,
String Default_Ack_Comment,
Boolean Ack_Comment_Is_Editable,
String TitleBar_Caption,
String Message_Caption
);
Parameters
Alarm_List
The list of alarms to be acknowledged. The list must be a single text string with each alarm name separated by a space or a comma.
Data Type
String
Valid Range
Limit 1024 characters
Additional Information
Can be a constant string, a reference, or an expression.
Only alarms on tags or attributes are supported.
If there is any invalid alarm in the list, then none of the alarms are acknowledged.
Examples
Example 1:
"UD1.analog_001.HiHi"
The collection is represented as a text string, with alarms separated by blanks and/or commas.
Example 2:
"UD1.analog_001.HiHi UD9.x14.dev.major"
Example 3:
"UD1.analog_001.HiHi, UD9.x14.dev.major"
Example 4, an array of strings such as:
Pump1.AlarmArray[1] = "Pump1.Level.HiHi"
Pump1.AlarmArray[2] = "Pump1.Level.LoLo"
uses the function as follows:
SignedAlarmAck(Pump1.AlarmArray[ ], ...)
The script passes to the function the following single string:
"Pump1.Level.HiHi, Pump1.Level.LoLo"
Signature_Reqd_for_Range
Indicates whether a signature is required for acknowledging alarms.
Data Type
Bool
Additional Information
Can be a constant, a reference, or an expression.
Min_Priority
Represents the minimum priority value of the range for which the signature is required.
Data Type
Integer
Valid Range
1-999; must be less than or equal to the Max_Priority value.
Additional Information
Can be a constant, a reference, or an expression.
Max_Priority
Represents the maximum priority value of the range for which the signature is required.
Data Type
Integer
Valid Range
1-999; must be greater than or equal to the Min_Priority value.
Additional Information
Can be a constant, a reference, or an expression.
Default_Ack_Comment
Comment to be shown in the Acknowledge Alarms dialog box.
Data Type
String
Valid Range
Limit 200 characters
Additional Information
Can be a constant, a reference or an expression.
If the parameter is empty, then no default comment is shown in the Acknowledge Alarms dialog box.
Ack_Comment_Is_ Editable
Indicates whether the run-time user can modify the acknowledgement comment.
Data Type
Bool
Additional Information
Can be a constant, a reference, or an expression.
If set to False, the Comment box in the Acknowledge Alarms dialog box is unavailable.
TitleBar_Caption
Shows a title in the title bar of the Acknowledge Alarms dialog box.
Data Type
String
Valid Range
Limi 1024 characters
Additional Information
Can be a constant, a reference, or an expression.
If the TitleBar_Caption is empty, the default title, Acknowledge Alarms, is shown.
Message_Caption
Shows a customizable message to the run-time user in the Acknowledge Alarms dialog box.
Data Type
String
Valid Range
Limit 250 characters
Additional Information
Can be a constant, a reference, or an expression.
Use the parameter to provide more information on the alarm to the run-time user.
This message is not propagated to the event record.
Return values
Return values indicate success or failure status. A non-zero value indicates type of failure.
|
-1 |
The user canceled the operation. The function writes a message to the Logger indicating user cancellation. |
|
-2 |
No alarms are waiting for acknowledgement. |
|
0 |
The function is successful and the following are all true:
|
|
1 |
The function failed due to any error that is not covered by the other specified return values. |
|
2 |
One or more parameters were not coerced to the appropriate data type at run time. Example: Parameter is a reference with Boolean as the expected data type. At run time, reference is to a String data type that cannot be coerced to True or False. The function writes a message to the Logger. |
|
3 |
The Alarm_List parameter was not valid at run time.
|
|
4 |
The Min_Priority or MaxPriority values do not fall within the range of 1 to 999. The function writes a message to the Logger indicating which parameter was out of range and showing the actual value. |
|
5 |
The Min_Priority value is greater than the Max_Priority value. The function writes a message to the Logger identifying the problem and showing the actual values. |
Note: A return value of zero does not indicate if the alarms are acknowledged, only that the function wrote to the AckMsg attributes. The alarms may not be acknowledged due to insufficient permission or if the alarms have already been acknowledged.
Remarks
For more information about using the SignedAlarmAck() function, see the topic Signature Security for Acknowledging Alarms, under "Adding and Maintaining Graphic Scripts" in the Creating and Managing Industrial Graphics User Guide.
Examples
Dim n as Integer;
n = SignedAlarmAck("UD1.analog_001.HiHi UD9.x14.dev.major", true, 1, 250, "Acknowledged by script", true, "Acking Tank Alarms", "Acknowledge the tank alarms");
Using an array of strings:
dim arr[2] as String;
arr[1] = "UD1.analog_001.HiHi";
arr[2] = "UD9.x14.dev.major";
n = SignedAlarmAck(arr[], true, 200, 500, "Acked by script", true, "Acking Tank Alarms", "Please acknowledge the tank alarms.");