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  <20132014  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  <20132014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: Relative time in XY graph
From: Bruce Hill <[email protected]>
To: Himanshu Tyagi <[email protected]>
Cc: EPICS Tech Talk <[email protected]>
Date: Tue, 28 May 2013 14:58:13 -0700
Hi Himanshu,
Yes, the compress records are saving arrays of data and time values
so you can display data vs time in xygraph.

The TimeStamp stringin PV is used to convert the internal timestamp
of the sin PV, read via "TST:IOC:SinValue1.TIME", into a floating point
string that can be read as input by the calc record or other records.

In Ralph's version, he uses the stringin record directly as input to the
compress record to get absolute timestamps.   My version used a calc
record to get relative timestamps.   Either approach can be used
depending on whether you want absolute or relative timestamps.

You can also vary the NSAM values to get arrays larger than 20 values,
or change the scan rate for the sin PV or use some other PV for your
data and timestamp source.

Hope this helps!
Regards,
- Bruce

On 05/23/2013 09:48 PM, Himanshu Tyagi wrote:
Hi Ralph/Bruce,

Thanks a lot for your suggestions. I wanted to ask you whether can we us any other record instead of Stringin ?
As far as I understand we are using compress records for saving 20 sample data of the sine wave. and similarly we are obtaining the timestamps for the sine PV and storing the successive time events in another compress record.
Can you confirm that my understanding is correct.Also can you please throw some light on the record of TST:IOC:SinValue1:TimeStamp , like what exactly is this PV working/

Thanks and regards,
Himanshu Tyagi


On Sat, May 18, 2013 at 10:22 AM, Ralph Lange <[email protected]> wrote:
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,
~Ralph



On Sat May 18 2013 04:33:14 GMT+0200 (CEST), Bruce Hill <[email protected]> wrote:
Hi 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





 

 

 


-- 
Bruce Hill
Member Technical Staff
SLAC National Accelerator Lab
2575 Sand Hill Road M/S 10
Menlo Park, CA  94025

References:
Relative time in XY graph Himanshu Tyagi
Re: Relative time in XY graph Himanshu Tyagi
Re: Relative time in XY graph Bruce Hill
Re: Relative time in XY graph Ralph Lange
Re: Relative time in XY graph Bruce Hill
Re: Relative time in XY graph Ralph Lange
Re: Relative time in XY graph Himanshu Tyagi

Navigate by Date:
Prev: Re: Missing Windows Implementation of epicsLoadLibrary Andrew Johnson
Next: RE: Motor record .RDBD field Emma Shepherd
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  <20132014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: Relative time in XY graph Himanshu Tyagi
Next: Linux Multi-Core Utilities 1.2 Released Ralph Lange
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  <20132014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 20 Apr 2015 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·