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  <20092010  2011  2012  2013  2014  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  <20092010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: camonitor and caget - displaying unsigned longs in hexadecimal
From: Andrew Johnson <[email protected]>
To: [email protected]
Date: Fri, 4 Dec 2009 17:55:01 -0600
Hi Stephanie,

On Friday 04 December 2009 17:16:34 Allison, Stephanie wrote:
>
> I notice that camonitor and caget do not honor the "-0x" option (option
> to printout as hex) for PVs that are unsigned long's.  Such PVs are sent
> over CA as double's and -0x is not available for doubles, per design.
> Are there other options that I could use instead?    Should I look into
> changing the tools to allow for -0x for unsigned long's?

CA can't transport unsigned types as such, although the IOC database supports 
them.  If you do a cainfo of one of your ULONG PVs you'll see that its native 
type actually gets reported as a DBF_DOUBLE, which is the smallest type that 
CA can guarantee will pass any ULONG value correctly.  Unfortunately CA gives 
no indication of what the real database type is, so I don't think the tool 
could properly detect that the field is really a ULONG.

However if you ask caget or camonitor to use DBR_LONG when fetching the value 
(add the switch -d LONG) then it does honor the -0x switch, but the display 
format is different.  Also if your client is a 64 bit machine you might get 
the sign bit extended for display.  This is the output I get on linux-x86_64 
when the top bit is set (note that the DBF_LONG and DBR_LONG types are only 32 
bits wide even on 64-bit architectures):

tux% caget -d LONG -0x anjHost:compressExample.N
anjHost:compressExample.N
    Native data type: DBF_DOUBLE
    Request type:     DBR_LONG
    Element count:    1
    Value:            0xFFFFFFFF80000000

HTH, HANW,

- Andrew
-- 
The best FOSS code is written to be read by other humans -- Harald Welte


Replies:
RE: camonitor and caget - displaying unsigned longs in hexadecimal Allison, Stephanie
References:
camonitor and caget - displaying unsigned longs in hexadecimal Allison, Stephanie

Navigate by Date:
Prev: camonitor and caget - displaying unsigned longs in hexadecimal Allison, Stephanie
Next: RE: camonitor and caget - displaying unsigned longs in hexadecimal Allison, Stephanie
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  <20092010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: camonitor and caget - displaying unsigned longs in hexadecimal Allison, Stephanie
Next: RE: camonitor and caget - displaying unsigned longs in hexadecimal Allison, Stephanie
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  <20092010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 31 Jan 2014 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·