Using the OPC Browsers
Home Product
Details Free 
Demo Pricing &
Ordering Related
Products Support About Us

Back to all documents

Tutorial - Using the OPC Browsers

Introduction:

    What is an "OPC Browser"?
    A Browser is a component that allows you to "discover" what OPC Server(s) are available on a computer, along with the ability to discover the Tags that an OPC Server exposes.

    Sometimes the OPC Server may not be on the local computer, but on a remote computer. For this reason there is also a built in PC/Computer browser too.

    There are two ways to browse:

    • End-user GUI
      meaning that the end-user will use a dialog to navigate and select an oject
    • Programmatically
      meaning that you (the developer) will be able to browse objects and store the results in internal variables for you own use/manipulation.

Browsing Computers

    Displaying a dialog allowing the end-user to roam the network looking for a computer is as easy as one line of code.

    You can store the name of the selected computer into a variable for later use within your program.

    Click here to go to the source code section of the website for more information on how to actually use this feature.

    The screen below shows an example of the dialog that an end-user might use to locate a computer.

Browsing OPC Servers

    Displaying the OPC Server browser and obtaining the selected browser is very simple and takes just one line of code.

    You can store the name of the OPC Server into a variable for later use within your program.

    Click here to go to the Source code section of the website for information on how to actually use this feature.

    The screen below shows an example of the dialog that an end-user might use to specify an OPC Server:

Browsing OPC Tags within an OPC Server

    Once you know the name of an OPC Server you may have a need to easily locate Tags that are unknown during development, or your application is one-such that is definable by the end-user.

    Browsing the Tags available within an OPC Server is as easy as one line of code. Click here to go to the Source code section of the website for more information on how to actually use this feature.

    The screen below shows an example of the dialog that an end-user might use to browse and select a Tag:

Creating your own Browsers

    The OPC Web Client gives you the tools to be able to create your own OPC Server and Group/Tag browsers. This can be useful if you wanted to create a web-based browser, or if you wanted to detect via code the availability of OPC Server(s) and/or Tag(s) etc.

    The source-code section has examples of detecting the available OPC Servers and Tags etc. programmatically.

    The key to writing a good browser is in the coding. Remembering that Tags can be structured into groups means that your application cannot assume anything. The structure of Tags in an OPC Server can be several levels deep and your application needs to be prepared for that.

    Recursion: recursion is a method/function that will call-itself over and over. The use of recursive functions is the best means of implementing a browsing strategy.

    Unless you have a need to create your own browser, we recommend using the dialogs supplied with the OPC Web Client for simplicity and speed of development.

Copyright Software Toolbox, Inc., 1996-2004, All Rights Reserved Worldwide.
148A East Charles Street, Matthews, North Carolina, USA 28105
Phone: 704-849-2773 or 1-888-665-3678 (US), Fax: 704-849-6388
sales@softwaretoolbox.com | support@softwaretoolbox.com