EPICS Home

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  2016  2017  2018  <20192020  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  2016  2017  2018  <20192020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: [EXTERNAL] CSS jython setvalue behaviour
From: Pilar Gil via Tech-talk <[email protected]>
To: "Kasemir, Kay" <[email protected]>
Cc: "[email protected]" <[email protected]>
Date: Thu, 12 Sep 2019 10:52:05 +0200
Hello Kay,

Attached the test that I have done. If I write following in a jython script in CSS:

import sys
ConsoleUtil.writeInfo("type %s size %s "%(type(-2147483648), sys.maxsize))
INFO: type <type 'long'> size 2147483647

ConsoleUtil.writeInfo("type 2: %s"%(type(-2) ))                                       
INFO: type 2: <type 'int'>

And it is possible to use pvs[0].setValue()    with an int but it seems that is not possible with a long.
Is there any other function that I can use??
For the test I'm using a local PV with no limits (maybe that can be useful)

Thank you very much in advance
Pilar

El mié., 11 sept. 2019 a las 19:02, Kasemir, Kay (<[email protected]>) escribió:
I'd check what type the script is actually trying to pass down, see what you put it, and if that's already truncated, or if the problem starts inside setValue.

value = -2147483648
print(value.__class__.__name__)
print(value)
pvs[0].setValue( value )


Then try passing different types like so:

from java.lang import Long, Double
value = Long.valueof(-2147483648 )
print(value.__class__.__name__)
print(value)
pvs[0].setValue( value )

.. or so:

value = Double.valueof(-2147483648 )
print(value.__class__.__name__)
print(value)
pvs[0].setValue( value )

Other question is the native type of your PV:

print(pvs[0].getValue().__class__.__name__)


Knowing the PV type and the actual data type passed in it'd be easier to figure out how the value is handled.

-Kay



--
http://sevensols.com
Pilar Gil Jaldo

Embedded SW Engineer

This e-mail and any materials attached hereto, including, without limitation, all content hereof and thereof are confidential and proprietary to Seven Solutions,S.L and/or its affiliates, and are *confidential*. Without the prior written consent of Seven Solutions, this content may not (i) be disclosed to any third party, (ii) be reproduced, modified or otherwise used by anyone other than current employees of Seven Solutions or its affiliates. If you are not the intended recipient or if this message has been received in error, please immediately notify us via e-mail and delete it.

 This e-mail and any materials attached hereto, including, without limitation, all content hereof and thereof are confidential and proprietary to Seven Solutions,S.L and/or its affiliates, and are *confidential*. Without the prior written consent of Seven Solutions, this content may not (i) be disclosed to any third party, (ii) be reproduced, modified or otherwise used by anyone other than current employees of Seven Solutions or its affiliates. If you are not the intended recipient or if this message has been received in error, please notify us immediately via e-mail and delete it.
Replies:
Re: [EXTERNAL] CSS jython setvalue behaviour Kasemir, Kay via Tech-talk
References:
CSS jython setvalue behaviour Pilar via Tech-talk
Re: [EXTERNAL] CSS jython setvalue behaviour Kasemir, Kay via Tech-talk

Navigate by Date:
Prev: Re: Image display on ImageJ not showing up. [AravisGigE, areaDetector, ADViewer] Engbretson, Mark S. via Tech-talk
Next: Re: [EXTERNAL] CSS jython setvalue behaviour Kasemir, Kay via Tech-talk
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  <20192020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: [EXTERNAL] CSS jython setvalue behaviour Kasemir, Kay via Tech-talk
Next: Re: [EXTERNAL] CSS jython setvalue behaviour Kasemir, Kay via Tech-talk
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  <20192020  2021  2022  2023  2024