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.

The ReadItem call fails because of "Unspecified error"

More
15 Jan 2011 08:19 #200 by support
From: W.
Sent: Friday, January 14, 2011 9:05 PM
To: Zbynek Zahradnik
Subject: RE: Error Explanations - The ReadItem call fails because of "Unspecified error"

Hello Zbynek,

Thank you for this information it is very helpful. Have a great weekend.

W.

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

More
14 Jan 2011 19:52 #198 by support
W.,
....

"Unspecified error" is transformed from COM error E_FAIL, which tells all and nothing. Knowing that it is used for many reasons and by many objects, I did not want to add to confusion, and have stayed away from explicitly generating E_FAIL inside QuickOPC, except for very few instances which I will eventually remove as well. It is therefore quite likely that this error comes from the target OPC server, and I would suggest they try to determine this by either using server diagnostics if available, or trying other OPC client to read from the same tag. I do not know the application logic, but if this is genuine error reported by the OPC server, then retrying may not be the right thing to do. It may be a bug in the server, or it may be the server telling the client the right thing – either way, the app is informed about this, and unless it absolutely needs to obtain the value, it should be prepared to handle the problem somehow without retrying. If efforts to determine the cause do not help, then with the debug build of the component and some special registry settings, we should be able to “trap” the precise place in code where it first occurs, but I would like to reserve this as last resort.

Note that there already is an internal retry mechanism for any errors that happen during AddItems call on the OPCGroup object. For every item that reports an error in AddItems (any error – not just “invalid item id”), the item is marked as “in failure”, and kept on list. Periodically (default: 1 minute), the component goes through the list of items that are “in failure”, and those that are in the list longer than certain period without retrying (default: 5 minutes) will be passed to AddItems again. If the error is indeed coming from AddItems, this is yet another reason why the user’s code should NOT quickly retry: It will not do anything. Items that are “in failure” will simply keep returning the error they gave in the last call.

Regards,
ZZ

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

More
14 Jan 2011 19:32 #197 by support
From: W.
Sent: Thursday, January 13, 2011 10:47 PM
To: Zbynek Zahradnik
Subject: Error Explanations

Hello Zbynek,

..... I have some thoughts on this and would like your expert opinion. The customer has proposed a workaround ..... I will comment on that ..... error and the workaround below the error

.....
The ReadItem call fails because of "Unspecified error"

OpcLabs.EasyOpc.OpcException = {"OPC operation failure"}
Source = "EasyOpcDANet"
StackTrace = " at OpcLabs.EasyOpc.DataAccess.EasyDAClient.CheckComResult(Int32 hResult, IErrorInfo* pErrorInfo) at OpcLabs.EasyOpc.DataAccess.EasyDAClient.ReadItem(ServerDescriptor serverDescriptor, DAItemDescriptor itemDescriptor) at

InnerException
System.Runtime.InteropServices.COMException = {"Unspecified error "}
Source = "OpcLabs.EasyOpc.DataAccess.EasyDAClient"
StackTrace = Nothing

This error occurs very early (approx 1000ms after the call was initiated). It corresponds strongly with bad register addresses (cases wherein we EXPECT to see an ErrorCode of -1073479673 but instead we get this error).

Proposed workaround: when this exception occurs, apply the handling logic for an "item does not exist in server address space" (-1073479673) error.
From my experience Unspecified Error doesn’t even tell us anything about what error occurred. I am unsure about how the customer came to the conclusion that he should be getting an invalid itemID error. Have you seen similar behavior? If so then his workaround may be valid. Otherwise I would suggest trying once or twice, if the error continues then it might actually be an invalid tag. I would not recommend always assuming invalid tag the first time.

......
Thanks in advance for you time.

W.

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

Moderators: support
Time to create page: 0.046 seconds