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: How to define a global variable and global array in python script for a widget of Control system studio (CSS) ?
From: lzf neu <lzfneu@live.com>
To: "tech-talk@aps.anl.gov" <tech-talk@aps.anl.gov>
Date: Sun, 29 Oct 2017 14:33:41 +0000

Hi,

 

I want to add up a variable by 1 each time when PV are triggered and print the result in CSS terminal.


I try to define a variable x in python script as the following lines:


from org.csstudio.opibuilder.scriptUtil import PVUtil
x=0
x=x+1
print x


However, the results in CSS terminal are always print 1. And not 2, 3, 4, 5, 6, ....each time that I hope.


I have no idea how to define a global variable and a global array in python script for a widget of Control system studio (CSS), so that I can preserve the data each time.


Any help will be appreciated and thanks in advance !


Zhefu



Navigate by Date:
Prev: RTEMS+zoneset seems to be broken Ricardo Cardenes
Next: Re: How to define a global variable and global array in python script for a widget of Control system studio (CSS) ? Anton Derbenev
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: RTEMS+zoneset seems to be broken Ricardo Cardenes
Next: Re: How to define a global variable and global array in python script for a widget of Control system studio (CSS) ? Anton Derbenev
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, 30 Oct 2017 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·