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 2025 | 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 2025 |
<== Date ==> | <== Thread ==> |
---|
Subject: | Re: How to input TIME field values in aSub record types? |
From: | Andrew Johnson via Tech-talk <tech-talk at aps.anl.gov> |
To: | tech-talk at aps.anl.gov |
Date: | Mon, 15 Aug 2022 11:10:44 -0500 |
Are those timestamps being collected by EPICS, meaning that they represent seconds since the EPICS EPOCH? An epicsTimeStamp object is a pair of epicsUInt32 values holding the number of seconds and nanoseconds since 1990-01-01 00:00:00.0 UTC and can hold values up to the year 2106. How are you collecting/generating your array data, and what do you plan to do with the values inside the aSub record?I need to have an array of TIME field values of a PV as an input to an aSub record, but since the input type should be one of the data type listed on menuFtype, I do know how to do so, so I would appreciate it if anyone could direct me on that.
Passing timestamp values around as and converting them to/from strings is not particularly efficient and could be a somewhat brittle solution (due to local timezone settings amongst other things), so I would avoid looking at that approach if you can avoid it.
As an idea, I thought of getting the TIME field values as string and then, filling the array using circular buffer algorithm in a compress record, and then, imputing the array to the aSub record as a string array, and in the c++ subroutine, converting the TIME field values to epicsTime, but the challenge I am facing is that the TIME field value is of NTP format, and I do not know what format specifier, not listed in strftime function, I can use to expand the fractional part of the time, and I can just not ignore that part of the TIME value. I know I can set up my format specifier using boost::date_time library and its time_facet in my c++ subroutine, but I still have the problem getting the fractional part using stringin record type described in below link:
https://epics.anl.gov/tech-talk/2016/msg01039.php
Thank you in advance and will be looking forward to hearing back from you soon.
-- Complexity comes for free, Simplicity you have to work for.