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

Subject: RE: Formatting StreamDevice input
From: Mazanec Tomáš <[email protected]>
To: Elmer Pensack <[email protected]>, "[email protected]" <[email protected]>
Date: Mon, 21 Jul 2014 23:00:27 +0000

This may not be exactly what you asking for, however there is %j -- day of year converter for %T ,timestamp, converter in streamdevice.
So protocol command
in "%T(%j%H%M%S)";
should provide you formated string with an absolute time staring from UNIX epoch.

If interested, see the source code:
stream-2-6/streamDevice/src/TimestampConverter.cc

Further, I have found TIME field redirection with %T very handy. It sets processing time of a PV from data read from streamdevice input. If device sends lines like:
Voltage=1.234 V at time 000:02:40:15\n
Single "in" protocol command can set ai record with both value and time at once.

Tomas



Od: [email protected] [[email protected]] za uživatele Elmer Pensack [[email protected]]
Odesláno: 21. července 2014 20:36
Komu: [email protected]
Předmět: Formatting StreamDevice input

I have a timer device that provides data over a RS232 serial interface. I’m using StreamDevice to grab the data and publish as PVs. The data contains several times. All the times come in as an ASCII string containing days, hours, minutes and seconds and I'm writing them to stringin PVs. However, the data does not contain any separators, so the data coming in looks something like 000024015 (i.e. 000 days, 02 hours, 40 minutes, 15 seconds). I know the ‘in’ command needs to match the incoming data exactly or else it is discarded, but is there a way to add formatting to the PV that is NOT in the data? All I want to do is add a ‘:’ separator between each part, so the PV value will be like 000:02:40:15. Any suggestions?


Thanks!



References:
Formatting StreamDevice input Elmer Pensack

Navigate by Date:
Prev: Re: EPICS alarming on VAL != X Maren Purves
Next: Does Build-AOP-RPMs" script can do most thing about epics? 梁雅翔
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  <20142015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: RE: Formatting StreamDevice input Mooney, Tim M.
Next: Re: Formatting StreamDevice input Dirk Zimoch
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  <20142015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 17 Dec 2015 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·