EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  <20032004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  <20032004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: device support for R3.14.1 Linux IOC
From: Andrew Johnson <[email protected]>
To: Dylan Maher Loughnan <[email protected]>
Cc: [email protected]
Date: Wed, 05 Feb 2003 15:53:14 -0600
Dylan Maher Loughnan wrote:

I am experimenting with EPICS base R3.14.1. running it on a standard RedHat7.3 machine. I have written device support for a few NI DAQ cards, which is going very well.

Great. If you're willing to make this code available to other sites when it's finished, please submit entries for those cards to the EPICS Hardware Support list. </commercial>


The scan period seems to be consistently extended by an 100th of a second, when using device support. I first noticed this when I toggled a binary out at 10Hz to generate a square wave. I saw the effect very clearly on the oscilloscope.

Here is the ca-monitor with empty device support

DML:Bo0 02/05/03 16:06:27.070044 DML:Bo0 02/05/03 16:06:27.280062 DML:Bo0 02/05/03 16:06:27.490039 DML:Bo0 02/05/03 16:06:27.700034 DML:Bo0 02/05/03 16:06:27.910037 DML:Bo0 02/05/03 16:06:28.120074 DML:Bo0 02/05/03 16:06:28.330045 DML:Bo0 02/05/03 16:06:28.540051 DML:Bo0 02/05/03 16:06:28.750047 DML:Bo0 02/05/03 16:06:28.960049 Using soft records, there is no such problem.

Has anyone else noticed this?

Yes, and I spent some time looking at it many months ago, although I can't remember the exact details now. IIRC it occurs because the linux kernel uses a 100Hz clock tick, and doesn't do timer arithmetic to an accuracy greater than that tick, so depending on how long your scan task takes to execute, the system call that implements nanosleep() frequently rounds up twice, adding an extra 0.01 seconds to the delay.


This is definitely not due to an EPICS bug (I checked that at the time), and I don't think there's any easy way to get around it other than possibly explore the high resolution timer kernel patches that are supposed to exist - I've never tried them though.

- Andrew
--
Tongue-twister: Say "Peggy Babcock" 10 times without stumbling...


References:
device support for R3.14.1 Linux IOC Dylan Maher Loughnan

Navigate by Date:
Prev: device support for R3.14.1 Linux IOC Dylan Maher Loughnan
Next: Re: device support for R3.14.1 Linux IOC Andrew Johnson
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  <20032004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: device support for R3.14.1 Linux IOC Dylan Maher Loughnan
Next: Re: device support for R3.14.1 Linux IOC Andrew Johnson
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  <20032004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 10 Aug 2010 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·