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.

Reading, Writing - optimization parameters

More
20 Feb 2015 14:14 #2827 by support
Regarding the first issue:

In OPC DA 1.0, the client can request that a server performs a Read from the Device, or from its Cache. In OPC DA 3.0, there is an additional method which allows to specify a MaxValueAge, and the server will decide where to get the value from.

On our OPC client side, we may have yet another place where to get the value: From our own copy of the value - as obtained by some previous Read, or using a Subscription mechanism.

The DAReadParameters influence how the value is obtained. The default is ByValueAge, and the age is 1 second. When you ask for a Read with these settings, we look at the age of what we currently have, and if it's there, we give it our own value. If we do not have a value the recent enough, we will ask the server to give us the value.

By settings the source to Device you have enforced the most "reliable", but less efficient method.

The reason why the ByValueAge does not sometimes work reliably is a combination of two factors: 1) When you Read, we set an internal, "automatic" subscription as well, in expectation that more Read-s will follow, and 2) when confronted with combined Read-s and Subscription-s, some servers get confused and provide out-of-date values.

Other way to work around this can be to disable the automatic subscriptions: See www.opclabs.com/forum/reading-writing-subscriptions-property...scriptions-made-with-opc-reads .

Best regards

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

  • miron
  • Topic Author
  • Visitor
  • Visitor
19 Feb 2015 15:31 - 19 Feb 2015 16:16 #2820 by miron
Replied by miron on topic Reading, Writing - optimization parameters
"And at least I have problem with mapping.WriteTarget"
Ok I have solved problem with writing for live mapping. It was my mistake.
Last edit: 19 Feb 2015 16:16 by miron. Reason: Problem solved with writing.

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

  • miron
  • Topic Author
  • Visitor
  • Visitor
19 Feb 2015 14:59 #2819 by miron
Replied by miron on topic Reading, Writing - optimization parameters
I figured out that when I marked property by attribute:
[DAReadAttribute(DataSource = DADataSource.Device)]

reading parameters now is happen immediately.

Would you like be willing to describe more deeply dependences between some parameters
DataSource , ValueAge

and also:

da.InstanceParameters.UpdateRates.ReadAutomatic
da.InstanceParameters.UpdateRates.WriteAutomatic


and other

which could have influence for reading and writing in EasyOPCClient and also in live mapping.



Is there possibility to setup be default cache options?

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

  • miron
  • Topic Author
  • Visitor
  • Visitor
19 Feb 2015 12:33 #2812 by miron
Replied by miron on topic Reading, Writing - optimization parameters
I have made simple test.
I read on value in loop.
In loop I have set up break when value will equal = 1000.
Initial value was 399. After starting example I change value in opc to 1000.

New value was read after about 50 seconds.
Maybe I should set up some optimization parameters.
e.g. switch off some cache?

=====================================================
Log:

Position=399
IsRunning=True
**********************
Position=399
IsRunning=True
**********************
Position=399
IsRunning=True
**********************
Position=399
IsRunning=True
**********************
Position=399
IsRunning=True
**********************
Position=399
IsRunning=True
**********************
Position=399
IsRunning=True
**********************
Position=399
IsRunning=True
**********************
Position=399
IsRunning=True
**********************
Position=399
IsRunning=True
**********************
Position=399
IsRunning=True
**********************
Position=399
IsRunning=True
**********************
Position=399
IsRunning=True
**********************
Position=399
IsRunning=True
**********************
Position=399
IsRunning=True
**********************
Position=399
IsRunning=True
**********************
Position=399
IsRunning=True
**********************
Position=399
IsRunning=True
**********************
Position=399
IsRunning=True
**********************
Position=399
IsRunning=True
**********************
Position=399
IsRunning=True
**********************
Position=399
IsRunning=True
**********************
Position=399
IsRunning=True
**********************
Position=399
IsRunning=True
**********************
Position=399
IsRunning=True
**********************
Position=399
IsRunning=True
**********************
Position=399
IsRunning=True
**********************
Position=399
IsRunning=True
**********************
Position=399
IsRunning=True
**********************
Position=399
IsRunning=True
**********************
Position=399
IsRunning=True
**********************
Position=399
IsRunning=True
**********************
Position=399
IsRunning=True
**********************
Position=399
IsRunning=True
**********************
Position=399
IsRunning=True
**********************
Position=399
IsRunning=True
**********************
Position=399
IsRunning=True
**********************
Position=399
IsRunning=True
**********************
Position=399
IsRunning=True
**********************
Position=399
IsRunning=True
**********************
Position=399
IsRunning=True
**********************
Position=399
IsRunning=True
**********************
Position=399
IsRunning=True
**********************
Position=399
IsRunning=True
**********************
Position=399
IsRunning=True
**********************
Position=399
IsRunning=True
**********************
Position=399
IsRunning=True
**********************
Position=399
IsRunning=True
**********************
Position=399
IsRunning=True
**********************
Position=399
IsRunning=True
**********************
Position=399
IsRunning=True
**********************
Position=399
IsRunning=True
**********************
Position=1000
IsRunning=True

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

  • miron
  • Topic Author
  • Visitor
  • Visitor
19 Feb 2015 11:54 #2810 by miron
Replied by miron on topic Reading, Writing - optimization parameters
I have added mappin by subscription to the same value:
CVAVL - curent value (mapping by subscription)
RWAL - mapping and reading by mapper.ReadTarget

Crating thread
Starting thread
Join to thread and waiting for finish...
****************************
now= 12:51:34
>>>>> CVAVL Speed: 0
>>>>> RWAVL Speed: 54
****************************
now= 12:51:36
>>>>> CVAVL Speed: 54
>>>>> RWAVL Speed: 54
****************************
now= 12:51:36
>>>>> CVAVL Speed: 55
>>>>> RWAVL Speed: 56
****************************
now= 12:51:37
>>>>> CVAVL Speed: 56
>>>>> RWAVL Speed: 57
****************************
now= 12:51:38
>>>>> CVAVL Speed: 57
>>>>> RWAVL Speed: 58
****************************
now= 12:51:39
>>>>> CVAVL Speed: 58
>>>>> RWAVL Speed: 58
****************************
now= 12:51:40
>>>>> CVAVL Speed: 50
>>>>> RWAVL Speed: 58
****************************
now= 12:51:41
>>>>> CVAVL Speed: 51
>>>>> RWAVL Speed: 58
****************************
now= 12:51:42
>>>>> CVAVL Speed: 51
>>>>> RWAVL Speed: 58
****************************
now= 12:51:42
>>>>> CVAVL Speed: 52
>>>>> RWAVL Speed: 58
****************************
now= 12:51:43
>>>>> CVAVL Speed: 53
>>>>> RWAVL Speed: 58
****************************
now= 12:51:44
>>>>> CVAVL Speed: 55
>>>>> RWAVL Speed: 58
****************************
now= 12:51:45
>>>>> CVAVL Speed: 56
>>>>> RWAVL Speed: 58
****************************
now= 12:51:46
>>>>> CVAVL Speed: 56
>>>>> RWAVL Speed: 58
****************************
now= 12:51:47
>>>>> CVAVL Speed: 58
>>>>> RWAVL Speed: 58
****************************
now= 12:51:48
>>>>> CVAVL Speed: 59
>>>>> RWAVL Speed: 58
****************************
now= 12:51:49
>>>>> CVAVL Speed: 50
>>>>> RWAVL Speed: 58
****************************
now= 12:51:50
>>>>> CVAVL Speed: 51
>>>>> RWAVL Speed: 58
****************************
now= 12:51:51
>>>>> CVAVL Speed: 51
>>>>> RWAVL Speed: 58
****************************
now= 12:51:52
>>>>> CVAVL Speed: 52
>>>>> RWAVL Speed: 58
****************************
now= 12:51:53
>>>>> CVAVL Speed: 54
>>>>> RWAVL Speed: 58
****************************
now= 12:51:54
>>>>> CVAVL Speed: 55
>>>>> RWAVL Speed: 58
****************************
now= 12:51:55
>>>>> CVAVL Speed: 56
>>>>> RWAVL Speed: 58
****************************
now= 12:51:56
>>>>> CVAVL Speed: 57
>>>>> RWAVL Speed: 58
****************************
now= 12:51:57
>>>>> CVAVL Speed: 58
>>>>> RWAVL Speed: 58
****************************
now= 12:51:58
>>>>> CVAVL Speed: 58
>>>>> RWAVL Speed: 58
****************************
now= 12:51:59
>>>>> CVAVL Speed: 50
>>>>> RWAVL Speed: 58
****************************
now= 12:52:00
>>>>> CVAVL Speed: 51
>>>>> RWAVL Speed: 58
****************************
now= 12:52:01
>>>>> CVAVL Speed: 51
>>>>> RWAVL Speed: 58
****************************
now= 12:52:02
>>>>> CVAVL Speed: 53
>>>>> RWAVL Speed: 58
****************************
now= 12:52:03
>>>>> CVAVL Speed: 54
>>>>> RWAVL Speed: 58
****************************
now= 12:52:04
>>>>> CVAVL Speed: 55
>>>>> RWAVL Speed: 58
****************************
now= 12:52:05
>>>>> CVAVL Speed: 56
>>>>> RWAVL Speed: 58
****************************
now= 12:52:06
>>>>> CVAVL Speed: 56
>>>>> RWAVL Speed: 58
****************************
now= 12:52:07
>>>>> CVAVL Speed: 58
>>>>> RWAVL Speed: 58
****************************
now= 12:52:08
>>>>> CVAVL Speed: 59
>>>>> RWAVL Speed: 58
****************************
now= 12:52:10
>>>>> CVAVL Speed: 50
>>>>> RWAVL Speed: 58
****************************
now= 12:52:11
>>>>> CVAVL Speed: 51
>>>>> RWAVL Speed: 58
****************************
now= 12:52:12
>>>>> CVAVL Speed: 52
>>>>> RWAVL Speed: 58
****************************
now= 12:52:13
>>>>> CVAVL Speed: 53
>>>>> RWAVL Speed: 58
****************************
now= 12:52:14
>>>>> CVAVL Speed: 54
>>>>> RWAVL Speed: 58
****************************
now= 12:52:15
>>>>> CVAVL Speed: 55
>>>>> RWAVL Speed: 58
****************************
now= 12:52:16
>>>>> CVAVL Speed: 56
>>>>> RWAVL Speed: 58
****************************
now= 12:52:18
>>>>> CVAVL Speed: 57
>>>>> RWAVL Speed: 58
****************************
now= 12:52:19
>>>>> CVAVL Speed: 58
>>>>> RWAVL Speed: 58
****************************
now= 12:52:20
>>>>> CVAVL Speed: 59
>>>>> RWAVL Speed: 58
****************************
now= 12:52:22
>>>>> CVAVL Speed: 50
>>>>> RWAVL Speed: 58
****************************
now= 12:52:23
>>>>> CVAVL Speed: 51
>>>>> RWAVL Speed: 58
****************************

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

  • miron
  • Topic Author
  • Visitor
  • Visitor
19 Feb 2015 11:46 #2809 by miron
Hi,
I have prepared simple example with live mapping.
In loop I just read and write some tags.
Some tags was configured in OPC Server as simulation
and have period of changes 1000ms.

I noticed that during each loop (loop period 1000ms) after few reading that is nor reading correctly.
It just show one value: 51.

Value is changing from 50...59 in loop,
these changes I could see in opc client.
Log:

Crating thread
Starting thread
Join to thread and waiting for finish...
****************************
now= 12:42:28
>>>>> RWAVL Speed: 57
****************************
now= 12:42:29
>>>>> RWAVL Speed: 58
****************************
now= 12:42:30
>>>>> RWAVL Speed: 59
****************************
now= 12:42:31
>>>>> RWAVL Speed: 50
****************************
now= 12:42:32
>>>>> RWAVL Speed: 51
****************************
now= 12:42:34
>>>>> RWAVL Speed: 51
****************************
now= 12:42:35
>>>>> RWAVL Speed: 51
****************************
now= 12:42:36
>>>>> RWAVL Speed: 51
****************************
now= 12:42:37
>>>>> RWAVL Speed: 51
****************************
now= 12:42:38
>>>>> RWAVL Speed: 51
****************************
now= 12:42:39
>>>>> RWAVL Speed: 51
****************************
now= 12:42:40
>>>>> RWAVL Speed: 51
****************************
now= 12:42:41
>>>>> RWAVL Speed: 51
****************************
now= 12:42:42
>>>>> RWAVL Speed: 51
****************************
now= 12:42:43
>>>>> RWAVL Speed: 51
****************************
now= 12:42:44
>>>>> RWAVL Speed: 51
****************************
now= 12:42:45
>>>>> RWAVL Speed: 51
****************************
now= 12:42:46
>>>>> RWAVL Speed: 51
****************************
now= 12:42:47
>>>>> RWAVL Speed: 51
****************************
now= 12:42:48
>>>>> RWAVL Speed: 51
****************************
now= 12:42:49
>>>>> RWAVL Speed: 51
****************************
now= 12:42:50
>>>>> RWAVL Speed: 51
****************************
now= 12:42:51
>>>>> RWAVL Speed: 51
****************************
now= 12:42:52
>>>>> RWAVL Speed: 51
****************************
now= 12:42:52
>>>>> RWAVL Speed: 51
****************************
now= 12:42:53
>>>>> RWAVL Speed: 51
****************************
now= 12:42:54
>>>>> RWAVL Speed: 51
****************************
now= 12:42:55
>>>>> RWAVL Speed: 51
****************************
now= 12:42:56
>>>>> RWAVL Speed: 51
****************************
now= 12:42:57
>>>>> RWAVL Speed: 51
****************************
now= 12:42:58
>>>>> RWAVL Speed: 51
****************************
now= 12:42:59
>>>>> RWAVL Speed: 51
****************************
now= 12:42:59
>>>>> RWAVL Speed: 51
****************************
now= 12:43:00
>>>>> RWAVL Speed: 51

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

Moderators: support
Time to create page: 0.137 seconds