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  <20132014  2015  2016  2017  2018  2019  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  <20132014  2015  2016  2017  2018  2019 
<== Date ==> <== Thread ==>

Subject: RE: EPICS device disconnects and reconnects
From: Kate Feng <skatefeng@gmail.com>
To: tech-talk@aps.anl.gov, rivers@cars.uchicago.edu, anj@aps.anl.gov, eric@norum.ca
Cc: Kate Feng <skatefeng@gmail.com>
Date: Fri, 26 Jul 2013 01:36:29 -0400
Hi Mark,

Mark Rivers wrote:
> We have set the alarm status of the record to the most appropriate value based on the limited
> choices offered by EPICS.

  In response to your message to me at
http://www.aps.anl.gov/epics/tech-talk/2013/msg01262.php,
My response for that is listed at B).

I would like to contribute what I had developed in the past few weeks
regarding the disconnection/reconnection of the cameras.  The two objectives
are 1) to whiten the rectangular boxes of the ASYN output records on the GUI
screen when the ASYN device is disconnected, and 2) to process the value
of the EPICS records to match the corresponding parameters setup of the
device at reconnection of the cameras.

  Please CC the response to skatefeng@gmail.com because my E-mail
address is changed and the new one is not updated for the subscription yet.

 A) There were two options being considered for the response of disconnection/reconnection:

 Option 1) : See the attached patch prosilica.template.diff and ADBase.template.diff for the change in the record files.

 To modify mainly the record (i.e. database) file link, and run
post_event(eventNumber) in the
 prosilica::cameraLinkCallback() of prosilica.cpp file when the camera is found.
 The driver should reset the value of all the busy records (e.g. the 'Acquire'
 record for the cameras) to be 0 before the event was generated when the
 camera is disconnected or reconnected.

 The event number for each camera can be specified via prosilicaConfig() and
st.cmd. This method will trigger the processing of the output records.
 For the readbacks, the SCAN type is changed to 'Passive' and will be
processed if its associated output records are processed.  This works very well.  It is the same method as what I did at NSLS for the RTEMS firewire camera device driver, of which software is posted at
 https://sourceforge.net/projects/rtemsfirewirecameradriver/files/?source=navbar
 for one's reference.

   This method works well if one wishes to restore the value of the records to
what were  set by EPICS users prio to the disconnection of the cameras.  However, for other ASYN  devices, their associated record files need to be
modified as well.

 Option 2) :  The attached cam.diff is the patch for your reference, which I had developed for this option.

   To modify the source code by creating a link list of pointers to all the output
records that need to be processed at disconnection/reconnection, and
call 'dbpf' to process them in the driver's connection callback function
(i.e.  prosilica::cameraLinkCallback() ). The
driver should reset the value of all the busy records (e.g. the 'Acquire' record for the cameras) to be 0. The readback records should be changed to be what is
similar to the attached prosilica.template.diff and ADBase.template.diff.  In this case, the fanout records will not be needed. Only the FLNK links for each
readbacks are needed.

   The attached cam.diff is the patch for your reference, which I had developed
for this option. Only the ASYN ao, asynFloat64, bo, lo, and mbbo records were
modified for this purpose. I did not change the code for the waveform record or finish the development for this option because I was not sure if you wish to
pursuit this option. The prosilica.cpp file is modified based on the file, which
you committed the change to SVN, as per your E-mail reply at http://www.aps.anl.gov/epics/tech-talk/2013/msg01220.php.

   I would recommend a change to the patch that the dbpf() command
should set the .PROC field to be 1 if one wishes
to restore the value of the records to what were set by EPICS users before the
disconnection of the cameras. One exception is that the 'Acquire' (i.e. busy)
record should always be reset to be 0 (i.e. off) at the reconnection/disconnection.

   The advantage of this option is that once the software is fully developed,
there is no need to change the record files for the output records.  However, the SCAN field of the input records should be set as 'Passive'  and be triggered
via its associated output records. 

B) To be precise and be consistent with other ASYN software written in
asyn4-21/asyn/devEpics/*.c, the busy record (e.g. for the Acquire on/off record)
should set EPICS alarm status to be “COMM” instead of WRITE_ALARM, when the device is disconnected. The ASYN ao, asynFloat64, bo, lo, and mbbo records written in the directory asyn4-21/asyn/devEpics (see devAsynInt32.c and devAsynFloat64.c) set the EPICS alarm severity to be “Invalid” and the EPICS alarm status to be “COMM”, which are correct actions.

C) The 'Acquire' record at ADBase.template should be set as 'PINI=YES' and 'VAL=0' to set the camera in a known state (i.e. 'off' state) when the IOC is started.

D) To whiten the rectangular box, a new devConnected Boolean variable can be
added in the GUI manager (e.g. MEDM) to monitor the connection of the
ASYN device. If the STAT field of an EPICS record is changed to be epicsAlarmComm, then pr->devConnected is set to 0, and
pr->updateValueCb will be called to draw white rectangular boxes on the
device's records.

See the attached patch medm3_1_6.diff file is for your reference.

E) disconnected.jpeg is the result of the image when the camera is disconnected.

   Hope that it helps.

   Sincerely,
   Kate Feng


Attachment: ADBase.template.diff
Description: Binary data

Attachment: prosilica.template.diff
Description: Binary data

Attachment: cam.diff
Description: Binary data

Attachment: medm3_1_6.diff
Description: Binary data

Attachment: disconnected.jpeg
Description: JPEG image


Replies:
Re: EPICS device disconnects and reconnects Kate Feng

Navigate by Date:
Prev: New Detectors Integrated Ahed Aladwan
Next: igor2epics XOP minor release Wang Xiaoqiang
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  <20132014  2015  2016  2017  2018  2019 
Navigate by Thread:
Prev: Re: EPICS device disconnects and reconnects J. Lewis Muir
Next: Re: EPICS device disconnects and reconnects Kate Feng
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  <20132014  2015  2016  2017  2018  2019 
ANJ, 20 Apr 2015 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·