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 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
<== Date ==> <== Thread ==>

Subject: Re: How to define a global variable and global array in python script for a widget of Control system studio (CS
From: Anton Derbenev <aaderbenev@gmail.com>
To: "Kasemir, Kay" <kasemirk@ornl.gov>
Cc: "tech-talk@aps.anl.gov" <tech-talk@aps.anl.gov>
Date: Mon, 30 Oct 2017 13:47:29 -0400
Zhefu,

as Kay pointed out, the documentation describes some common use-cases for PVs in scripts. If the PV approach works for you, however, you might consider implementing the desired logic in your IOC instead. It is easily done on database level (e.g. with calc record). In this case you won't have to deal with OPI scripts.

Anton.

On Mon, Oct 30, 2017 at 8:49 AM, Kasemir, Kay <kasemirk@ornl.gov> wrote:

Hi:


This is how you read:

> data="">)


This is _not_ how you write, since you obviously can't assign anything to the number returned by getDouble():
> PVUtil.getDouble(pvs[1])=data

> However, the error occurs:
> SyntaxError:("can't assign to function call", ('<script>',3,0, 'PVUtil.getDouble(pvs[0])=value\n'))

This is how you would write:
pvs[1].setValue(data)


If you want to use scripts, it might be a good idea to study the example scripts in BOY Examples/scripts, where "setValue" is used a couple of times.
Or read the online help:
CSS Applications, Displays, BOY, Script, Access PV, "2. Write PV Value" introduces PV.setValue.

-Kay


Navigate by Date:
Prev: Re: streamdevice and AD driver in same IOC Hinko Kocevar
Next: Re: RTEMS+zoneset seems to be broken Matt Rippa
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
Navigate by Thread:
Prev: Re: streamdevice and AD driver in same IOC Hinko Kocevar
Next: Crosscompiling EPICS for ARM Arch - zedboard : Error 윤대희
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
ANJ, 01 Nov 2017 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·