Experimental Physics and Industrial Control System
|
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.
|
- Replies:
- RE: Formatting StreamDevice input Pal Trivan
- References:
- Formatting StreamDevice input Elmer Pensack
- Re: Formatting StreamDevice input Dirk Zimoch
- Re: Formatting StreamDevice input Elmer Pensack
- Navigate by Date:
- Prev:
Re: Formatting StreamDevice input Elmer Pensack
- Next:
RE: Formatting StreamDevice input Pal Trivan
- 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
- Navigate by Thread:
- Prev:
Re: Formatting StreamDevice input Elmer Pensack
- Next:
RE: Formatting StreamDevice input Pal Trivan
- 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
|
ANJ, 17 Dec 2015 |
·
Home
·
News
·
About
·
Base
·
Modules
·
Extensions
·
Distributions
·
Download
·
·
Search
·
EPICS V4
·
IRMIS
·
Talk
·
Bugs
·
Documents
·
Links
·
Licensing
·
|