Remember that for output records standard asyn device support tries to read the current value from the driver in the init_record() function. If the read returns asynSuccess (0) then the output record VAL field is initialized to this value. This is done to support "bumpless reboots".
Your readInt32 routine should return asynError for this call if you don't want to initialize the VAL field of the output record this way. If you use the base class asynPortDriver::readInt32 it will return asynSuccess if your driver has previously called setIntegerParam for that parameter. If not it will return asynError.
Note that this could explain your writeInt32 getting called with 0 for the PINI processing of the record, if your readInt32 returned 0. But it would not explain the behavior that you described of then forcing the record to process in your startup script and it writing 3, the VAL field from your database. The 3 would have been replaced by 0 at that point.
Mark
________________________________________
From: Zenon Szalata [[email protected]]
Sent: Thursday, June 27, 2013 11:11 AM
To: Mark Rivers
Cc: [email protected]
Subject: Re: Record Processing
Hi Mark,
Yes it does. I believe it does get called for this record. I put a
print statement in the readInt32 routine and was surprised that it is
getting called for most of the implemented records, both longin and
longout. I have implemented action in the readInt32 routine for some of
the longin records. For any other record I call
status=asynPortDriver::readInt32 and status is returned.
Zen
On 06/26/13 22:59, Mark Rivers wrote:
> It does not make sense that it is writing 0.
>
> Does your driver implement readInt32 and does it get called during iocInit for that record? If so what does it return as the status function return value?
>
> Mark
> ________________________________________
> From: Zenon Szalata [[email protected]]
> Sent: Wednesday, June 26, 2013 12:01 AM
> To: Mark Rivers; [email protected]
> Subject: Record Processing
>
> Hi Mark,
> I have a simple longout record
>
> record( longout, "$(P):LO:DEBUG-$(M):MFUNC"){
> field( DESC, "Modbus Func:")
> field( DTYP, "asynInt32")
> field( OUT, "@asyn(DEBUG,0,1)LO_MFUNC")
> field( VAL, "3")
> field( PINI, "YES")
> }
>
> It is a part of an IOC which uses asynPortDriver class driver. I put a
> print statement in writeInt32 function and at IOC initialization time it
> prints that the value to write is 0.
> Then at the end of st.cmd script I have put a
> dbpf <record name>.PROC 1
> for this record and this time the value to write is 3. Why is the
> record writing 0 at IOC initialize time?
> I am not sure if this is a basic EPICS or asyn issue, so I thought I ask
> you.
> Thanks,
> Zen
- References:
- Record Processing Zenon Szalata
- RE: Record Processing Mark Rivers
- Re: Record Processing Zenon Szalata
- Navigate by Date:
- Prev:
Re: specifying network interface with pcaspy caServer Jameson Graef Rollins
- Next:
Re: registerRecordDevice... crashes IOC during startup Andrew Johnson
- 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: Record Processing Zenon Szalata
- Next:
caQtDM V3.1.1 Mezger Anton Christian
- 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
|