EPICS Home

Experimental Physics and Industrial Control System


 
1994  1995  <19961997  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  <19961997  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: Sequencer time string
From: [email protected] (Andy Kozubal)
To: [email protected]
Cc: [email protected]
Date: Thu, 18 Apr 1996 16:18:24 -0600
Tom, the following program takes the time stamp from a PV and
puts it into a string.  The program requires Sequencer Version 1.9.
The function tsStampToText() is part of EPICS core.

Andy

> In a IOC sequencer program I would like to
> get a PV time stamp and the curent time
> into an ascii string.  How can this be done?
> 
> Tom Coleman
> 


program tsGen
/* This program monitors the "ShotCounter" PV and generates a string
 * containing the time stamp in the "ShotTime" PV */

%{TS_STAMP	ts;}%

long		shotNum;
assign		shotNum to "ShotCounter";
monitor		shotNum;

string		shotTime;
assign		shotTime to "ShotTime";

long		prevShotNum;

ss getTs {
  state one {
    when (shotNum != prevShotNum) {
	prevShotNum = shotNum;

	/* get time stamp */
	ts = pvTimeStamp (shotNum);

	/* convert to string */
	tsStampToText (&ts, TS_TEXT_MMDDYY, shotTime);
	pvPut(shotTime);
    } state one
  }
}

|=======================================================================|
| Andy Kozubal   (DX-7)			| Digital: [email protected]	|
| Mail Stop P947			|				|
| Los Alamos National Laboratory	| Analog: (505) 667-6508	|
| Los Alamos, New Mexico 87545		|				|
|=======================================================================|


Navigate by Date:
Prev: XMSEQ William Lupton
Next: Re: XMSEQ Ben-chin K. Cha
Index: 1994  1995  <19961997  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: Sequencer time string T.A.Coleman, ANL ECT 222
Next: XMSEQ William Lupton
Index: 1994  1995  <19961997  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