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 2020 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 2019 2020 2021 2022 2023 2024 |
<== 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: | "Kasemir, Kay" <[email protected]> |
To: | lzf neu <[email protected]>, "[email protected]" <[email protected]> |
Date: | Mon, 30 Oct 2017 12:49:17 +0000 |
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
|