QuickOPC User's Guide and Reference
_EasyUAClient Interface
Members  Example 



OpcLabs.EasyOpcUA Assembly > OpcLabs.EasyOpc.UA.ComTypes Namespace : _EasyUAClient Interface
Exposes OpcLabs.EasyOpc.UA.EasyUAClient to COM clients.
Object Model
_EasyUAClient InterfaceEasyUAInstanceParameters ClassEasyUAAdaptableParameters ClassStringObjectDictionary Class
Syntax
'Declaration
 
<CLSCompliantAttribute(False)>
<ComVisibleAttribute(True)>
<GuidAttribute("910344C0-F2A0-42D2-A65E-F3800437F52A")>
Public Interface _EasyUAClient 
'Usage
 
Dim instance As _EasyUAClient
[CLSCompliant(false)]
[ComVisible(true)]
[Guid("910344C0-F2A0-42D2-A65E-F3800437F52A")]
public interface _EasyUAClient 
[CLSCompliant(false)]
[ComVisible(true)]
[Guid("910344C0-F2A0-42D2-A65E-F3800437F52A")]
public interface class _EasyUAClient 
Example
// This example shows how to read value of a single node, and display it.

#include "stdafx.h"    // Includes "QuickOpc.h", and other commonly used files
#include "ReadValue.h"

namespace _EasyUAClient
{
    void ReadValue::Main()
    {
        // Initialize the COM library
        CoInitializeEx(NULL, COINIT_MULTITHREADED);
        {
            // Instantiate the client object
            _EasyUAClientPtr ClientPtr(__uuidof(EasyUAClient));

            // Perform the operation
            _variant_t value = ClientPtr->ReadValue(
                L"http://opcua.demo-this.com:51211/UA/SampleServer", 
                L"nsu=http://test.org/UA/Data/ ;i=10853");
    
            // Display results
            _variant_t vString;
            vString.ChangeType(VT_BSTR, &value);
            _tprintf(_T("value: %s\n"), (LPCTSTR)CW2CT((_bstr_t)vString));
        }
         // Release all interface pointers BEFORE calling CoUninitialize()
        CoUninitialize();
    }
}
// This example shows how to read value of a single node, and display it.
var Client = new ActiveXObject("OpcLabs.EasyOpc.UA.EasyUAClient");
var value = Client.ReadValue("http://opcua.demo-this.com:51211/UA/SampleServer", "nsu=http://test.org/UA/Data/ ;i=10853");
WScript.Echo("value: " + value);
// This example shows how to read value of a single node, and display it.

class procedure ReadValue.Main;
var
  Client: EasyUAClient;
  Value: OleVariant;
begin
  // Instantiate the client object
  Client := CoEasyUAClient.Create;

  Value := Client.ReadValue(
    'http://opcua.demo-this.com:51211/UA/SampleServer',
    'nsu=http://test.org/UA/Data/ ;i=10853');
  WriteLn('value: ', Value);
end;
// This example shows how to read value of a single node, and display it.

class procedure ReadValue.Main;
var
  Client: OpcLabs_EasyOpcUA_TLB._EasyUAClient;
  Value: OleVariant;
begin
  // Instantiate the client object
  Client := CoEasyUAClient.Create;

  // Obtain value of a node
  try
    Value := Client.ReadValue(
      'http://opcua.demo-this.com:51211/UA/SampleServer',
      'nsu=http://test.org/UA/Data/ ;i=10853');
  except
    on E: EOleException do
    begin
      WriteLn(Format('*** Failure: %s', [E.GetBaseException.Message]));
      Exit;
    end;
  end;

  // Display results
  WriteLn('value: ', Value);
end;
// This example shows how to read value of a single node, and display it.

// Instantiate the client object
$Client = new COM("OpcLabs.EasyOpc.UA.EasyUAClient");

// Perform the operation
try
{
    $value = $Client->ReadValue("http://opcua.demo-this.com:51211/UA/SampleServer", "nsu=http://test.org/UA/Data/ ;i=10853");
}
catch (com_exception $e)
{
    printf("*** Failure: %s\n", $e->getMessage());
    Exit();
}


// Display results
printf("Value: %s\n", $value);
<!-- This example shows how to read value of a single node, and display it. -->
<html>
<body>
<?php

    // Instantiate the client object
    $Client = new COM("OpcLabs.EasyOpc.UA.EasyUAClient");

    // Perform the operation
    $value = $Client->ReadValue("http://opcua.demo-this.com:51211/UA/SampleServer", "nsu=http://test.org/UA/Data/ ;i=10853");

    // Display results
    // Read item value and display it
    printf("Value: %s<br>", $value);

?>
</body>
</html>
# This example shows how to read value of a single node, and display it.

import win32com.client

# Instantiate the client object
client = win32com.client.Dispatch('OpcLabs.EasyOpc.UA.EasyUAClient') 

# Perform the operation
value = client.ReadValue('http://opcua.demo-this.com:51211/UA/SampleServer', 'nsu=http://test.org/UA/Data/ ;i=10853')

# Display results
print('value: ', value)
Rem This example shows how to read value of a single node, and display it.

Public Sub ReadValue_Main_Command_Click()
    OutputText = ""

    ' Instantiate the client object
    Dim Client As New EasyUAClient

    ' Perform the operation
    On Error Resume Next
    Dim value As Variant
    value = Client.ReadValue("http://opcua.demo-this.com:51211/UA/SampleServer", "nsu=http://test.org/UA/Data/ ;i=10853")
    If Err.Number <> 0 Then
        OutputText = OutputText & "*** Failure: " & Err.Source & ": " & Err.Description & vbCrLf
        Exit Sub
    End If
    On Error GoTo 0
    
    ' Display results
    OutputText = OutputText & "value: " & value & vbCrLf
End Sub
Rem This example shows how to read value of a single node, and display it.

Option Explicit

' Instantiate the client object
Dim Client: Set Client = CreateObject("OpcLabs.EasyOpc.UA.EasyUAClient")

' Perform the operation
On Error Resume Next
Dim value: value = Client.ReadValue("http://opcua.demo-this.com:51211/UA/SampleServer", "nsu=http://test.org/UA/Data/ ;i=10853")
If Err.Number <> 0 Then
    WScript.Echo "*** Failure: " & Err.Source & ": " & Err.Description
    WScript.Quit
End If
On Error Goto 0

' Display results
WScript.Echo "value: " & value
Requirements

Target Platforms: .NET Framework: Windows 10, Windows Server 2012, Windows Server 2016; .NET Core, .NET 5: Linux, macOS, Microsoft Windows

See Also

Reference

_EasyUAClient Members
OpcLabs.EasyOpc.UA.ComTypes Namespace