OPC Studio User's Guide and Reference
BrowseSources Method (_EasyAEClient)
Example 



OpcLabs.EasyOpcClassic Assembly > OpcLabs.EasyOpc.AlarmsAndEvents.ComTypes Namespace > _EasyAEClient Interface : BrowseSources Method
Name of the machine. Determines the computer on which the OPC server is located. It may be an empty string, in which case the OPC server is assumed to exist on the local computer or at the computer specified for it by DCOM configuration.

The value represents a UNC or DNS computer name. Any string can be passed to this parameter (i.e. will not cause System.ArgumentException), but not all values make sense and will work when an operation using them is attempted. IPv6 addresses are normally enclosed between '[' and ']'.

The value of this parameter can be null (Nothing in Visual Basic).

Contains ProgID of the OPC server.

The value of this parameter can be null (Nothing in Visual Basic).

Fully qualified name of the parent area to be browsed (empty string for root)

The value of this parameter can be null (Nothing in Visual Basic).

Browses the specified area for child sources. Uses computer name and server class for specifying the OPC server. A parent area is passed in. No filtering.
Syntax
'Declaration
 
<NotNullAttribute()>
Function BrowseSources( _
   ByVal machineName As String, _
   ByVal serverClass As String, _
   ByVal parentQualifiedName As String _
) As AENodeElementCollection
'Usage
 
Dim instance As _EasyAEClient
Dim machineName As String
Dim serverClass As String
Dim parentQualifiedName As String
Dim value As AENodeElementCollection
 
value = instance.BrowseSources(machineName, serverClass, parentQualifiedName)

Parameters

machineName
Name of the machine. Determines the computer on which the OPC server is located. It may be an empty string, in which case the OPC server is assumed to exist on the local computer or at the computer specified for it by DCOM configuration.

The value represents a UNC or DNS computer name. Any string can be passed to this parameter (i.e. will not cause System.ArgumentException), but not all values make sense and will work when an operation using them is attempted. IPv6 addresses are normally enclosed between '[' and ']'.

The value of this parameter can be null (Nothing in Visual Basic).

serverClass
Contains ProgID of the OPC server.

The value of this parameter can be null (Nothing in Visual Basic).

parentQualifiedName
Fully qualified name of the parent area to be browsed (empty string for root)

The value of this parameter can be null (Nothing in Visual Basic).

Return Value

The method returns a keyed collection of OpcLabs.EasyOpc.AlarmsAndEvents.AddressSpace.AENodeElement values, each containing information about a particular source found. The keys of the keyed collection are the names of the sources.

This method never returns null (Nothing in Visual Basic).

The individual elements of the returned value are never null (Nothing in Visual Basic).

Remarks

This member or type is for use from COM. It is not meant to be used from .NET or Python. Refer to the corresponding .NET member or type instead, if you are developing in .NET or Python.

Example

COM

Rem This example shows how to obtain all sources under the "Simulation" area.
Rem
Rem Find all latest examples here: https://opclabs.doc-that.com/files/onlinedocs/OPCLabs-OpcStudio/Latest/examples.html .
Rem OPC client and subscriber examples in VBScript on GitHub: https://github.com/OPCLabs/Examples-QuickOPC-VBScript .
Rem Missing some example? Ask us for it on our Online Forums, https://www.opclabs.com/forum/index ! You do not have to own
Rem a commercial license in order to use Online Forums, and we reply to every post.

Option Explicit

Dim Client: Set Client = CreateObject("OpcLabs.EasyOpc.AlarmsAndEvents.EasyAEClient")
On Error Resume Next
Dim NodeElements: Set NodeElements = Client.BrowseSources("", "OPCLabs.KitEventServer.2", "Simulation")
If Err.Number <> 0 Then
    WScript.Echo "*** Failure: " & Err.Source & ": " & Err.Description
    WScript.Quit
End If
On Error Goto 0

Dim NodeElement: For Each NodeElement In NodeElements
    WScript.Echo "NodeElements(""" & NodeElement.Name & """):"
    With NodeElement
        WScript.Echo Space(4) & ".QualifiedName: " & .QualifiedName
    End With
Next
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