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: camonitor ignores format arguments for CHAR data
From: Eric Norum <[email protected]>
To: "[email protected] Talk" <[email protected]>
Date: Wed, 8 May 2013 09:54:10 -0700
'camonitor -h' reports:
…..
Integer number format:
  Default:  Print as decimal number
  -0x:      Print as hex number
  -0o:      Print as octal number
  -0b:      Print as binary number

But attempting to use this with a UCHAR waveform record has no effect.
$ camonitor -0x koherasE15test:BasiK:Register10
koherasE15test:BasiK:Register10 2013-05-08 09:43:51.018324 28 126 0 103 78 0 0 -59 0 8 95 0 0 0 0 -106 1 17 0 -1 0 -124 9 -72 47 -77 6 22 6  
koherasE15test:BasiK:Register10 2013-05-08 09:43:53.018341 28 126 0 105 78 0 0 -59 0 8 95 0 0 0 0 -106 1 17 0 -1 0 -124 9 -72 47 -77 6 22 6  
is the the same as without the '-0x':
$ camonitor koherasE15test:BasiK:Register10
koherasE15test:BasiK:Register10 2013-05-08 09:43:19.010327 28 126 0 105 78 0 0 -60 0 8 95 0 0 0 0 -106 1 17 0 -1 0 -124 9 -72 47 -77 6 22 6  
koherasE15test:BasiK:Register10 2013-05-08 09:43:21.010336 28 126 0 105 78 0 0 -59 0 8 95 0 0 0 0 -106 1 16 0 -1 0 -124 9 -72 47 -77 6 22 6  

The code in R3.14.12/base/src/catools/ makes it clear why this is the case.   The tool_lib.c code has
    switch (base_type) {
…..
    case DBR_CHAR:
        ch = ((dbr_char_t*) val_ptr)[index];
        sprintf(str, "%d", ch);
        break;
    case DBR_INT:
        sprint_long(str, ((dbr_int_t*) val_ptr)[index], outTypeI);
        break;
    case DBR_LONG:
        sprint_long(str, ((dbr_long_t*) val_ptr)[index], outTypeI);
        break;

Would it be reasonable to apply the '-0' options to CHAR types too?
-- 
Eric Norum
[email protected]


Replies:
RE: camonitor ignores format arguments for CHAR data Allison, Stephanie

Navigate by Date:
Prev: Re: Timer Queue crash J. Lewis Muir
Next: RE: camonitor ignores format arguments for CHAR data Allison, Stephanie
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: Two questions about CSS Geng, Zheqiao
Next: RE: camonitor ignores format arguments for CHAR data Allison, Stephanie
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 ·