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.

Behaviour of EasyUAClient.WriteMultipleValues

More
27 Jun 2023 13:15 #11846 by support
Hello.

you wrote "regarding point 4" - I think that was meant to be point 3?

Each change will be written to the server and only then the method call will return. No cache on the client side, in this sense.

Best regards
The following user(s) said Thank You: Kärcher

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

More
27 Jun 2023 12:43 #11845 by Kärcher
Thanks for the fast reply.


regarding point 4: Here i should have be more precise. Let's pretend a try to write a single item in a very short period e.g. 10 times with 50 ms. Do i have to expect that each change will be written to the server or will it be written into something like a cache and only cause one (or depending on timing) write operation?

Nevertheless my Application must take more responsibility. So basically, i will create a Queue in my Application. The Businesslogic itself will only write into our internal Queue and a seperate Task/Thread will take all the items from the queue and trying to write it to the OpcServer.

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

More
27 Jun 2023 10:26 #11843 by support
Hello.

1. Yes. Quote from kb.opclabs.com/Non-guarantees : "If you call EasyXXClient.Method1 on time1 and you then call EasyXXClient.Method2 on time2, before EasyXXClient.Method1 returns, it is not guaranteed that the OPC operations for Method1 will be called before those for Method2.". BTW, it's not "because of QuickOPC": What you are asking for is physically impossible to guarantee in preemptive threading environment without additional synchronization between your code and the library code.
2. No. All Quick|OPC reads and writes are blocking in respect to the caller.
3. Not sure what you mean, there are some caches, but nothing that would relate to the issue at hand.
4. No.

5. Possible reasons include:
a) fluctuations of execution time on the server side
b) operations on the same server are serialized, so with the approach you are doing now, first write may have to wait for the second to complete, or vice versa.
c) quite likely: There is not just writing. There is also connecting to the server, which takes some time. QuickOPC established the connection first time it needs it. If unused for some time, it closes it. When doing operations on "random" times, sometimes the connection will be open and the operation will be faster, sometimes it will be closed and will have to be reopened and it will be slower. See HoldPeriods for making QuickOPC to "hold" onto the connection longer. Also, when you are subscribed to anything, the connection stays open all the time.

Best regards
The following user(s) said Thank You: Kärcher

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

More
27 Jun 2023 05:18 #11840 by Kärcher
hi,

i'm currentliy working on a tool that is writing some values via opc. Unfortunatetly i don't get how WriteMultipleValues really bahaves. We're using QuickOpc Version "5.70.1053" in a .net6 environment.

I do not want my whole application to stop while we are trying to write to the OPC Server. So we use a similar approach as you described here (www.opclabs.com/forum/ua-reading-writing-subscriptions/2451-...is-synchronous-or-asynchronous). But Unfortunatly when we are calling WriteMultipleValues from different Tasks (Threads) WriteMultipleValues does not keep the sequence.
e.g.
Step 1 call WriteMultipleValues for 3 bool Items setting all to false. Lets call those items A, B, C
Step 2 while the first WriteMultipleValues is still active, we're trying to use WriteMultipleValues to A to true

Unforturnatly both calls will return succes, but the second call will return first. This will result in a "lost update".

Questions:
1. Is this behaviour intended?
2. Is there a different part of the API that we can use to get both, "sequential writing" and "not blocking our application"?

If not we will need to implement kind of a message queue in our own code. But therefore we need some information.
3. Is there any kind of "cache" inside the Lib?
4. When calling in a scenario when the OPC-Server is not reachable, will the value be written as soon as the the OPC-Server is reachable again?
5. When calling WriteMultipleValues in a scenario when the OPC-Server is not reachable, a call will take between 100ms and 2000ms. Where does the big difference come from?

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

Moderators: support
Time to create page: 0.048 seconds