Hi Terry,
Another solution would be to do the following:
- On the asyn port set the option "disconnectOnReadTimeout". That way if the device does not respond it will disconnect the port.
- Load an asyn record that is connected to that asyn port.
- The asyn record CNCT field will change state when the port disconnects on read timeout.
- Use the CNCT field to control the COMSFAIL record.
IMHO this is a cleaner solution that does not involving launching a separate process.
Mark
________________________________
From: Tech-talk <tech-talk-bounces at aps.anl.gov> on behalf of CORNALL, Terry via Tech-talk <tech-talk at aps.anl.gov>
Sent: Tuesday, March 31, 2020 9:20 PM
To: tech-talk at aps.anl.gov
Subject: RE: getting streamDevice exception handler replyTimeout to write to a record [SEC=UNCLASSIFIED]
For the record, I'll put a nice answer here that I got from James Larson.
'At the end of your exec statement
direct the output, >, to /dev/null . It won't show up on the ioc .'
I tried that and it works a treat.
In the protocol file:
commsFail {
#exec 'echo "comms fail on \$0"'; #Turn this off in production
exec 'dbpf \$1:\$4 "Comms error"> /dev/null'; #/dev/null makes it silent
}
readCurrent{
.... Usual out and in stuff, then an exception handler for timeout
@replytimeout{commsFail;} #comms is down
}
And in the database file:
....
#COMMSFAIL is the record to write to on a replytimeout
field(INP, "@$(DEVICE).proto readCurrents($(P)$(R),ITIME_MON,OVR_STS,COMMSFAIL) $(PORT) 0")
.....
Thanks James.
- Replies:
- Re: getting streamDevice exception handler replyTimeout to write to a record [SEC=UNCLASSIFIED] Johnson, Andrew N. via Tech-talk
- References:
- RE: getting streamDevice exception handler replyTimeout to write to a record [SEC=UNCLASSIFIED] CORNALL, Terry via Tech-talk
- Navigate by Date:
- Prev:
RE: getting streamDevice exception handler replyTimeout to write to a record [SEC=UNCLASSIFIED] CORNALL, Terry via Tech-talk
- Next:
Re: Newport DL325 Mark Rivers via Tech-talk
- 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: getting streamDevice exception handler replyTimeout to write to a record [SEC=UNCLASSIFIED] CORNALL, Terry via Tech-talk
- Next:
Re: getting streamDevice exception handler replyTimeout to write to a record [SEC=UNCLASSIFIED] Johnson, Andrew N. via Tech-talk
- 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
|