Professional OPC
Development Tools

logos

XML DA: COMException(0x800401F3): Invalid class string

More
11 Jun 2018 08:13 #6422 by goosvanbeek
Thanks for your reply. Now it's clear to me.
I'll use the eventhandler method instead.


Regards,
Goos van Beek.

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

More
11 Jun 2018 07:38 #6421 by support
OPC XML servers are not addressed by machine name/serverclass, but by a single URL. With OPC XML servers, you cannot use the SubscribeItem overloads or extensions methods that use MachineName and ServerClass. The list of available extension methods is here: opclabs.doc-that.com/files/onlinedocs/QuickOpc/Latest/User%2...ntExtension~SubscribeItem.html .

If you want a callback (lambda) at the same, and to specify percent deadband (which is part of GroupParameters), this leaves you with the following method only:

- opclabs.doc-that.com/files/onlinedocs/QuickOpc/Latest/User%2...angedEventHandler,Object).html

As the serverDecriptor argument, you can simply use the URL, there is an implicit conversion from string to ServerDescriptor. Similarly with itemDescriptor. And, use "new DAGroupParameters(...)" for the groupParameters argument, picking the suitable constructor overload from here: opclabs.doc-that.com/files/onlinedocs/QuickOpc/Latest/User%2...s.DAGroupParameters~_ctor.html .

I hope this helps
Best regards

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

More
11 Jun 2018 07:02 - 11 Jun 2018 07:08 #6420 by goosvanbeek
Thanks for your reply.

See the image below for the exception message. The machine url is the OPC Labs demo server.
Exception image


Connecting to the same server without (all) the named parameters and the same url works fine.
EasyDAClient.SharedInstance.SubscribeItem
            (
                @"http://opcxml.demo-this.com/XmlDaSampleServer/Service.asmx",
                "Dynamic/Analog Types/Double",
                500,
                (sender, eventArgs) => { Console.WriteLine(eventArgs.Exception != null ? $"{eventArgs.Exception.ToString()}" : $"{eventArgs.Vtq}"); },
                null);

Regards,
Goos van Beek.
Last edit: 11 Jun 2018 07:08 by goosvanbeek.

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

More
11 Jun 2018 06:20 - 11 Jun 2018 06:22 #6417 by support
Please post the exception you are getting, including InnerException i present.

Note that the OPC XML servers are not addressed by machine name/serverclass, but by a single URL, so that is the most apprarent issue here
Last edit: 11 Jun 2018 06:22 by support.

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

More
10 Jun 2018 11:10 - 11 Jun 2018 07:07 #6414 by goosvanbeek
Hello support,

I want to use the percentDeadband parameter in a lambda expression, but this causes a comexception.
Can you help me any further?
See the code below to reproduce the exception.
static void Main(){
            EasyDAClient.SharedInstance.SubscribeItem
            (
                machineName:"localhost",
                serverClass:@"http://opcxml.demo-this.com/XmlDaSampleServer/Service.asmx",
                itemId:"Dynamic/Analog Types/Double",
                dataType:VarType.DefaultInternalValue,
                requestedUpdateRate:500,
                percentDeadband:0.1f,
                callback:(sender, eventArgs)=>{Console.WriteLine(eventArgs.Exception != null ? $"{eventArgs.Exception.ToString()}" : $"{eventArgs.Vtq}");},
                state:null);
            Console.ReadKey();
            EasyDAClient.SharedInstance.UnsubscribeAllItems();
        }
Best regards,
Goos van Beek.
Last edit: 11 Jun 2018 07:07 by goosvanbeek.

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

Moderators: support
Time to create page: 0.182 seconds

      

 Recommend this on Google