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.

How to write to a struct array

More
25 Aug 2021 14:36 #10144 by goosvanbeek
Hello Support,

I tested with the Nuget version and it's working as expected!
Thank you for resolving this issue quickly!

Best regards.
The following user(s) said Thank You: support

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

More
25 Aug 2021 11:12 #10141 by support
Hello.

The problem should be fixed now. Thank you for reporting it.

Please download the recent QuickOPC 2021.2 build, and rebuild with it. It should report itself as 5.61.343.1 or higher. It is both on NuGet and as standalone installer on our Web page.

Best regards
The following user(s) said Thank You: goosvanbeek

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

More
24 Aug 2021 09:56 #10136 by support
Thank you. I was able to extract the files, get the server running, and also run your code and reproduce the issue.

Writing from UaExpert worked well, so I went on to analyze the difference. UaExpert is writing an array of ExtensionObject-s, while QuickOPC an array of Variant-s, each of which contains an ExtensionObject, and this seems to be causing the problem. This looks like a bug in QuickOPC. I will investigate further and let you know when I have an update on the issue.

Best regards
The following user(s) said Thank You: goosvanbeek

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

More
23 Aug 2021 18:01 #10135 by goosvanbeek
I packed the files as .zip this time. The file contains .exe and .dll files. Could that be the reason that the .rar file couldn't be opened?

File Attachment:

File Name: OpcUaStruc...rver.zip
File Size:1,407 KB
Attachments:

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

More
22 Aug 2021 14:11 #10131 by support
Hello.

Neither WinZip nor 7zip are able to open the RAR file you have attached.
Can you please check, and possibly post in a different format.

Best regards

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

More
19 Aug 2021 10:23 #10127 by support
I will work on this next week when I am back in the office.
The following user(s) said Thank You: goosvanbeek

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

More
18 Aug 2021 13:04 #10125 by goosvanbeek
QuickOpc 5.61.241
I'm still struggling with the writing of a struct array. I can read the array objects and alter the values, but when I write the values to the server, the datatype becomes an unsupported datatype.
namespace OpcUaTestConsole{
    #region usings
    using System;
    using OpcLabs.BaseLib.DataTypeModel;
    using OpcLabs.EasyOpc.UA;
    using OpcLabs.EasyOpc.UA.ComplexData;
    #endregion
    public static class Program{
        private static readonly UAEndpointDescriptor UaEndpointDescriptor = "opc.tcp://localhost:48030/";
        private static readonly UANodeDescriptor     UaNodeDescriptor     = "ns=2;i=6016";
        public static void Main(){
            ReadAndSaveArrayData();
            Console.ReadKey();
        }
        private static void ReadAndSaveArrayData(){
            using(var client = new EasyUAClient()){
                var readValue = client.ReadValue(UaEndpointDescriptor, UaNodeDescriptor);
                if(!(readValue is Array bundleInfoArray)){
                    return;
                }
                foreach(var value in bundleInfoArray){
                    if(!(value is UAGenericObject bundleInfo)){
                        continue;
                    }
                    var fieldData = (((StructuredData)bundleInfo.GenericData)?.FieldData);
                    if(fieldData is null){
                        continue;
                    }
                    var batchCode      = ((PrimitiveData)fieldData["BatchCode"]).Value?.ToString();
                    var bundleCode     = ((PrimitiveData)fieldData["BundleCode"]).Value?.ToString();
                    var boardCount     = int.Parse(((PrimitiveData)fieldData["BoardCount"]).Value?.ToString()     ?? "0");
                    var boardLength    = int.Parse(((PrimitiveData)fieldData["BoardLength"]).Value?.ToString()    ?? "0");
                    var boardWidth     = int.Parse(((PrimitiveData)fieldData["BoardWidth"]).Value?.ToString()     ?? "0");
                    var boardThickness = int.Parse(((PrimitiveData)fieldData["BoardThickness"]).Value?.ToString() ?? "0");
 
                    ((PrimitiveData)fieldData["BatchCode"]).Value      = "12854";
                    ((PrimitiveData)fieldData["BundleCode"]).Value     = "XYZ-159782";
                    ((PrimitiveData)fieldData["BoardCount"]).Value     = boardCount     + 1;
                    ((PrimitiveData)fieldData["BoardLength"]).Value    = boardLength    + 1;
                    ((PrimitiveData)fieldData["BoardWidth"]).Value     = boardWidth     + 1;
                    ((PrimitiveData)fieldData["BoardThickness"]).Value = boardThickness + 1;
                }
                client.WriteValue(UaEndpointDescriptor, UaNodeDescriptor, bundleInfoArray);
            }
        }
    }
}
I also attached the test server.

Hope you can point me in the right direction.

Best regards,
Goos van Beek.

File Attachment:

File Name: OpcUaStruc...rver.rar
File Size:1,092 KB
Attachments:

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

More
13 Aug 2021 12:25 #10107 by goosvanbeek
Thanks for the support and best regards!

Attachments:
The following user(s) said Thank You: support

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

More
03 Aug 2021 05:06 #10090 by support
Yes, I think this is the case.

Can you please do me a favour? I would like to obtain following information, for improving our error diagnostics in the future: Connect to your server in UaExpert,
find the Server -> ServerStatus -> BuildInfo variable, put it into the Data Access view, and then double-click in the Value column to display the information, and provide a screenshot.

That would be very helpful.

Thank you, and best regards

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

More
01 Aug 2021 10:31 #10084 by goosvanbeek
Hello,

My bad, I forgot to test with another client.

So I did a test with UaExpert and the result is a little bit disappointing for me.
The test also triggered an exception; BadWriteNotSupported (see the attachment).

It seems that it is not possible to use a structured array with this OPCC server.

Best regards,
Goos van Beek.
Attachments:

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

Moderators: support
Time to create page: 0.272 seconds