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.

QuickOPC ReadItemValue() hangs

More
08 Jul 2016 07:32 - 08 Jul 2016 07:36 #4214 by Vogelbacher
I am still testing and will report the results.

"written with QuickOPC" I mixed up things. Its a second OPC Server Connect Product (I think written entirely in C++).
Last edit: 08 Jul 2016 07:36 by Vogelbacher.

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

More
08 Jul 2016 06:45 #4211 by support
Hello, thank you for the answer. I understand the (working) situation now. There could be something with the DCOM versus our own security settings, as indicated by the "Access denied" in the subscription scenario - but I do not know how that could have caused the initial delay.

Some notes:

- You can test the Browsing Dialogs by *uninstalling* the license. This counterintuitive, but it is really so: By unistalling the license, you revert to a trial license, which allows *all* features (for each 30 minutes of the process run time).

- I do not fully understand this part: "I have now two OPC DA Servers on that node. This OPC Server is written with QuickOPC. It is possible to subscribe and read from this OPC Server - on the same node.". How can the server be "written with QuickOPC" - we do not have a server toolkit?

- I do not think there is a digitally signed version of OPC Analyzer.

- I have sent the info about manual license handling by email, earlier.

Best regards

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

More
06 Jul 2016 16:34 #4202 by Vogelbacher
(You may jump direct to end to see whats the situation now)

See answer in BOLD


Hi.

This would be difficult to diagnose even with unrestricted access to the computing environment, but we will try. I will start by posing some questions, in an effort to get some information that might reduce the range of causes for this.

1. In the production environment, does it *ever* successfully read, or do you always get this error?

-> I always get this timouts, but only with EasyOPC

2. With the QuickOPC demo app in .NET, have you tried to Subscribe, and what were the results?

-> I get a “Access is denied”

3. With the QuickOPC demo app in .NET, have you tried to browse for items, and what were the results?

-> “BrowsingDialogs” is not granted with my license

4. Have you tried any other operations, besides the ReadValue, and those mentioned in questions above, and what were the results?
-> Yes. same with Write and Read

5. I assume that whether the problem happens does not depend on the particular item you are trying to read - please confirm that you have tried other items and that they all behave roughly the same.

-> I tried several items.

6. From the same client computer, have you tried reading from some other OPC server on the same remote computer where your "normal" OPC server is, and if so, what were the results?

->I have now two OPC DA Servers on that node. This OPC Server is written with QuickOPC. It is possible to subscribe and read from this OPC Server - on the same node.

(This makes me even more suspicious.)


7. From the same client computer, have you tried reading from some OPC server on a remote computer other than where your "normal" target OPC server is, and what were the results?

-> I tried several OPC Servers, as the system is redundant.

8. You indicated that it takes >25 seconds before you get the timeout error. Our default value for this timeout is actually 60 seconds. Is the delay you are observing actually close to 60 seconds, or is it, let's say, around 30 seconds, or how long is it in fact?

-> I did an exact measurement and it was about 60 seconds.

9. In your program, do you do anything else *before* the piece you have shown? Other Reads, for example?

-> Only reading parameters from an INI File and setting up local variables.

10. If you "pre-start" the OPC Server by connecting other (well-functioning) OPC client to it and subscribing (e.g. using Matrikon OPC Explorer), and *while it is subscribed*, start your code and do the Read, do you get the same problem, or what is the behavior? This is quite important test, because it allows us to rule out many timing issues related to server startup.

-> Same effect.
I just see on the Server side a new service with the OPC name appearing, probably from Matricon OPC Explorer connted. So it seems that the OPC Server starts a new process after subscribing.


11. You say that server logs do not indicate an access. Is that different from when the value from the is successfully read using some other OPC client? If so, what does the server log say in such case?

-> No. I meant I get no log at all. Not even from Matrikon OPC Explorer successful connecting.

Some background information about how things work:
When you call ReadValue (or Read, see later), a long sequence of steps must happen. We perform the sequence on a separate thread, and if it takes longer than a configurable timeout period, we issue the error you are getting. The sequence consists of, very roughly:
i) Creating an instance of OPCEnum object on a remote computer
ii) Making calls on OPCEnum in order to convert the ProgID of the server to CLSID
---
iii) Creating an instance of the OPCServer object on a remote computer
iv) Querying for various OPCServer interfaces, setting up server-wide callbacks
v) Adding an OPCGroup
vi) Querying for various OPCGroup interfaces, setting up group callbacks
vii) Getting server status
viii) Adding an item to the OPCGroup
ix) Calling a Read, waiting for result
x) when ReadValue was used, and the value read does not have a Good quality, setting up a subscription and waiting for an UPDATE WITH Good quality

I might have forgotten something - these are just the principles, not a precise code description - which also depends on other, variable factors.

Depending on the actual status, some of the (initial) steps may not be needed, if we are already connected. For example, a second Read, for a new (different) item call may start with step viii), adding an item, while a second Read for the same item may start with step ix) directly.

It can be any of these steps that takes very long or blocks "forever". Unfortunately there isn't a detailed log available from the component that would allow us to tell which of the steps is responsible.

Problems from step iii) onwards can normally be diagnosed using the OPC Analyzer tool from OPC Foundation. It acts as an intermediate OPC Client/Server, and provides view&log of the OPC communication, together with timing info. Using it requires to change the client application temporarily so that it connects to the OPC Analyzer instead (which in turn connects to the actual OPC server).

More questions:
12. Would it be an option to deploy the OPC Analyzer (on the client computer) in your environment?

-> Depends on the OPC Analyzer (there are quite few around, Matrikon’s is already installed):
If it’s digitally signed I can do that. If I have a direct download link I can get it in within 1 day (This is due the PC’s are in a high security area and all files must be signed, verified and approved).


I downloaded OPC Analyzer from OPC Foundation, however that one is unsigned. Even worse is that it brings an old OpcEnum 1.10.2.02 from 2007.
The targets are Windows 2008 R2 SP1 (x64).


13. One of the possibilities is that the problem is in the first two steps (because of "no access" in the server logs). OPCEnum is, however, only needed to convert the symbolic ProgID to the CLSID of the server. These two steps can be skipped by providing a numerical CLSID instead. Can you please try to replace the ProgiD by a string containing a CLSID in curly brackets, like "{…}", and see if it helps?

-> Even if I use CLSID I get same results.

14. Please figure out whether the server process (it may be AfwDsOpcSurrogate.exe) is a) pre-started, e.g. as a service, before any OPC clients connect, or b) starts with the first successful OPC connection, and terminates some time after the last OPC connection is disconnected, or c) starts with the first successful OPC connection and remains "forever" started. (these tests to be done with the OPC client that works, e.g. the Matrikon OPC Explorer)

-> It’s not pre-started. It starts a new process for every client. If no clients are connected or I disconnect there is nothing in the task-list.
If I just “KILL” the Matrikon OPC Explorer, the Tasks vanishes after about 5 minutes (probably timout) by it self.


15. If the server is being started with OPC connection (options b and c above), do a following test: Make sure the server process is not running. The, start the QuickOPC application which has the problem. Does the server process appear in the Task Manager, at least for a moment? If so, is it really for just a moment, or does it stay there? This is quite important test, because it would allow us to determine whether the step iii) has been successful.

-> no task appears, not even shortly.

16. When observing the server process in Task Manager, don't you ever see *two* or more instances of the same executable? If so, what are the user accounts under which these instances are running?

-> They all appear with the launching user.

Notes:
A. You have determined the version and build of QuickOPC properly. The file info can be used for that just well.
B. Google shows that some people had problems with slowness of AddItems call with that server.
C. I noticed you attempted to deploy QuickOPC on the server computer, for doing "local communication" test. That is a good idea, and I would be interested in knowing the results of it. You reported that it does not work because of the licensing problem. I know what is happening there: Normally, you would not need *any* license, and the component would run just fine in a trial build. But the build you have is relatively old, and we do not want people trying out obsoleted software, and that's why it has refused to run. This can be resolved in following ways: a) use the newest build of QuickOPC 5.35 (downloadable from our Web site) - without any license, for trial, b) installing the license for your current build, using the License Manager (I understand that this might be a security/operational problem), or c) you can get the license onto that computer even without License Manager - if you want to go that way, please contact me (Zbynek Zahradnik) by email and I will send you the instructions.

-> YES please

D. I originally wanted to suggest that you replace ReadValue by Read. The reason for that is that OPC server always provides Value+Timestamp+Quality, and the Read methods imply returns that, while ReadValue tests whether the received Quality is Good, and if it is not, it makes a subscriptions and waits until it receives an update with a Good quality, which can take time. But I have then observed that in your snapshots, you get the same problem when making a straight Read from the Demo app, so as long as that is the case, the suggestion I had is probably not worth trying.
[/color]


Situation now:

I did so many things today:
-> Installed newer build form OpenOPC
-> Played around with OPCEnum service
-> checked some Plolicy and network settings
-> Did DCOM config to lowest possible security:
Very similar to this one: www.softwaretoolbox.com/dcom/html/configuring_dcom.html but with extra users
-> Restarted the Node several times
-> Killed the task of that OPC Server several times.
-> checked all the points you mentioned

And now?
It suddenly works!

I have no clue why! Maybe only temporary, I have to observe that.

I also have a second server (redundant partner) and have to do the steps there too.
Maybe I find out what the solution is/was - if I we have solved the problem – I’m still not sure if that’s now just a coincidence.

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

More
05 Jul 2016 15:53 #4195 by Vogelbacher
I think the first step is to download the newer build and transfer/install it to the system.
Request process for file delivery to secure zone is started already.

I would appreciate Note C - to be able to install license without manager.

The other questions I am checking now and will tomorrow.

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

More
05 Jul 2016 14:33 #4193 by support
Hi.

This would be difficult to diagnose even with unrestricted access to the computing environment, but we will try. I will start by posing some questions, in an effort to get some information that might reduce the range of causes for this.

1. In the production environment, does it *ever* successfully read, or do you always get this error?
2. With the QuickOPC demo app in .NET, have you tried to Subscribe, and what were the results?
3. With the QuickOPC demo app in .NET, have you tried to browse for items, and what were the results?
4. Have you tried any other operations, besides the ReadValue, and those mentioned in questions above, and what were the results?
5. I assume that whether the problem happens does not depend on the particular item you are trying to read - please confirm that you have tried other items and that they all behave roughly the same.
6. From the same client computer, have you tried reading from some other OPC server on the same remote computer where your "normal" OPC server is, and if so, what were the results?
7. From the same client computer, have you tried reading from some OPC server on a remote computer other than where your "normal" target OPC server is, and what were the results?
8. You indicated that it takes >25 seconds before you get the timeout error. Our default value for this timeout is actually 60 seconds. Is the delay you are observing actually close to 60 seconds, or is it, let's say, around 30 seconds, or how long is it in fact?
9. In your program, do you do anything else *before* the piece you have shown? Other Reads, for example?
10. If you "pre-start" the OPC Server by connecting other (well-functioning) OPC client to it and subscribing (e.g. using Matrikon OPC Explorer), and *while it is subscribed*, start your code and do the Read, do you get the same problem, or what is the behavior? This is quite important test, because it allows us to rule out many timing issues related to server startup.
11. You say that server logs do not indicate an access. Is that different from when the value from the is successfully read using some other OPC client? If so, what does the server log say in such case?


Some background information about how things work:
When you call ReadValue (or Read, see later), a long sequence of steps must happen. We perform the sequence on a separate thread, and if it takes longer than a configurable timeout period, we issue the error you are getting. The sequence consists of, very roughly:
i) Creating an instance of OPCEnum object on a remote computer
ii) Making calls on OPCEnum in order to convert the ProgID of the server to CLSID
---
iii) Creating an instance of the OPCServer object on a remote computer
iv) Querying for various OPCServer interfaces, setting up server-wide callbacks
v) Adding an OPCGroup
vi) Querying for various OPCGroup interfaces, setting up group callbacks
vii) Getting server status
viii) Adding an item to the OPCGroup
ix) Calling a Read, waiting for result
x) when ReadValue was used, and the value read does not have a Good quality, setting up a subscription and waiting for an UPDATE WITH Good quality

I might have forgotten something - these are just the principles, not a precise code description - which also depends on other, variable factors.

Depending on the actual status, some of the (initial) steps may not be needed, if we are already connected. For example, a second Read, for a new (different) item call may start with step viii), adding an item, while a second Read for the same item may start with step ix) directly.

It can be any of these steps that takes very long or blocks "forever". Unfortunately there isn't a detailed log available from the component that would allow us to tell which of the steps is responsible.

Problems from step iii) onwards can normally be diagnosed using the OPC Analyzer tool from OPC Foundation. It acts as an intermediate OPC Client/Server, and provides view&log of the OPC communication, together with timing info. Using it requires to change the client application temporarily so that it connects to the OPC Analyzer instead (which in turn connects to the actual OPC server).

More questions:
12. Would it be an option to deploy the OPC Analyzer (on the client computer) in your environment?
13. One of the possibilities is that the problem is in the first two steps (because of "no access" in the server logs). OPCEnum is, however, only needed to convert the symbolic ProgID to the CLSID of the server. These two steps can be skipped by providing a numerical CLSID instead. Can you please try to replace the ProgiD by a string containing a CLSID in curly brackets, like "{…}", and see if it helps?
14. Please figure out whether the server process (it may be AfwDsOpcSurrogate.exe) is a) pre-started, e.g. as a service, before any OPC clients connect, or b) starts with the first successful OPC connection, and terminates some time after the last OPC connection is disconnected, or c) starts with the first successful OPC connection and remains "forever" started. (these tests to be done with the OPC client that works, e.g. the Matrikon OPC Explorer)
15. If the server is being started with OPC connection (options b and c above), do a following test: Make sure the server process is not running. The, start the QuickOPC application which has the problem. Does the server process appear in the Task Manager, at least for a moment? If so, is it really for just a moment, or does it stay there? This is quite important test, because it would allow us to determine whether the step iii) has been successful.
16. When observing the server process in Task Manager, don't you ever see *two* or more instances of the same executable? If so, what are the user accounts under which these instances are running?


Notes:
A. You have determined the version and build of QuickOPC properly. The file info can be used for that just well.
B. Google shows that some people had problems with slowness of AddItems call with that server.
C. I noticed you attempted to deploy QuickOPC on the server computer, for doing "local communication" test. That is a good idea, and I would be interested in knowing the results of it. You reported that it does not work because of the licensing problem. I know what is happening there: Normally, you would not need *any* license, and the component would run just fine in a trial build. But the build you have is relatively old, and we do not want people trying out obsoleted software, and that's why it has refused to run. This can be resolved in following ways: a) use the newest build of QuickOPC 5.35 (downloadable from our Web site) - without any license, for trial, b) installing the license for your current build, using the License Manager (I understand that this might be a security/operational problem), or c) you can get the license onto that computer even without License Manager - if you want to go that way, please contact me (Zbynek Zahradnik) by email and I will send you the instructions.
D. I originally wanted to suggest that you replace ReadValue by Read. The reason for that is that OPC server always provides Value+Timestamp+Quality, and the Read methods imply returns that, while ReadValue tests whether the received Quality is Good, and if it is not, it makes a subscriptions and waits until it receives an update with a Good quality, which can take time. But I have then observed that in your snapshots, you get the same problem when making a straight Read from the Demo app, so as long as that is the case, the suggestion I had is probably not worth trying.

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

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

More
04 Jul 2016 15:45 #4192 by Vogelbacher
I have a serious problem with QuickOP 5.35 ReadItemValue().

It hangs and then returns with a timeout.

I have no Idea where to search for the problem and how to solve this issue.

Please help me!

Details are in the attached PDF.

File Attachment:

File Name: QuickOPCPr...ored.pdf
File Size:409 KB
Attachments:

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

More
04 Jul 2016 15:38 #4191 by Vogelbacher
I have a seriuos problem with QuickOPC and ReadItemValue() to remote machine.

It hangs and I receive no result but a timout.

Details are in the attached PDF.


File Attachment:

File Name: QuickOPCPr...ored.pdf
File Size:409 KB
Attachments:

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

More
04 Jul 2016 15:33 #4190 by Vogelbacher
I have a problem with QuickOPC 5.35.

ReadItemValue() hangs and I have no clue how to find and solve the problem.

Please Help me with this.

Details are in the attached PDF.

File Attachment:

File Name: QuickOPCPr...ored.pdf
File Size:409 KB
Attachments:

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

Moderators: support
Time to create page: 0.140 seconds