Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  <20142015  2016  2017  2018  2019  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  <20142015  2016  2017  2018  2019 
<== Date ==> <== Thread ==>

Subject: RE: Portable Channel Access Server Event Queue
From: "Christopher J. Pendleton" <cpendleton@ptcusa.com>
To: "'Hu, Yong'" <yhu@bnl.gov>, <tech-talk@aps.anl.gov>
Date: Thu, 22 May 2014 09:42:33 -0400
Hello Hu.

Thanks so much for your reply. The reason I went with the PCAS instead of
regular EPICS drivers is because I have a pre-existing application that fit
perfectly into the PCAS model. Integration was very easy. This application
supports many devices, and the PCAS API added EPICS support to our devices
with little effort. I am considering regular EPICS drivers, but that would
be a good deal of effort.

1. postEvent() is probably called much faster than 1 kHz in some cases. I am
essentially breaking up an array into individual elements and trying to
distribute them.
2. Thanks for that link. I strongly suspect that the queue size is being
exceeded and events are being discarded. Without knowing the internals, I
would guess an increase in the queue size to an appropriate value would fix
this problem. The amount of memory required is not that great. I would much
appreciate it if the developers of this library could weigh in on this.
3. Thanks! I will look at this. I suspect it will confirm #2.
4. I have considered this approach. I wanted to avoid doing this if there
was a simpler way to do it, but I may end up implementing this.
5. See my opening paragraph. We may end up doing this. Everyone here at
Pyramid loves EPICS!

Thanks again,
Chris

-----Original Message-----
From: Hu, Yong [mailto:yhu@bnl.gov] 
Sent: Thursday, May 22, 2014 9:14 AM
To: Christopher J. Pendleton; tech-talk@aps.anl.gov
Subject: RE: Portable Channel Access Server Event Queue

Hello Chris,

A few questions and suggestions for you:

1. You said that postEvent() is called repeatedly at a very high rate. Is
the rate at range of 10 Hz, 100 Hz or 1 KHz? I tested with PCAS example
(makeBaseApp -t caServer ...) and found that I could not camonitor "jane" (a
single double value) if I change its scan period from1.0e-1 to 5.0e-3 (200
Hz).   

2. Regarding the queue size, I found "Server Subscription Update Queuing" at
http://www.aps.anl.gov/epics/base/R3-14/12-docs/CAref.html. Now,  we have
questions for Jeff H. and others who know PCAS internal implementation: are
the queue sizes for CA servers (PCAS, RSRV) and CA client configurable and
how to configure them if they are? Does postEvent() use callbackQueueSize
which is 2000 by default? Maybe, Chris's case is not related to the queue
size at all.

3. You may use caServer::subscriptionEventsPosted() and
caServer::subscriptionEventsProcessed() in your portable CA server. These
two numbers should be same if the whole system, including the portable CA
server and the CA client, is working properly. 

4. You may re-think how you handle your data. Instead of sending the
sample(s) to the portable CA server and then postEvent() at a very high
rate, you may queue / accumulate the sample(s), i.e. pack the data as an
array (or a bigger array if the data source is already an array). Then,
postEvent() that big data set at a lower rate.

5. If #4 is really not what you like to do, you may write a regular EPICS
driver (record support-->device support (or asyn-based) --> driver) for your
device, which is a natural way for EPICS-based low-level device control. The
regular EPICS driver could give you up to KHz update rate if you really want
your system to be so fast. 

Good luck!

Yong

________________________________________
From: tech-talk-bounces@aps.anl.gov [tech-talk-bounces@aps.anl.gov] on
behalf of Christopher J. Pendleton [cpendleton@ptcusa.com]
Sent: Monday, May 19, 2014 11:56 AM
To: tech-talk@aps.anl.gov
Subject: RE: Portable Channel Access Server Event Queue

I was hoping someone could help me with this? Thanks!

-----Original Message-----
From: Christopher J. Pendleton [mailto:cpendleton@ptcusa.com]
Sent: Friday, May 09, 2014 12:11 PM
To: 'tech-talk@aps.anl.gov'
Subject: Portable Channel Access Server Event Queue

Hello! I am using the portable channel access server API to provide EPICS
access to our devices. Some of our devices perform data acquisition at high
rates and send a buffer up to the server, which then calls the casPV class
method postEvent() repeatedly at a very high rate. When I run a client that
monitors this PV, I often see that some of the data samples are missing. I
suspect that this is a function of the queue size that postEvent()
populates, the rate at which it is populated, and the rate at which it is
offloaded by the client(s). Could someone please help me understand why the
client(s) would not receive the full set of data samples posted to the event
queue?

Regards,
Chris

Christopher J. Pendleton
Director, Software Development
Pyramid Technical Consultants, Inc.
http://ptcusa.com/=


---
This email is free from viruses and malware because avast! Antivirus protection is active.
http://www.avast.com



References:
RE: Portable Channel Access Server Event Queue Christopher J. Pendleton
RE: Portable Channel Access Server Event Queue Hu, Yong

Navigate by Date:
Prev: RE: Portable Channel Access Server Event Queue Hu, Yong
Next: RE: how to know which PVs write to a PV Arnold, Ned D.
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  <20142015  2016  2017  2018  2019 
Navigate by Thread:
Prev: RE: Portable Channel Access Server Event Queue Hu, Yong
Next: CSS: The difference among Javascript 、Python Script and Execute Command hongchunxia
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  <20142015  2016  2017  2018  2019 
ANJ, 17 Dec 2015 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·