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: "Pal Trivan" <[email protected]>
To: <[email protected]>, <[email protected]>, <[email protected]>
Date: Thu, 31 Jul 2014 11:02:39 +0200

Hello,

 

In an analogous conversion, I have used a similar construct, it appears to be ‘ok’.

 

i.e.

 

getStatusWords
{
   in STX 5 "%2x%(STATUS2)2x%(STATUS3)2x%...";
}

shoud work.

 

Regards,

 

Trivan

--

[email protected]

 

From: [email protected] [mailto:[email protected]] On Behalf Of [email protected]
Sent: Donnerstag, 31. Juli 2014 10:53
To: [email protected]; [email protected]
Subject: RE: Formatting StreamDevice input

 

I’m pretty sure %2x is the format converter you need.

 

If those are bit fields rather than numbers you might find mbbiDirect records more useful than longin.

 

 

From: Elmer Pensack [mailto:[email protected]]
Sent: 30 July 2014 18:48
To: [email protected]
Subject: Re: Formatting StreamDevice input

 

Thanks all for the suggestions. I was able to successfully get the time string formatted using scalcout. I'm sure I'll have more questions when I look into the %T option to convert to seconds, but in the meantime I hit another snag.

Embedded in that same block of data is a smaller block of seven status words. The status words have no separators. They come in like this: 82918020303030. This represents seven hex values: x82, x91, x80, x20, x30, x30, and x30.

 

If I use the %D option and read them as binary coded decimals it works, as long as the values contain only 0-9. As soon as the x80 changes to an x8a status I get a CALC INVALID error. Reading the documentation, that makes sense for %D. So I tried using a %x, %i, %d, and every optional flag I could think of trying, including widths. But the only result I get is 0. I can't seem to read the values unless I use %D. Any ideas?

Here is my protocol:

getStatusWords
{
   in STX 5 "%D%(STATUS2)D%(STATUS3)D%(STATUS4)D%(STATUSWORD5)D%(STATUS6)D%(STATUS7)D";
}

This populates the seven PVs. The STX is the "next field" indicator and the 5 indicates that the field is for status words.

Here's the PVs I've defined:

record(longin, "STATUS1")
{
   field(VAL, 0)
   field(DTYP, "stream")
   field(INP,  "@cdg4200.proto getStatusWords CDT")
   field(SCAN, "I/O Intr")
}
record(longin, "STATUS2")
{
   field(VAL, 0)
}

Same for STATUS3 - STATUS7.

All input is unsolicited. It comes in continuously every second.

Thanks in advance!

Elmer Pensack


References:
Formatting StreamDevice input Elmer Pensack
Re: Formatting StreamDevice input Dirk Zimoch
Re: Formatting StreamDevice input Elmer Pensack
RE: Formatting StreamDevice input peter.owens

Navigate by Date:
Prev: RE: Formatting StreamDevice input peter.owens
Next: Recommended Control HWs for High Voltage Platform Jeong Han Lee
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 peter.owens
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 
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 ·