Experimental Physics and
We tried Hugo's solution, but this only got the first character of the string for us so we used getLongArray instead and had to do some splitting to remove brackets and L's which were returned along with the int array.There may be a more elegant way to do it but the code as follows worked for us.
from org.csstudio.opibuilder.scriptUtil import PVUtil
from org.csstudio.opibuilder.scriptUtil import ConsoleUtil
#Get characters as Long Int array
#This has form e.g. 'array('l',[70L,69L,45L])' sans quotes
v = PVUtil.getLongArray(pvs)
#split array on starting square bracket '['
v = str(v).split("[")
#if this is false it means '[' wasn't present
# Select part after '['
v = v
#Cut off end of array marked by "]"
v = v.split("]")
#Remove "L"'s from array (signifying long ints)
v = v.replace("L","")
#split string on commas into list
#rejoin characters into string
strArray = "".join(chr(int(i)) for i in v)
On 13 March 2015 at 19:47, Hugo Slepicka <firstname.lastname@example.org> wrote:
|ANJ, 16 Dec 2015||
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·