| View previous topic :: View next topic |
| Author |
Message |
wilwizard
Joined: 18 Apr 2007 Posts: 4 Location: Switzerland
|
Posted: Wed Apr 18, 2007 11:22 am Post subject: Sync Read returns Quality Bad sometimes |
|
|
Hello,
I did a small OPC client application in VBA Access and I'm having a problem sometimes when I try to SyncRead a quantity of 1200 items. Sometimes it returns Quality 20 for about 80% of the items (which is Bad and Last Known Value) and 192 for the rest, and sometimes returns to me 192 for 100% of the items. With exactly the same content passed in the arguments of the SyncRead method.
There is no relation with the Canonical Data Type. I have strings, integers, dates with some 192 and some 20.
I did also a test with different items, and 4x more items (about 4200) and I never have Quality 20, always 192 in this case.
Does anybody knows how or why the quality can be sometimes 20??
Thanks,
Wilzard |
|
| Back to top |
|
 |
Randy
Joined: 27 Feb 2003 Posts: 3553 Location: OPC Foundation
|
Posted: Wed Apr 18, 2007 2:48 pm Post subject: |
|
|
| The server is supposed to return a BAD quality if it cannot connect to the underlying datasource. You have to look at the documentation of the server to determine exactly why it is returning BAD qualities. |
|
| Back to top |
|
 |
wilwizard
Joined: 18 Apr 2007 Posts: 4 Location: Switzerland
|
Posted: Mon Apr 23, 2007 11:58 am Post subject: |
|
|
Thanks Randy,
I'm actually using ABB OPC Server and besides the OPC with quality 20 (which is bad) there are 3 interesting points:
1) Even receiving quality bad for certain items, I can rely in the value I receive under Values array. I did a test changing the value in one of my items and in the first time I've SyncRead, the value was there but with quality 20!!
2) ItemServerErrors array is with all the items in 0 after added items meaning that the method was completed ok.
3) The same problem happened trying to read only 10 items. So means that is not any data overload.
Wilwizard |
|
| Back to top |
|
 |
Randy
Joined: 27 Feb 2003 Posts: 3553 Location: OPC Foundation
|
Posted: Mon Apr 23, 2007 1:03 pm Post subject: |
|
|
You never should use a value if the quality is bad. Some servers do return values but clients are not supposed to use them unless they really understand what it means.
If you look up the quality value of 20 in the IDL you would see that it means 'OPC_QUALITY_LAST_KNOWN'. IOW, the bad quality indicates that the server is having problems accessing the underlying datasource and that the value being returned is not the latest value. |
|
| Back to top |
|
 |
wilwizard
Joined: 18 Apr 2007 Posts: 4 Location: Switzerland
|
Posted: Mon Apr 23, 2007 5:37 pm Post subject: |
|
|
Thanks Randy,
It's getting clear for me, but not complete so far. I also noticed that this happens for some very specific objects and if I take different objects in my OPC Tree, I can have a array of 4000 items where I don't see any problem.
But in some very specific objects I can start seeing that with an array of about 10 objects.
Once my values are so static (doesn't change for days, sometimes years) and I just want to fill a table with the values, an actual value or a last known value is pretty enough for me.
But anyway I am really interested to know what can cause such kind of problem in the Server? Did you have some experience with that? |
|
| Back to top |
|
 |
wilwizard
Joined: 18 Apr 2007 Posts: 4 Location: Switzerland
|
Posted: Wed Apr 25, 2007 8:04 am Post subject: More news |
|
|
Some more things that are driving to find the solution.
1) Not only SyncRead but also AsyncRead has the same behviour.
2) I changed the position of the items in the Group and i found that it is not regarding to the position and yes to the item itself.
3) I sorted in a way to have the first 10 items quality 192 and the following 10 items quality 20 and this happens in the same way.
I thought I found a way where everytime it returns quality good (192) to me. Using the method AsyncRefresh. But after several tests I found that this was not true. |
|
| Back to top |
|
 |
Randy
Joined: 27 Feb 2003 Posts: 3553 Location: OPC Foundation
|
Posted: Wed Apr 25, 2007 1:52 pm Post subject: |
|
|
| You really need to contact the vendor that built the server that you are using. If there is a problem with the item then you should get a bad quality no matter how you read it. |
|
| Back to top |
|
 |
|