QuickOPC User's Guide and Reference
UAStatusCode Class
Members  Example 



OpcLabs.EasyOpcUA Assembly > OpcLabs.EasyOpc.UA Namespace : UAStatusCode Class
A status code that describes the result of a service or operation.
Syntax
'Declaration
 
<ComDefaultInterfaceAttribute(OpcLabs.EasyOpc.UA.ComTypes._UAStatusCode)>
<ComVisibleAttribute(True)>
<GuidAttribute("7E377F45-8FD7-4193-A3BD-090E04864AE5")>
<TypeConverterAttribute(OpcLabs.EasyOpc.UA.Implementation.UAStatusCodeTypeConverter)>
<CLSCompliantAttribute(True)>
<ValueControlAttribute("OpcLabs.BaseLib.Forms.Common.ObjectSerializationControl, OpcLabs.BaseLibForms, Version=5.72.465.1, Culture=neutral, PublicKeyToken=6faddca41dacb409", 
   DefaultReadWrite=False, 
   Export=True, 
   PageId=10001)>
<SerializableAttribute()>
Public NotInheritable Class UAStatusCode 
   Inherits OpcLabs.BaseLib.Info
   Implements LINQPad.ICustomMemberProvider, OpcLabs.BaseLib.ComTypes._Info, OpcLabs.BaseLib.ComTypes._Object2, OpcLabs.EasyOpc.UA.ComTypes._UAStatusCode, System.ICloneable, System.IFormattable, System.Runtime.Serialization.ISerializable, System.Xml.Serialization.IXmlSerializable 
'Usage
 
Dim instance As UAStatusCode
[ComDefaultInterface(OpcLabs.EasyOpc.UA.ComTypes._UAStatusCode)]
[ComVisible(true)]
[Guid("7E377F45-8FD7-4193-A3BD-090E04864AE5")]
[TypeConverter(OpcLabs.EasyOpc.UA.Implementation.UAStatusCodeTypeConverter)]
[CLSCompliant(true)]
[ValueControl("OpcLabs.BaseLib.Forms.Common.ObjectSerializationControl, OpcLabs.BaseLibForms, Version=5.72.465.1, Culture=neutral, PublicKeyToken=6faddca41dacb409", 
   DefaultReadWrite=false, 
   Export=true, 
   PageId=10001)]
[Serializable()]
public sealed class UAStatusCode : OpcLabs.BaseLib.Info, LINQPad.ICustomMemberProvider, OpcLabs.BaseLib.ComTypes._Info, OpcLabs.BaseLib.ComTypes._Object2, OpcLabs.EasyOpc.UA.ComTypes._UAStatusCode, System.ICloneable, System.IFormattable, System.Runtime.Serialization.ISerializable, System.Xml.Serialization.IXmlSerializable  
[ComDefaultInterface(OpcLabs.EasyOpc.UA.ComTypes._UAStatusCode)]
[ComVisible(true)]
[Guid("7E377F45-8FD7-4193-A3BD-090E04864AE5")]
[TypeConverter(OpcLabs.EasyOpc.UA.Implementation.UAStatusCodeTypeConverter)]
[CLSCompliant(true)]
[ValueControl("OpcLabs.BaseLib.Forms.Common.ObjectSerializationControl, OpcLabs.BaseLibForms, Version=5.72.465.1, Culture=neutral, PublicKeyToken=6faddca41dacb409", 
   DefaultReadWrite=false, 
   Export=true, 
   PageId=10001)]
[Serializable()]
public ref class UAStatusCode sealed : public OpcLabs.BaseLib.Info, LINQPad.ICustomMemberProvider, OpcLabs.BaseLib.ComTypes._Info, OpcLabs.BaseLib.ComTypes._Object2, OpcLabs.EasyOpc.UA.ComTypes._UAStatusCode, System.ICloneable, System.IFormattable, System.Runtime.Serialization.ISerializable, System.Xml.Serialization.IXmlSerializable  
Example

.NET

// This example shows how the OPC UA status codes are formatted to a string containing their symbolic name.

using System;
using OpcLabs.EasyOpc.UA;

namespace UADocExamples._UAStatusCode
{
    class ToString
    {
        public static void Main1()
        {
            long[] internalValueArray = { 0, 0x80010000, 2147614720, 0x80340000 };

            foreach (long internalValue in internalValueArray)
                Console.WriteLine($"{internalValue}: {new UAStatusCode(internalValue)}");


            // Example output:
            //0: Good
            //2147549184: BadUnexpectedError
            //2147614720: BadInternalError
            //2150891520: BadNodeIdUnknown
        }
    }
}
# This example shows how the OPC UA status codes are formatted to a string containing their symbolic name.

# The QuickOPC package is needed. Install it using "pip install opclabs_quickopc".
import opclabs_quickopc

# Import .NET namespaces.
from System import *
from OpcLabs.EasyOpc.UA import *


internalValueArray = [0, 0x80010000, 2147614720, 0x80340000]

for internalValue in internalValueArray:
    print(internalValue, ': ', UAStatusCode(internalValue), sep='')

print()
print('Finished.')


# Example output:
# 0: Good
# 2147549184: BadUnexpectedError
# 2147614720: BadInternalError
# 2150891520: BadNodeIdUnknown
#
# Finished.
Inheritance Hierarchy

System.Object
   OpcLabs.BaseLib.Object2
      OpcLabs.BaseLib.Info
         OpcLabs.EasyOpc.UA.UAStatusCode

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