OPC Studio User's Guide and Reference
ServiceResult Property (UAServiceException)



OpcLabs.EasyOpcUA Assembly > OpcLabs.EasyOpc.UA Namespace > UAServiceException Class : ServiceResult Property
The service result (combines the status code and diagnostic information) associated with the exception.
Syntax
'Declaration
 
Public ReadOnly Property ServiceResult As UAServiceResult
'Usage
 
Dim instance As UAServiceException
Dim value As UAServiceResult
 
instance.ServiceResult = value
 
value = instance.ServiceResult
public UAServiceResult ServiceResult {get;}
public:
property UAServiceResult^ ServiceResult {
   UAServiceResult^ get();
}

Property Value

The value of this property cannot be null (Nothing in Visual Basic).

Because there is an implicit conversion to UACodeBits from UAServiceResult, you can simply use the return value in place of a UACodeBits (representing the code bits of the status code). When the implicit conversion operators are not supported (such as with Python.NET), you can use the UAServiceResult.ToUACodeBits method instead.

Remarks

This property has the necessary information if you want to test for a specific OPC UA error. In most cases, you can use the fact that there is an implicit conversion from UAServiceResult to System.Int32, and make a comparison of the ServiceResult with some value from the UACodeBits class easily.

The getter method of this property is pure, i.e. it does not have observable side effects.

Requirements

Target Platforms: .NET Framework: Windows 10 (selected versions), Windows 11 (selected versions), Windows Server 2016, Windows Server 2022; .NET: Linux, macOS, Microsoft Windows

See Also