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.
Cannot browse OPC servers in remote computer
thank you for all the additional information, it is very helpful. All in all, it looks like that there is an issue with the "callback channel", i.e. when the server reports back to the client either for asynchronous method calls, or for subscriptions. Error 0x80040202 is for CONNECT_E_CANNOTCONNECT, and has to do with precisely this.
1. You are using version 5.50 (QuickOPC 2017.1). It would be wise to upgrade to the current version, even though I am not aware of any specific fix/change that can affect the observed behavior.
2. The observation you made with BrowseFromRegistry is very good. It may be unrelated to the main problem, but it adds to the overall issue. Keep it at 'false' if that helps.
3. Check the DCOM configuration.
4. If you were always running the program in the debugger, try it *outside* of the debugger. We have recently seen weird behavior of the Visual Debugger regarding the DCOM identity, and the error you have noticed in the Windows Event Log seem to point in that direction too.
5. A workaround might be to force QuickOPC to use synchronous calls only (this won't help with subscriptions, though, but it is worth trying). In your code, that would be something like
6. Please try different combinations of QuickOPC security parameters, as mentioned here: www.opclabs.com/forum/connections-reconnections-com-dcom/124...ng-to-remote-machines-via-code - that is, (C#)
Unfortunately, these can only be done inside the process, at the very beginning - there is no way you can write a code to test multiple combinations in one run.,
Best regards
Please Log in or Create an account to join the conversation.
Additional info 3:
The System Administrator of the production servers make some tests over the network:
- The DCOM error attached in the "Additional info 2" posts is solved, but the communication still does not work.
- If we set a tag name that not exists in the OPC server, then the error message changes: *** Failure -1073479673 (0xC0040007): The item is no longer available in the server address space.
So the request is sent to the server successfully.
- If we set an existing tag, there are timeout error.
Packet lifecycle:
- MSRPC binding ok.
- The request is sent to the Kepware server successfully.
- The DCOM start here -> Packet sent -> Keepalive packets going -> Timeout.
- OPCENUM: DCOM remote access right is enabled (in OPC Server side too)
- ARP communication is ok.
- There are a Symactec DCSSA security on OPC Server's server computer, but it was tempolary disabled.
- There are an another (older) Kepware OPC Server (4.x) installed on the same cumputer, than the Kepware OPC Server V5.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
I try with this simple code:
The error message is the same:
I check the Windows EventLog after this and I see the following error message:
Thank you!
Please Log in or Create an account to join the conversation.
I read some other posts and find this: www.opclabs.com/forum/browsing/1449-extreemly-slow-in-browsing-opc-servers-on-a-machine
When I integrate this code to my project:
EasyDAClient.SharedParameters.MachineParameters.BrowseFromRegistry = False
after execution the following error message appear, but much faster than in the previous case (1-5 seconds with the above code, ~ 1 minute without the above code).
I think this is not a timeout error, but I cannot see detailed error message. About the error code do you know what is this?
Thank you!
Please Log in or Create an account to join the conversation.
Sorry for the delay, I create my new test application with subscription. Before I send my answers to your questions:
Notes:
- I move the InstanceParameters to New()
- We use Try..Catch for every external module. We already found unhandled exceptions in another 3rd party vendor's API. So it is only a new security layer.
- I increase the HoldPeriod to 80000.
Ad 1. Yes, the client is on a different computer. Network problem: I think there are no network related problem because the Kepware and Matrikon clients read the data inside seconds, and refresh it every 1 sec:
The app at right bottom is my new test app with subscription. The full code of the test app:
You can see the response error in the image. The Kepware and Matrikon clients running on the same computer than my test app.
I dont understand why my client not work and other clients works.
Thank you for help!
Please Log in or Create an account to join the conversation.
First, some small notes to your code - they do not have influence on the outcome, but I want to let you know:
- I would move the settings of InstanceParameters from ReadTagValuesFromOPC)_ to the New(). Parameters on EasyDAClient are meant to be set just once, before a first operation is invoked.
- The Try/Catch does nothing, because (except for usage and .NET execution errors), ReadMultipleItems never throws. This is the case with all methods that have "Multiple" in their name. They report errors through the .Exception property in the result objects.
- I would increase the HoldPeriod.TopicRead to be higher than the timeout.
Now to the real stuff.
Ad 1. I also do not understand this yet. Questions: Since you are entering an IP address, I suppose the client is on a different computer form the server, am I right? If so, aren't the delays somehow caused by the network? When you were using the Kepware Quick Client, have you been running it on the same computer as the server, or on the same computer where you do tests with QuickOPC?
Ad 2. Besides the minor notes above, your code looks right and it should work. So we need to look for reasons elsewhere.
Ad 3. Info about subscriptions, and examples:
- opclabs.doc-that.com/files/onlinedocs/QuickOpc/Latest/User%2...o%20OPC%20Classic%20Items.html
- the EasyOpcNetDemo project in the examples solution
- the HmiScreen project in the examples solution
- the SubscribeToMany project in the examples solution
- and many others in the Examples section of the documentation, and in the examples solution
Ad 4. The intent of modifying the HoldPeriod was to prevent disconnections *after* some previous operation. In this sense, it is no surprise that it does not help with the first call. Keep it there for now anyway.
Best regards
Please Log in or Create an account to join the conversation.
Thank you!
No.1. OK. In this case I dont understand why can I read from property and why cannot from normal read.
No.2. I create a new test with value age 80000, but the result is timeout again. I send my full code and GUI settings:
Attachment 01.PNG not found
You can see the errors in the image (at right side).
(the Property Id in GUI has no effect for anything).
No.3. Yes, I see the subsription is much faster. Do you have source code example how can I implement this in the easiest way? I need read the tag values every minute (the actual value). Thank you!
No.4. I modify the value for client object, but has no effect. I think because the first try throws timeout error.
In my code I move the client object from local object to global object and I not use the "Using" directive.
Thanks!
Please Log in or Create an account to join the conversation.
Ad 1. In OPC Classic, "reading" is quite different from "getting properties". The fact that you can also get the value using properties should not lead to you to think that is the way to do it. It will never work efficiently with larger number of items, so discussing details of it (even though it works) is kind of a moot point. Properties with low numbers are those defined/reserved by OPC, 2 is for the value. Number like 5005 are then vendor-specific.
Ad 2. You yourself has sent this piece of code:
Ad 3. "But after I see the tags in the right panel (so after the tree is loaded), all values updating in 1 sec repeatly." Apparently, you are observing how fast OPC *subscriptions* work. Subscriptions are the preferred way to get the data, over the reads. If you want to get updated data in the same way as the Quick Client is doing it, forget about "get properties", forget about "read", and have a look at subscriptions. You cannot compare different concept in different clients and expect them to give comparable resultst.
Ad 4. The "TopicRead" property is OK, but a) the value is in milliseconds, it should be 80000 instead, and b) I have already explained that you you must not set anything in OpcLabs.EasyOpc.DataAccess.Engine.EasyDAClientHoldPeriods.Default . For a proper way of doing it, see opclabs.doc-that.com/files/onlinedocs/QuickOpc/Latest/User's...kOPC/Setting%20Parameters.html .
Please Log in or Create an account to join the conversation.
1. Only this method produces a value. I am not an OPC expert, so possibly I'am on the wrong way. But I see that in this OPC Server the property id: 2 contains the value. In other systems I think the 5005 is the default property id for value. So I thought, that the ReadMultipleItems method use the default propertyid to read the value (perhaps I am wrong) and therefore it is not success. So in my test project I can only read value when I use GetPropertyValue and I manually set the property id to 2.
2. I check the Object Browser but I not find MaximumAge property for DA. I found it for UA, but currently I have a DA server. Or do you mean for ValueAge?
3. Yes I know what you mean. With Quick Client building the tree is slow too. But after I see the tags in the right panel (so after the tree is loaded), all values updating in 1 sec repeatly.
4. The subsription to a value unfortunatelly will not work, because we use the Quartz scheduler to start reading in every minute and the subscription works with other logic. I will try the 'hold period' suggestion. Do you mean for this?
It is not problem when the first reading is slow, if the second and later request are fast.
Thank you!
Please Log in or Create an account to join the conversation.