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

Subject: RE:
From: Mark Rivers <[email protected]>
To: "'Vikram Bhagat'" <[email protected]>, "[email protected]" <[email protected]>
Date: Fri, 8 Mar 2013 17:11:35 +0000
Hi Vikram,

Please provide some more information.

- What version of asyn are you using?  Initialization of mbboDirect records changed in asyn R4-21 as you will see from the release notes here:
http://www.aps.anl.gov/epics/modules/soft/asyn/R4-21/RELEASE_NOTES.html

This is what the release notes say about it:
"Improved the initMbboDirect function in devAsynUInt32Digital.c. If an initial value is read successfully from the driver it now sets the .Bn fields in the record. It also sets VAL rather than RVAL and returns 2 rather than 0. Thanks to Andrew Johnson for this."

- I assume that you have written an asyn port driver that implements the asynUInt32Digital interface?  Is your driver written in C using the native C interface, or is it written in C++ using the asynPortDriver base class?

Asyn device support for output records, including mbboDirect, always does the following in the init_record function:
  - Reads the current value from the asyn port driver using status = pasynUInt32Digital->read().
  - If the driver returns success (status = 0) then the record is initialized to the value read from the driver.
  - If the driver does not return success then the record is not initialized with the value read from the driver.

Is your driver returning success (0) when a value is initially read at iocInit time?

> So first time after IOC restart..... the first value writes 0 (zero) irrespective of the value I am setting then after it is normal.

What do you mean by "value I am setting"?  Are you setting the value in the database file, or are you setting the value with a channel access or database put operation?  

If you are only setting it in the database file, and if your driver is returning status=0 and value=0 on the initial read that would explain your problem.  

However, if you are setting initial value via a channel access or database put of a non-zero value, and 0 is being written, then I do not understand the problem.

Mark




From: [email protected] [mailto:[email protected]] On Behalf Of Vikram Bhagat
Sent: Friday, March 08, 2013 9:55 AM
To: [email protected]
Subject: 

Dear All,
    i am using Asyn driver and mbboDirect record type for my application 

record (mbboDirect,"SET-MBBO")
{
        field(DESC, "New Variable")
        field(DTYP, "asynUInt32Digital")
        field(OUT, "@asynMask(ni6528_0, 3,7) writembbo")
  }
Where i have used "writembbo" as reason for device support driver.

i am not setting any other fields 

I am not even setting B0 to B15 as want the user can set any value dynamically means user can set any bit 1 or 0 for any bit.   
 
So first time after IOC restart..... the first value writes 0 (zero) irrespective of the value I am setting then after it is normal.
 
So why it is only first time then after it is working fine.... whatever value I set it write that value only.
 
--> if i set  field(SEVR, "NO_ALARM")
then it works fine at first time after IOC restart.

So in record process routine
static long process(mbboDirectRecord *prec)      in record support module
 prec->sevr becomes INVALID_ALARM  and val field will fill with B0...B15 and first time value become zero as i am not setting any value for B0..B15


Due to this record support module write zero in driver and i am not able to set first time user define value at runtime.

How i can come out of this

with regards



References:
[no subject] Vikram Bhagat

Navigate by Date:
Prev: [no subject] Vikram Bhagat
Next: Re: Automatic IOC configuration loading Bruno Martins
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  <20132014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: [no subject] Vikram Bhagat
Next: mbboDirect record questions Mark Rivers
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  <20132014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 20 Apr 2015 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·