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: Relative time in XY graph |
From: | Himanshu Tyagi <[email protected]> |
To: | Ralph Lange <[email protected]>, [email protected] |
Cc: | EPICS Tech Talk <[email protected]> |
Date: | Fri, 24 May 2013 10:18:15 +0530 |
Hi Bruce,
exactly that way. And you added relative time stamps, interesting!
In my application, I wanted to have absolute time stamps in the time array, to have the X/Y graph show wall clock time on the X axis. So that in the graph that shows whatever over the last 6 hours, you can hover your mouse over it and see at what time a certain jump appeared.
Cheers,
~RalphHi Ralph,
Thanks for the tip! I hadn't realized we could use a stringin record
that contained a floating point string representation as an input link.
I'm not sure why EPICS doesn't allow us to just access the <PV>.TIME
field and get the same timestamp as a floating point sec since epoch,
but the stringin record works.
Himanshu,
Here's an example below of how to create two compress records (arrays),
one with the values, TST:IOC:Array1, and one with relative timestamps,
TST:IOC:TimeArray1.
Note the %s format used in TST:IOC:SinValue1:TimeStamp to convert
the epics sec and ns timestamp to a floating point sec since epoch (1970).
That format string supports all the format characters in strftime().
Regards,
- Bruce
record( calc, "TST:IOC:SinValue1" ) { field( SCAN, "1 second" ) field( INPA, "0" ) field( INPB, "TST:IOC:Array1.NSAM" ) field( CALC, "SIN(A*d2r);A:=A+(180/B)" ) field( PREC, 2 ) field( FLNK, "TST:IOC:Array1" ) } record( compress, "TST:IOC:Array1" ) { field( INP, "TST:IOC:SinValue1 NPP NMS" ) field( NSAM, "20" ) field( ALG, "Circular Buffer" ) field( PREC, "5" ) field( FLNK, "TST:IOC:SinValue1:TimeStamp" ) } record( stringin, "TST:IOC:SinValue1:TimeStamp" ) { field( DTYP, "Soft Timestamp" ) field( TSEL, "TST:IOC:SinValue1.TIME" ) # field( INP, "@%m/%d/%Y %H:%M:%S.%09f" ) field( INP, "@%s.%09f" ) field( FLNK, "TST:IOC:SinValue1:TimeRel" ) } record( calc, "TST:IOC:SinValue1:TimeRel" ) { field( INPA, "TST:IOC:SinValue1:TimeStamp" ) field( INPB, "0" ) field( CALC, "B==0?0:(A-B);B:=(B==0?A:B)" ) field( PREC, 9 ) field( FLNK, "TST:IOC:TimeArray1" ) } record( compress, "TST:IOC:TimeArray1" ) { field( INP, "TST:IOC:SinValue1:TimeRel" ) field( NSAM, "20" ) field( ALG, "Circular Buffer" ) field( EGU, "sec" ) field( PREC, "5" ) }
On 05/17/2013 03:20 PM, Ralph Lange wrote:
On Fri May 17 2013 21:37:01 GMT+0200 (CEST), Bruce Hill <[email protected]> wrote:
[...]
One option would be for you to provide a 2nd array for the X PV and
fill it with the time values for each value in your waveform. The best
way I know how to create the time array would be with the aSub record,
but maybe other EPICS user's may have other ways to do that.
For the time array I'm using a compress record in circular buffer mode (one for each different waveform size/timebase), pointing its INP to a stringin record (one per IOC) that scans every second and shows its own time stamp as seconds since epoch using soft timestamp device support.
~Ralph