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  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  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  <2024
<== Date ==> <== Thread ==>

Subject: Re: Output record with TSE=-2 and info(asyn:READBACK, "1") returns <undefined> time.
From: Mark Rivers via Tech-talk <tech-talk at aps.anl.gov>
To: Yann Mandza <yann.mandza at ess.eu>, "tech-talk at aps.anl.gov" <tech-talk at aps.anl.gov>, Torsten Bögershausen <tboegi at edom.se>
Date: Sat, 11 May 2024 15:44:24 +0000
Hi Yann,

Can you please provide the definition of the record you are using?

Here are some comments on your code:

sscanf( timeStampLastChanged/*hardware time string*, "%u.%u", &seconds, &microsecs ) != 2 )

There is a typo in this line, you are missing the / from the end of comment.  Is this because you did not use copy and paste?

time.nsec = microsecs * 100000;

The above math seems wrong.  nsec is only 1000 times microseconds, not 100000?  Or is this microsecond variable really 10 ns ticks?

pasynUser->timestamp = time;

You should not do this operation, directly copying time into timestamp.  The reason is that the asynPortDriver callback function will do this for you, and will overwrite what you have set.  Rather you should do this, as Torsten said;

setTimeStamp(time);

There is documentation here:

Mark


From: Tech-talk <tech-talk-bounces at aps.anl.gov> on behalf of Torsten Bögershausen via Tech-talk <tech-talk at aps.anl.gov>
Sent: Saturday, May 11, 2024 9:57 AM
To: Yann Mandza <yann.mandza at ess.eu>; tech-talk at aps.anl.gov <tech-talk at aps.anl.gov>
Subject: Re: Output record with TSE=-2 and info(asyn:READBACK, "1") returns <undefined> time.
 


On 2024-05-11 13:39, Yann Mandza via Tech-talk wrote:
> Dear all,
>
> I am working onan Asyn Port driver using with asynR4-42 on a Linux
> machine. Am trying to add timing support for Output record using TSE=-2 and
>
> and info(asyn:READBACK, "1"). When I caget an output PV with TSE=-2
> after caput to it the time obtained is <undefined> though the value is
> well written to the device.
>
> A camonitor on a PV with TSE=-2 and info(asyn:READBACK, "1") show an
> <undefined> time too though the read value is correct. I would like to
> associate the device timestamp to the record for output readback, and
> the current time return by epicsTimeGetCurrent to the record after a
> caput. In my poller thread this is how I set the time stamp:
>
> epicsUInt32 seconds = 0;
>
> epicsUInt32 microsecs = 0;
>
> epicsTimeStamp time;
>

Do you call setTimeStamp() ?

<https://urldefense.us/v3/__https://github.com/EuropeanSpallationSource/m-epics-ethercatmc/blob/master/ethercatmcApp/src/ethercatmcIndexer.cpp*L1798__;Iw!!G_uCfscf7eWS!Ym78ZmckUmmr90mF9sBrllYCvlNGCIZ_FitDo84KjDwEh7Tj7dWaAvjJ9ZpWelrizFvnelAsNeXwE8GCj9M$ >

References:
Output record with TSE=-2 and info(asyn:READBACK, "1") returns <undefined> time. Yann Mandza via Tech-talk
Re: Output record with TSE=-2 and info(asyn:READBACK, "1") returns <undefined> time. Torsten Bögershausen via Tech-talk

Navigate by Date:
Prev: Re: Output record with TSE=-2 and info(asyn:READBACK, "1") returns <undefined> time. Torsten Bögershausen via Tech-talk
Next: RE: Output record with TSE=-2 and info(asyn:READBACK, "1") returns <undefined> time. Yann Mandza via Tech-talk
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: Output record with TSE=-2 and info(asyn:READBACK, "1") returns <undefined> time. Torsten Bögershausen via Tech-talk
Next: RE: Output record with TSE=-2 and info(asyn:READBACK, "1") returns <undefined> time. Yann Mandza via Tech-talk
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
ANJ, 11 May 2024 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·