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.

Invalid class string

More
16 Sep 2011 06:20 #492 by support
Replied by support on topic Re: Invalid class string
Your are welcome :-)

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

More
16 Sep 2011 06:14 #491 by KaiSchiffer
Hello,
yes, it was my fault. Had I cared to read some documentation I would probably not have assumed that the address of an OPCServer is a universal invariant. Initializing with the right parameters led to everything working fine. Thanks for your help, an order shall be placed by my company soon :)

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

More
07 Sep 2011 13:41 #480 by support
Replied by support on topic Re: Invalid class string
<span style="font-family: "Tahoma","sans-serif"; font-size: 10pt; mso-fareast-font-family: 'Times New Roman'">From:<span style="font-family: "Tahoma","sans-serif"; font-size: 10pt; mso-fareast-font-family: 'Times New Roman'"> K.
Sent: Wednesday, September 07, 2011 3:10 PM
To: Zbynek Zahradnik
Subject: AW: (Invalid class string)

<span lang="DE" style="font-family: "Arial","sans-serif"; color: navy; font-size: 10pt; mso-ansi-language: DE">Hello <span style="font-family: "Tahoma","sans-serif"; font-size: 10pt">Zbynek,
<span style="font-family: "Tahoma","sans-serif"; font-size: 10pt">
<span style="font-family: "Tahoma","sans-serif"; font-size: 10pt">Thanks a lot for your quick reply!
<span style="font-family: "Tahoma","sans-serif"; font-size: 10pt">I have just taken a quick glance, but I feel that you might have hit the mark.
<span style="font-family: "Tahoma","sans-serif"; font-size: 10pt">Locally I use the same strings for Server Address and Description, and this is not the case on our client’s Server.
<span style="font-family: "Tahoma","sans-serif"; font-size: 10pt">I cannot do anything right now, but will make my next attempt next week.
<span style="font-family: "Tahoma","sans-serif"; font-size: 10pt">I will gladly report at the forum.
<span style="font-family: "Tahoma","sans-serif"; font-size: 10pt">
<span style="font-family: "Tahoma","sans-serif"; font-size: 10pt">For now, thank you very much!

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

More
07 Sep 2011 13:40 #479 by support
Replied by support on topic Re: Invalid class string
<span style="font-family: "Calibri","sans-serif"; color: #1f497d; font-size: 11pt">Hello a bit more,
<span style="font-family: "Calibri","sans-serif"; color: #1f497d; font-size: 11pt">
<span style="font-family: "Calibri","sans-serif"; color: #1f497d; font-size: 11pt">I have now realized that you are effectively printing out the passed-in serverClass inside the event handler. So I can infer that the serverClass you use is “BMA” (or “RLT”). That does not seem right – it really should be server’s ProgID, such as “OPC.LSNProxy_DA_0.1”.
<span style="font-family: "Calibri","sans-serif"; color: #1f497d; font-size: 11pt">
<span style="font-family: "Calibri","sans-serif"; color: #1f497d; font-size: 11pt">Best regards,

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

More
07 Sep 2011 13:39 #478 by support
Replied by support on topic Re: Invalid class string
Hello,
Thank you for your interest in our products.

I think that the likely reason is in the incorrect argument to the constructor of DAItemGroupArguments object. Here is what you have:

new DAItemGroupArguments("", this.description, itemId, this.intervallRead, null)

There are various overloads of the constructor, but what your code is calling means that following argument assignments will happen:

"" -> machineName
this.description -> serverClass
itemId -> itemId
this.intervallRead- > requestedUpdateRate
null -> state

Can you please stop the program in the debugger on that line, and check/send me values of all the arguments?
“Invalid class string” most likely refers to invalid 2nd argument (serverClass); basically it says that the OPC server identified by this parameter is not registered on the computer. But for that reason, it can also have other causes: For example, referencing an incorrect computer (e.g. local instead of remote – aren’t you doing that with your first argument being an empty string?) can obviously trigger the same error, because the OPC server is not where it is “supposed” to be.

From the image you have sent, I would expect that the first parameter should actually be something like “opc-bma”, and your second parameter “OPC.LSNProxy_DA_0.1” (note that the syntax Softing uses for their server names is their own; we use separate arguments instead of one string; and you do not need to add numerical CLSID – either ProgId or CLSID is enough).

Let me know if this helps.

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

More
07 Sep 2011 13:38 #477 by support
Invalid class string was created by support
From: K.
Sent: Wednesday, September 07, 2011 1:58 PM
To: Zbynek Zahradnik
Subject:

Hello Zbynek,

I need your help. I am now in the process of deciding which OPC Access software we should use, and i would much prefer to buy your toolkit,
because it’s much more modern and convenient to use.

But the problem is that connecting to our customers OpcServer fails [.....].
In the development environment it works fine.


I use the following simple code, borrowed from your examples:




As you can see from attached picture, ItemChanged is fired only once with an Exception: “Invalid ClassString”.

Do you have any idea?

Thanks in advance

Mit freundlichen Grüßen

K.

            this.easyDAClient = new EasyDAClient();
            this.easyDAClient.ItemChanged += this.easyDAClient_ItemChanged;

            List<DAItemGroupArguments> argumentsList = new List<DAItemGroupArguments>();

            foreach (OpcItem item in this.opcItems)
            {
                ImsItemDescriptor itemDesc = new ImsItemDescriptor(item.Description, item.Id);

                var itemId = item.Description as string;

                if (itemId != null)
                    argumentsList.Add(new DAItemGroupArguments("", this.description, itemId, this.intervallRead, null));
            }
            this.easyDAClient.SubscribeMultipleItems(argumentsList.ToArray());



        private void easyDAClient_ItemChanged(object sender, EasyDAItemChangedEventArgs e)
        {
            if (e.Exception == null)
            {
                Console.WriteLine("OPC Labs: " + e.Vtq.DisplayValue() + " " + e.Vtq.Quality.ToString() + " " + e.Vtq.Timestamp.ToShortTimeString());
            }
            else
                Console.WriteLine("OpcLabs:     " + e.Exception.Message + "  " + e.ServerDescriptor.ServerClass +"  " + e.ItemDescriptor.ItemId);
        }

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

Moderators: support
Time to create page: 0.054 seconds