Begin forwarded message: Date: May 28, 2008 1:27:11 PM CDT Subject: Re: question about ca arrays
Matthieu -
I don't think either of the test clients are guaranteed to get consistent data. Since the arrays are not buffered (as you correctly recall), if the delivery of the array to the client gets delayed for some reason, the next packet could be overwriting the buffer as the ca server is sending it.
To avoid a similar problem, the sscan record (available in modules/soft) uses a double buffer for a single array field so that one may be written as the other is served up via the ca server (look for A_BUFFER/B_BUFFER). Something like this would give you more confidence, but once again would not be guaranteed unless you added some "has-been-delivered-tokens" and designed appropriate exception handling .
HTH -
Ned
On May 28, 2008, at 12:24 PM, Matthieu Bec wrote: Hi all,
I setup an epics x86-ioc attached to a tcp server, the ioc listens to known size packets from the server and fills an epics waveform record with the data. The packets are ~21kB and update at ~50Hz, our clients have EPICS_CA_MAX_ARRAY_BYTES set.
One of our user reported seeing intermittent corrupt values, the rate is highly unpredictable: one bad sample every few seconds to few minutes.
I setup two minimal test clients to check what was happening -
1. one polling ca_get (which is how my user implemented his client app) 2. another using ca_monitor
(1) reproduce the problem while (2) appears trouble free.
I remember reading a post on tech-talk about string/array not being buffered and thought that might explain the issue with (1), something like concurrent read/write maybe. Could this be the issue?
Also, I was wondering if (2) is guaranteed to be consistent? Do I need to put something else in place so every single waveform update will be consistent.
Thanks, Matthieu
-- Matthieu Bec Gemini Observatory Tel: +56 51 205785 c/o AURA, Casilla 603 Fax: +56 51 205650 La Serena, Chile
|