Professional OPC
Development Tools

logos

Online Forums

Technical support is provided through Support Forums below. Anybody can view them; you need to Register/Login to our site (see links in upper right corner) in order to Post questions. You do not have to be a licensed user of our product.

Please read Rules for forum posts before reporting your issue or asking a question. OPC Labs team is actively monitoring the forums, and replies as soon as possible. Various technical information can also be found in our Knowledge Base. For your convenience, we have also assembled a Frequently Asked Questions page.

Do not use the Contact page for technical issues.

C# example for reading multiple OPC UA tags

More
12 Feb 2016 12:44 #3847 by support
Hello,
thank you for your interest in our products.

For a list of available examples: Start -> OPC Labs -> QuickOPC 5.3 -> Examples (.NET Source Code) -> About Examples,
or www.opclabs.com/files/documents/QuickOpc/Latest/Examples-QuickOPC.pdf .

A VS solution with C# examples: Start -> OPC Labs -> QuickOPC 5.3 -> Examples (.NET Source Code) -> Visual C# Examples.
In that solution, reading of multiple OPC UA tags can be seen in following examples:
  • Console -> UADocExamples -> _EasyUAClient.ReadMultiple.Main
  • Console -> UADocExamples -> _EasyUAClient.ReadMultipleValues.Main

And here is an actual code snippet taken from one of the examples:
public static void Main()
            {
                // Instantiate the client object
                var easyUAClient = new EasyUAClient();
 
                // Obtain attribute data. By default, the Value attributes of the nodes will be read.
                UAAttributeDataResult[] attributeDataResultArray = easyUAClient.ReadMultiple(new[]
                    {
                        new UAReadArguments("http://opcua.demo-this.com:51211/UA/SampleServer", "nsu=http://test.org/UA/Data/;i=10845"),
                        new UAReadArguments("http://opcua.demo-this.com:51211/UA/SampleServer", "nsu=http://test.org/UA/Data/;i=10853"),
                        new UAReadArguments("http://opcua.demo-this.com:51211/UA/SampleServer", "nsu=http://test.org/UA/Data/;i=10855")
                    });
 
                // Display results
                foreach (UAAttributeDataResult attributeDataResult in attributeDataResultArray)
                    Console.WriteLine("AttributeData: {0}", attributeDataResult.AttributeData);
 
                // Example output:
                //
                //AttributeData: 51 {System.Int16} @11/6/2011 1:49:19 PM @11/6/2011 1:49:19 PM; Good
                //AttributeData: -1993984 {System.Single} @11/6/2011 1:49:19 PM @11/6/2011 1:49:19 PM; Good
                //AttributeData: Yellow% Dragon Cat) White Blue Dog# Green Banana- {System.String} @11/6/2011 1:49:19 PM @11/6/2011 1:49:19 PM; Good            
            }


I hope this helps

Best regards
Zbynek Zahradnik

Please Log in or Create an account to join the conversation.

More
12 Feb 2016 12:33 #3846 by support
From: L,
Sent: Friday, February 12, 2016 11:12 AM
To: Z.
Subject: RE: OPC Labs Contact Form - Trial license

Hello Zbynek,

[...] “QuickOPC Standard, [...]. We will use this for an C# OPC UA client reading multiple tags, but I can’t find a C# program example?


Med venlig hilsen/Best regards

Please Log in or Create an account to join the conversation.

Moderators: support
Time to create page: 0.053 seconds