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  <20162017  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  <20162017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: printing value of pv to new line
From: Hugo Slepicka <[email protected]>
To: palak shimpee <[email protected]>, "[email protected]" <[email protected]>
Date: Tue, 27 Sep 2016 14:18:15 +0000
Hi Palak,

Don't do that in a BOY script. It’ll be executed on the UI thread and cause the UI to freeze.
There are plenty of other ways to do this operation, e.g., run a python code outside of CS-Studio to do it.

Hugo


On Tue, Sep 27, 2016 at 1:28 AM palak shimpee <[email protected]> wrote:
I want to export the pvs without archiver. I want to export the pv datas only when I make a button true. Hence I want to use the script. Please can you help me with it.

On Mon, Sep 26, 2016 at 10:35 AM, Hugo Slepicka <[email protected]> wrote:
Hi Palak,

You need to indent your code inside the while loop.
As mentioned a while ago here on the list, if you do this inside CS-Studio you will probably freeze the entire UI.
What are you trying to do? Maybe in this case you could use the Archiver and export your PV values later.

Cheers,
Hugo

On Mon, Sep 26, 2016 at 6:23 AM palak shimpee <[email protected]> wrote:
I want that my pv should be read and printed continuously. I have written below python code :

from org.csstudio.opibuilder.scriptUtil import PVUtil
import os,sys
import subprocess
import glob
from os import path
from datetime import datetime
while True:
pv=PVUtil.getDouble(pvs[1])
i = datetime.now()
sys.stdout=open("test2.txt","wb")
print str(i), pv '\\n'
sys.stdout.close()

But I an getting error:

2016-09-26 15:49:33 ERROR: Failed to register .
SyntaxError: ("mismatched input 'pv' expecting INDENT", ('<script>', 8, 0, 'pv=PVUtil.getDouble(pvs[1])\n'))

please help me to solve this


References:
printing value of pv to new line palak shimpee
Re: printing value of pv to new line Hugo Slepicka

Navigate by Date:
Prev: Re: Problem in 3.14.12.5 with osd/WIN32/osdTime.h with latest version of MinGW Ralph Lange
Next: Fwd: break table D Peter Siddons
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  <20162017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: printing value of pv to new line Hugo Slepicka
Next: Problem in 3.14.12.5 with osd/WIN32/osdTime.h with latest version of MinGW Mark Rivers
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  <20162017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 27 Sep 2016 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·