<< Click to Display Table of Contents >>
ReportFailure |
ReportFailure(FailureName, FailureDescription, FailureWeight)
This method allows an application to report failures to a Server, which can be viewed by right-clicking Elipse Power's icon on Windows Notification Area. When this method is used, Elipse Power's icon on Windows Notification Area starts blinking in red, indicating that a failure occurred. Reported failures are usually conditions preventing an application from working partially, such as problems with communication on a serial port, inactive network link, or database without connection, and that usually cannot be detected by a Server. This method can be used to warn a system operator about problems in a server and also to help the automatic Hot-Standby manager to decide which server is more suitable to execute an application.
NOTE |
This method is only available in the Server. |
This method contains the parameters described on the next table.
Parameters of the ReportFailure method
Name |
Description |
---|---|
FailureName |
Contains the name of a user-defined failure. This parameter must be passed to the ClearFailure method when an application detects that this failure is no longer active, such as "FaultCOM1" |
FailureDescription |
Textual description of a user-defined failure, such as "Communication failure at COM1" |
FailureWeight |
Defines a failure's severity or weight. A value of 0 (zero) indicates a warning without severity. Values greater than 0 (zero) indicate failures. The greater the value, the severer the failure |
The next script contains an example of using this method.
Sub TagSerialStatus_OnValueChanged()
If Value Then
' The tag value is True, application is on error
Application.ReportFailure "FAULT_COM1", _
"Communication fault at COM1 port", 100
Else
' The tag value is False, clears the failure
Application.ClearFailure "FAULT_COM1"
End If
End Sub