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  2016  2017  2018  <2019 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  <2019
<== Date ==> <== Thread ==>

Subject: Using PVUtil to get PV's value when PV name is input as string in CSS
From: Tyler Lemon via Tech-talk <tech-talk@aps.anl.gov>
To: "tech-talk@aps.anl.gov" <tech-talk@aps.anl.gov>
Date: Mon, 13 May 2019 17:14:38 +0000
Hello,

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)
    vals.append(pvVal)
PVUtil.writePV(arrayPV,vals)

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!

Best regards,
Tyler Lemon
Jefferson Lab
Detector Support Group

Replies:
Re: Using PVUtil to get PV's value when PV name is input as string in CSS Davide Marcato via Tech-talk

Navigate by Date:
Prev: Re: Channel Access implementation for Siemens S71500 PLCs Michael Davidsaver via Tech-talk
Next: Record not processing in simulation mode Konrad, Martin 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  <2019
Navigate by Thread:
Prev: Upcoming procServ release: please test systemd support Ralph Lange via Tech-talk
Next: Re: Using PVUtil to get PV's value when PV name is input as string in CSS Davide Marcato 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  <2019
ANJ, 14 May 2019 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·