EPICS Controls 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  <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: Using PVUtil to get PV's value when PV name is input as string in CSS
From: Davide Marcato via Tech-talk <[email protected]>
To: Tyler Lemon <[email protected]>, "[email protected]" <[email protected]>
Date: Tue, 14 May 2019 09:58:59 +0200
Hello,
why are you trying to create the PV names from a parameter inside the script? If you pass all the required PVs as inputs to the script your code may work.

By the way, in my opinion a better solution would be to do this kind of stuff with a dedicated script running somewhere on the network, and not in the GUI. If you don't have access to the original IOC you can use pyepics to create a simple script to concatenate values from different PVs to a single array, and then launch it as a daemon.

Davide

On 13/05/19 7:14 PM, Tyler Lemon via Tech-talk wrote:
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

-- 
Davide Marcato
INFN - Laboratori Nazionali di Legnaro
Viale dell'Universita', 2
35020 Legnaro (PD) - ITALY
Phone: +39 0498068439
Mail: [email protected]

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

Navigate by Date:
Prev: Re: Record not processing in simulation mode Ralph Lange via Tech-talk
Next: RE: Channel Access implementation for Siemens S71500 PLCs Miklós Boros 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: Using PVUtil to get PV's value when PV name is input as string in CSS Tyler Lemon via Tech-talk
Next: Re: Using PVUtil to get PV's value when PV name is input as string in CSS Tyler Lemon 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 
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 ·