EPICS Controls 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  2014  <20152016  2017  2018  2019  2020  2021  2022  2023  2024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  <20152016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: RE: Read record field in asynDriver
From: Mark Rivers <[email protected]>
To: Ralph Lange <[email protected]>, EPICS Tech-Talk <[email protected]>
Date: Fri, 20 Feb 2015 14:24:06 +0000
Hi Ralph,

> If we put info items with the by-channel configuration info into the 
> records, we can loop over all records and search for those items when 
> initializing the card, and do the by-channel initialization at that  point. 

I don't think I understand.  What code is doing the steps you outline above?

Mark

________________________________________
From: [email protected] [[email protected]] on behalf of Ralph Lange [[email protected]]
Sent: Friday, February 20, 2015 4:13 AM
To: EPICS Tech-Talk
Subject: Re: Read record field in asynDriver

Well,

Using info items, this can be solved outside of ASYN.

If we put info items with the by-channel configuration info into the
records, we can loop over all records and search for those items when
initializing the card, and do the by-channel initialization at that
point. This will be perfectly after the card initialization, but early
enough (before the db is initialized and processing starts), and the
info item can be set up to contain exactly the information needed.

Sorry for bothering you,
~Ralph


On 19/02/2015 15:26, Ralph Lange wrote:
> Hi Mark,
>
> We are facing a similar issue:
>
> Our ASYN port driver for a DAQ board is modelling the board and its
> channels as a multi device, with port=board and addr=channel.
>
> During per-record-instance initialization, the port driver must call
> the low level card driver with one configuration call per channel,
> using board number, channel number, and range (record's EGUL, EGUF) as
> parameters.
>
> What would be your approach for that?
>
> Your intermediate record hack does not work nicely (in addition to
> being somewhat ugly), as the parameter values would come in too late
> and separately, and the addr=channel number is not contained in a
> field of the "main" record.
>
> The driver's connect() is only called once for the port, right?!
> Couldn't that be complemented with a routine that is called once per
> addr for multi devices, and gets the addr and maybe a pointer to the
> parameter field of the link that it is being called for? (We'd be
> happy to cram the necessary low level config params into the link
> config, and have the driver pull it out.)
> Alternatively, probably cleaner and more flexible, you could allow a
> special info field for asyn driver configuration options to be added
> to the record, and pass a a pointer to its string value when calling
> the driver for each addr.
>
> What do you think?
>
> Thanks for your help,
> ~Ralph
>
>
> On 02/02/2015 23:36, Mark Rivers wrote:
>> There is no direct communicaton possible between the NELM field of
>> the waveform record and the asyn driver.  However, it is easy to do
>> using an intermediate longout record, for example:
>>
>> record(longout,"$(P)$(R)NELM1") {
>>      field(DOL,  "$(P)$(R)Waveform1.NELM CP MS")
>>      field(OMSL, "closed_loop")
>>      field(DTYP, "asynInt32")
>>      field(OUT, "@asyn($(PORT),$(ADDR),$(TIMEOUT))WAVEFORM_NELM1")
>> }
>>
>> record(longout,"$(P)$(R)NELM2") {
>>      field(DOL,  "$(P)$(R)Waveform2.NELM CP MS")
>>      field(OMSL, "closed_loop")
>>      field(DTYP, "asynInt32")
>>      field(OUT, "@asyn($(PORT),$(ADDR),$(TIMEOUT))WAVEFORM_NELM2")
>> }
>>
>> These longout records  will process whenever the NELM fields change,
>> including once at iocInit.
>>
>> They will send the NELM field of the appropriate waveform record to
>> you driver.  You just need to treat the writes with 2 different
>> pasynUser->reason values differently.  If it is the one corresponding
>> to WAVEFORM_NELM1 do one thing, and do something different if it is
>> for WAVEFORM_NELM2.
>>
>> Mark



Replies:
Re: Read record field in asynDriver Ralph Lange
References:
Read record field in asynDriver Vikram Bhagat
RE: Read record field in asynDriver Mark Rivers
Re: Read record field in asynDriver Ralph Lange
Re: Read record field in asynDriver Ralph Lange

Navigate by Date:
Prev: Re: sseq 2-2-1 issue/bug Benjamin Franksen
Next: RE: Read record field in asynDriver Mark Rivers
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  <20152016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: Read record field in asynDriver Ralph Lange
Next: Re: Read record field in asynDriver Ralph Lange
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  <20152016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 16 Dec 2015 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·