Experimental Physics and Industrial Control System
At Fermilab, several of us are working on the data acquisition for NOvA,
a future neutrino experiment. We would like to use process variables in
soft IOCs to pass string messages between processes in the system, and
we are trying to understand the best way to accomplish this.
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
- Replies:
- Re: soft IOC string and array records Kay-Uwe Kasemir
- Re: soft IOC string and array records Tim Mooney
- RE: soft IOC string and array records Jeff Hill
- Navigate by Date:
- Prev:
Re: I have a question about using muti IOC Luedeke Andreas
- Next:
Re: soft IOC string and array records Kay-Uwe Kasemir
- Index:
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
<2007>
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
- Navigate by Thread:
- Prev:
Re: [No Subject] Andrew Johnson
- Next:
Re: soft IOC string and array records Kay-Uwe Kasemir
- Index:
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
<2007>
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024