I am trying to develop a Python script that is executed by CSS that reads several PV values and combines them into one array. We do not have access to the IOC's database file to be able to create the array there, so that is why we are trying to make a Python
script to do it.
I have tried to use function PVUtil.getDouble, but its argument has to be an
org.csstudio.simplepv.IPV data type.
Below is an example of what I am trying to do in the script:
from org.csstudio.opibuilder.scriptUtil import PVUtil
from array import array
arrayPV = 'loc://testArray' #PV name of array to write values to.
vals = array('f')
for i in range(1,6):
pv = 'devIOC:ai'+str(i)
pvVal = PVUtil.getDouble(pv)
When this is run in CSS, it gives the error:
TypeError: getDouble(): 1st arg can't be coerced to org.csstudio.simplepv.IPV
Is there a way to convert a string to the org.csstudio.simplepv.IPV type to be able to use it with PVUtil.getDouble?
Or is there an equivalent function that can be used whose input argument can be a string?
Any advise would be appreciated. Thanks!
Detector Support Group