EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  <20062007  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  2003  2004  2005  <20062007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: Device with INP as a PV_LINK
From: Andrew Johnson <[email protected]>
To: Eric Norum <[email protected]>
Cc: epics <[email protected]>
Date: Wed, 06 Sep 2006 14:51:22 -0500
Let me fix the errors in my example, this is now tested (I added it to the example's dbSubExample.db file):

# put 'Tick' to clock to start everything off
record(bo, "$(user):clock") {
  field(ZNAM, "Tock")
  field(ONAM, "Tick")
  field(HIGH, "5")
  field(FLNK, "$(user):timeNow")
}
# timeNow reports the timestamp from clock
record(stringin, "$(user):timeNow") {
  field(TSEL, "$(user):clock.TIME")
  field(DTYP, "Soft Timestamp")
  field(INP, "@%Y-%m-%d %H:%M:%S.%09f")
  field(FLNK, "$(user):drWho")
}
# drWho is 10 seconds behind the rest of us
record(sub, "$(user):drWho") {
  field(TSE, "-2")
  field(SNAM, "timeTravel")
  field(INPA, "-10")
  field(FLNK, "$(user):tardis")
}
# tardis reports where the doctor is
record(stringin, "$(user):tardis") {
  field(TSEL, "$(user):drWho.TIME")
  field(DTYP, "Soft Timestamp")
  field(INP, "@%Y-%m-%d %H:%M:%S.%09f")
}


I put this into the dbSubExample.c file:


static long timeTravel(subRecord *precord)
{
    epicsTimeGetCurrent(&precord->time);
    epicsTimeAddSeconds(&precord->time, precord->a);
    return 0;
}
epicsRegisterFunction(timeTravel);


And this in the dbSubExample.dbd file:


function(timeTravel)


This is the result:


  cau:  put anjHost:clock Tick
     anjHost:timeNow 14:39:35.021182600 2006-09-06 14:39:35.021182600
      anjHost:tardis 14:39:25.021356680 2006-09-06 14:39:25.021356680
     anjHost:timeNow 14:39:40.025729720 2006-09-06 14:39:40.025729720
      anjHost:tardis 14:39:30.025885560 2006-09-06 14:39:30.025885560


Hmm, I wonder what some of the EPICS client tools would do if they see the doctor travelling backwards in time (i.e. get an earler timestamp from him *after* receiving a later one)...


- Andrew
--
There is considerable overlap between the intelligence of the smartest
bears and the dumbest tourists -- Yosemite National Park Ranger

References:
Device with INP as a PV_LINK Emmanuel Mayssat
Re: Device with INP as a PV_LINK Tim Mooney
Re: Device with INP as a PV_LINK Andrew Johnson
Re: Device with INP as a PV_LINK Eric Norum

Navigate by Date:
Prev: Re: Device with INP as a PV_LINK Eric Norum
Next: Re: RE: Equipment Availability btanu
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  <20062007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: Device with INP as a PV_LINK Eric Norum
Next: StripTool2_5_10_0 display of waveform records? Jon Brinkmann
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  <20062007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 02 Sep 2010 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·