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: Control System Studio (CSS) and array PV
From: "Kasemir, Kay via Tech-talk" <[email protected]>
To: "[email protected]" <[email protected]>, Adrian martinez munera <[email protected]>
Date: Thu, 19 Sep 2019 12:16:36 +0000
> I need to set the PV value using CSS. The value is a DoubleArray and I'm using "pvs[1].setValue(array)" but the PV vaule is always null.

Not sure what exact type you mean by DoubleArray.
Do you actually mean org.diirt.util.array.ArrayDouble? Or plain java double[] ?
To be sure, print the type like this to the console:

value = ... however you get the value
print(value.__class__.__type__)

Anyway, the types accepted by the CA PV are the basic java scalar and array types, i.e. you need  a double[].
They don't accept a jython list (org.python.core.PyList), which is what Jython will auto-create for you when you assemble the array in Jython, or whatever you would get from Javascript.
https://www.jython.org/archive/21/docs/jarray.html explains how to create a plain java array in jython.

Example script:

# pvs[1]: some waveform PV                [NO TRIGGER!]
import jarray
python_array = [ 1, 2, 3, 4]
# Create java int[] or double[] array. Use 'i' for int, 'd' for double
arr = jarray.array(python_array, 'd')
# Now we can write to the PV
pvs[1].setValue(arr)

References:
Control System Studio (CSS) and PV Adrian martinez munera via Tech-talk

Navigate by Date:
Prev: Re: AW: Correct Settings for PIE816 Controller Mark Rivers via Tech-talk
Next: Re: AW: Correct Settings for PIE816 Controller Peterson, Kevin M. 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: Control System Studio (CSS) and PV Adrian martinez munera via Tech-talk
Next: EK9000 Device Support Lorelli, Jeremy J 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