All,
What is the correct thing to do when a bad link name is encountered at initialisation?
We recently had a problem when an string parameter was badly named in the OUT link of stringoutRecord of an areaDetector device. This printed an error message at start up (which no-one saw) but didn't disable the record and subsequent writes to the record (by autosave/restore) trashed the first parameter in the device (which was also a string). I don't think this is the right thing to do.
The rough call chain at the time of the problem is that iocInit initialises the record by calling:
prec->rset->init_record (i.e. init_record in stringoutRecord.c)
prec->dset->init_record (i.e. initSoWrite in devAsynOctet.c)
initDrvUser in devAsynOctet.c
...
asynPortDriver::drvUserCreate in asynPortDriver.cpp
The bottom routine prints an error message because it can't find the parameter and returns bad status but doesn't change pasynUser->reason.
Then initDrvUser also printed an error, but couldn't do anything more since it is a void function. Hence the record didn't know there was a problem and believed that initialisation had succeeded.
If it did return an error it could propagate it up to the initSoWrite function which has access to the record structure and so could change the value of fields or return an error to record support. If record support gets an error it returns it to iocInit, but otherwise ignores it. iocInit then ignores any bad status.
The options are:
- set the reason to -1 and check for it in asynPortDriver so any subsequent write fails.
- change initDrvUser to return a status and disable the record somehow (or set it to Soft Channel) in device support, record support or iocInit.
In similar circumstances devAsynInt32 tries to disable the record by setting pact to 1 and returning a bad status - is this the right thing to do? I looked at various other device drivers and consistency wasn't a feature. Some called recGblRecordError, but this only prints a message, doesn't disable the record.
I know that consistency in device support isn't one of EPICS's features, but if we could decide on a reasonable approach I would be happy to make asyn adhere to it...
Cheers,
Nick Rees
Principal Software Engineer Phone: +44 (0)1235-778430
Diamond Light Source Fax: +44 (0)1235-446713
--
This e-mail and any attachments may contain confidential, copyright and or privileged material, and are for the use of the intended addressee only. If you are not the intended addressee or an authorised recipient of the addressee please notify us of receipt by returning the e-mail and do not use, copy, retain, distribute or disclose the information in or attached to the e-mail.
Any opinions expressed within this e-mail are those of the individual and not necessarily of Diamond Light Source Ltd.
Diamond Light Source Ltd. cannot guarantee that this e-mail or any attachments are free from viruses and we cannot accept liability for any damage which you may sustain as a result of software viruses which may be transmitted in or with the message.
Diamond Light Source Limited (company no. 4375679). Registered in England and Wales with its registered office at Diamond House, Harwell Science and Innovation Campus, Didcot, Oxfordshire, OX11 0DE, United Kingdom
- Replies:
- RE: What to do when device initialisation fails Mark Rivers
- Navigate by Date:
- Prev:
measComp R1-1 released Mark Rivers
- Next:
RE: What to do when device initialisation fails Mark Rivers
- 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:
measComp R1-1 released Mark Rivers
- Next:
RE: What to do when device initialisation fails Mark Rivers
- 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
|