Experimental Physics and
| |||||||||||||||
|
With EPICS Base R3.14.8.2, we have experimented with string and waveform records and have noticed that messages are not always delivered to monitor processes when the messages are quickly written to the PV. I'll include some of the details of our tests below, but the central issue seems to be illustrated by the following snippet of code from db_post_single_event_private in dbEvent.c: /* * if we have an event on the queue and we are * not saving the current value (because this is a * string or an array) then ignore duplicate * events (saving them without the current value * serves no purpose) */ if (!event->valque && event->npend>0u) { UNLOCKEVQUE(ev_que) return; } I don't understand all of the ramifications of this code comment, but it certainly sounds like fast updates to string and array records are not all expected to be delivered. So, the question becomes: if we want updates to a string or waveform record (or something similar) to *always* be delivered to monitors, what are our options? We have casually used CA servers when first learning EPICS, but have not yet investigated whether they have this same feature. Are CA servers an option? Or are there established ways to select the delivery of all updates in a soft IOC? The tests that we ran used a soft IOC created with 'makeBaseApp.pl -t ioc' and database records like the following: record(stringout, "test1/sampleString") { field(DTYP, "Soft Channel") } record(waveform,"test1/sampleWaveform") { field(DTYP,"Soft Channel") field(NELM,"32") field(FTVL,"UCHAR") } To update the PV value at a reasonably high rate, we simply made a copy of caput.c and added a loop around the writing of the data as shown below (the modification of the first character in the sbuf/pbuf array allowed us to check for missing or duplicate records when observing the updates with a camonitor client): for (idx = 0; idx < 100; idx++) { sprintf(sbuf[0], "%d", idx); result = ca_array_put (dbrType, count, pvs[0].chid, pbuf); result = ca_pend_io(caTimeout); if (result == ECA_TIMEOUT) { fprintf(stderr, "Write operation timed out: Data was not written.\n"); return 1; } } For the waveform record test, we started the soft IOC, ran 'camonitor test1/sampleWaveform', and then ran the modified caput several times with 'caput -a test1/sampleWaveform 5 2 4 6 8 10'. Some of the times that we ran caput, we saw all 100 messages arrive at the camonitor. Other times, only one or two of them did. Thanks in advance for any help that folks can provide with this, Kurt Biery
| ||||||||||||||
ANJ, 10 Nov 2011 |
·
Home
·
News
·
About
·
Base
·
Modules
·
Extensions
·
Distributions
·
Download
·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing · |