Experimental Physics and Industrial Control System
Hi Mark,
I have the same question: changing longout/ao records' value at driver
level.
I see you can sync at database level. But if there are twenties of them,
which is normal for a device with many settings, the database would look
clumsy.
Is there a reason, preventing doing so in asynDriver?
Best,
Xiaoqiang
-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Mark Rivers
Sent: Sunday, July 11, 2010 11:21 PM
To: Szalata, Zenon M.
Cc: [email protected]
Subject: RE: Another asynPortDriver Question
Hi Zen,
> You showed me how to initialize a longout record from a hardware
register at iocInit time.
> I implemented that, as you suggested by creating my version of the
virtual function readInt32, and it works fine.
Note that you don't even need to implement your own version of
readInt32. All you need to do is read the value from the hardware
register in your constructor and call setIntegerParam with the value.
Then when device longout support calls the asynPortDriver::readInt32
function during initialization it will get the current value, and will
get an asynSuccess return. If you have not called setIntegerParam
before iocInit then asynPortDriver::readInt32 will return asynError, and
the longout device support will not initialize the record to that value.
> How can I modify the contents of a longout record from the low level
driver code at run time?
> I am developing a low level asyn driver derived from asynPortDriver
class and it became of interest to me to do that.
> I think that I could accomplish this using dbAccess routines, but that
seems somewhat inelegant.
I would recommend doing it in the database. Here is an example of how I
do it. There are 2 longout records, one with soft device support and
one with asyn device support. There is a longin record on the same
parameter with SCAN=I/O Intr. When your driver does setIntegerParam()
and callParamCallbacks() this longin record processes. It writes the
value into the soft longout record, which writes it to the asyn longout.
But the asyn longout does not process because of the configuration of
SDIS and DISV, so your driver is not called. This has the effect of
synchronizing the longout to the driver value any time the driver
changes it.
record(longout, "$(P)$(R)FileNumber")
{
field(PINI, "YES")
field(OUT, "$(P)$(R)FileNumber_write PP")
field(VAL, "1")
}
record(longout, "$(P)$(R)FileNumber_write") {
field(SDIS, "$(P)$(R)FileNumber_Sync.PACT")
field(DISV, "1")
field(DTYP, "asynInt32")
field(OUT, "@asyn($(PORT),$(ADDR),$(TIMEOUT))FILE_NUMBER")
}
record(longin, "$(P)$(R)FileNumber_RBV") {
field(DTYP, "asynInt32")
field(INP, "@asyn($(PORT),$(ADDR),$(TIMEOUT))FILE_NUMBER")
field(SCAN, "I/O Intr")
field(FLNK, "$(P)$(R)FileNumber_Sync") } record(longout,
"$(P)$(R)FileNumber_Sync") {
field(DOL, "$(P)$(R)FileNumber_RBV NPP")
field(OMSL, "closed_loop")
field(OUT, "$(P)$(R)FileNumber PP") }
Mark
________________________________
From: Szalata, Zenon M. [mailto:[email protected]]
Sent: Sun 7/11/2010 3:53 PM
To: Mark Rivers
Cc: [email protected]
Subject: Another asynPortDriver Question
Hi Mark,
You showed me how to initialize a longout record from a hardware
register at iocInit time. I implemented that, as you suggested by
creating my version of the virtual function readInt32, and it works
fine.
I now have a related question.
How can I modify the contents of a longout record from the low level
driver code at run time? I am developing a low level asyn driver
derived from asynPortDriver class and it became of interest to me to do
that. I think that I could accomplish this using dbAccess routines, but
that seems somewhat inelegant.
Thanks in advance,
Zen
- Replies:
- RE: Another asynPortDriver Question Mark Rivers
- References:
- Another asynPortDriver Question Szalata, Zenon M.
- RE: Another asynPortDriver Question Mark Rivers
- Navigate by Date:
- Prev:
RE: linking to shared objects user libraries Andrew C. Starritt
- Next:
StreamDevice question - trailing characters Mark Bennett
- 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: Another asynPortDriver Question Mark Rivers
- Next:
RE: Another asynPortDriver Question 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