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  <20142015  2016  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  <20142015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: PV for both input AND output
From: Andrew Johnson <[email protected]>
To: <[email protected]>
Date: Thu, 16 Jan 2014 10:54:58 -0600
Hi Matteo,

On 01/16/2014 09:33 AM, Matteo Pardi wrote:
> Can I create a process variable which will have a callback to read data,
> and a callback to write data?

The API between a record type and its device support is set by the
designer of the record type. If you want a record type that does both
input and output you can create one yourself with both a read and a
write function in the DSET. The IOC only requires that the DSET
structure starts like this:

struct my_dset {   /* device support entry table */
    long	number;		/* number of support routines */
    DEVSUPFUN	report;		/* print report */
    DEVSUPFUN	init;		/* init support layer */
    DEVSUPFUN	init_record;	/* init device for particular record */
    DEVSUPFUN	get_ioint_info;	/* get io interrupt information */
    /* Other functions go here and are record-type specific */
};

You can add as many additional functions to the DSET as you need to
implement the desired interface between the record and the device.

When you write your own record type though you do have to write all the
associated device support layers as well, the support layers provided by
Asyn or StreamDevice say will not work directly with your new type,
although you may be able to use them as examples and re-use their driver
layer.

Note that a record type must have a link field called either INP or OUT
to properly connect to device support.

Hope this helps,

- Andrew
-- 
Advertising may be described as the science of arresting the human
intelligence long enough to get money from it. -- Stephen Leacock

Replies:
Re: PV for both input AND output Pete Jemian
References:
PV for both input AND output Matteo Pardi

Navigate by Date:
Prev: RE: garbage in zero length arrays Mezger Anton Christian
Next: Re: PV for both input AND output Pete Jemian
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  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: RE: PV for both input AND output Emmanuel Mayssat
Next: Re: PV for both input AND output Pete Jemian
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  2020  2021  2022  2023  2024 
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 ·