Thank you for your input. I think that did the trick, I added a ca_pend_io after the loop (where all the ca_put calls should be done) and I get PV updates
as expected. But I kept the ca_pend_io call for each search as it is.
From: Engbretson, Mark S. [mailto:firstname.lastname@example.org]
Sent: Tuesday, March 05, 2019 4:43 PM
To: Abdalla Ahmad <email@example.com>
Subject: RE: Questions about channel access C API programming
Typically, a channel access client should perform at the search and connects all at one time so that the network call will be optimized. If you do them
one at a time, you have the overhead associated with performing the search and connect over and over and over again, when they could all be done at the same time.
So, do all the searches together, followed by the pendio.
Repeat when you are writing the values, stack them all up, then do the pendio.
The attached C file is a snippet from a Qt project. In the project there was a function that writes values to many PVs in a loop. What was happening is that some PVs do not get their
new value updated immediately but after 3 or 4 seconds. The code shows a similar behavior, two consecutive "ca_put" calls, and the same behavior occurs. I double-checked the database (included in the comments) but there is nothing wrong. I tried to use ca_context_
or ca_task_ but the project crashes maybe because the QE framework is already handling low-level CA. What am I missing here?
Another two questions came up:
What is the difference between ca_task_initialize and ca_context_create?
What is the difference between request types (DBR_) and field types (DBF_)?
P.S.: We are using Base 3.15.6
Tel: (+962-5) 3511348 , ext. 265
Fax: (+962-5) 3511423