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  2014  2015  <20162017  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  2014  2015  <20162017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: Trouble using ULONG in edm
From: Andrew Johnson <[email protected]>
To: "Zhang, Dehong" <[email protected]>, "[email protected]" <[email protected]>
Date: Fri, 1 Apr 2016 15:47:36 -0500
Hi Dehong,

On 04/01/2016 02:16 PM, Zhang, Dehong wrote:
> I have a status word field defined as ULONG, and would like to display
> the individual
> bits in edm with CALCs ("<<", ">>" and "&" etc).  When I tried to
> use the 3 MSBs,
> for instance when the status word is 0xe0000000, only
> 
> CALC\\\{(A>>31)&1}("Status PV")           seems to return "1"
> 
> but both (later within the same edm file):
> 
> CALC\\\{(A>>30)&1}("Same Status PV")
> CALC\\\{(A>>29)&1}("Same Status PV")
> 
> seem to return "0".
> 
> It seems edm gets it as a negative number.
> 
> Am I using the CALCs wrongly?  Or should I avoid using the MSB bit?

EDM uses the calcPerform expression evaluation engine from the EPICS
libCom library. We recently fixed some bugs in that code to fix the
problems that you're seeing with accessing the MSB of any 32-bit
quantities, but those fixes are currently only available from the
unreleased Base-3.14 or Base-3.15 branches or in the Base-3.16.0.1
development release. To get the fixes you would have to download and
build a new version of Base and then rebuild EDM using that Base.

You may be able to use the expression (A < 0) to test the top bit, but
it might not work depending on how your ULONG value gets converted into
the double value that gets input to the engine, and of course the
behaviour may change when run on a version of EDM built against the
fixed library. It would probably be easier to just avoid using the MSB
if you can do that.

- Andrew

-- 
There are only two hard problems in distributed systems:
  2. Exactly-once delivery
  1. Guaranteed order of messages
  2. Exactly-once delivery
 -- Mathias Verraes

Replies:
Re: Trouble using ULONG in edm Zhang, Dehong
References:
Trouble using ULONG in edm Zhang, Dehong

Navigate by Date:
Prev: Trouble using ULONG in edm Zhang, Dehong
Next: Re: Trouble using ULONG in edm Zhang, Dehong
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  <20162017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Trouble using ULONG in edm Zhang, Dehong
Next: Re: Trouble using ULONG in edm Zhang, Dehong
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  <20162017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 15 Jul 2016 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·