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: Questions regarding PV access within CSS
From: "Kasemir, Kay" <[email protected]>
To: Abdalla Al-Dalleh <[email protected]>
Cc: "[email protected]" <[email protected]>
Date: Tue, 1 Mar 2016 15:11:51 +0000
Hello:

> On Mar 1, 2016, at 3:42 AM, Abdalla Al-Dalleh <[email protected]> wrote:
> For the simulated PV I found it in the documentation, I found it straightforward, I did a simple Proof-of-Concept and it should do the thing.
Good.

> For the PVManager API, I did some search and could not figure out how to use it in a python script, also I did not get much documentation on what API functions available, most of the result I found were on how to use it inside Java code. Do you have any reference on using this API inside a script?
When you say “inside a script”:
The supported script mechanism is that the display runtime handles the PV connections, and the script is invoked when one of the PVs marked as ‘triggers’ change their value.
So inside the script you have the current values of all PVs, you do some quick computation on those values, update some widget properties, and leave the script.

Scripts are not meant to run for a long time, because they are executed on the user interface thread, meaning anything you do in those scripts blocks all of CSS from updating the display. To the end user, CSS and thus EPICS and the whole machine appears dead.

If you want to connect to PVs from within a script, that naturally takes time because you need to wait for the connection. Not an operation meant to be performed in a script. Finally, if you connect to a PV inside the script, you also need to assert proper cleanup, i.e. disconnecting from the script.

All that is possible: You can have your script launch separate threads, and in those threads you can connect to PVs, await the connection, receive values, then do something with those values, then update the widget properties - for which you need to switch back to the user interface thread ! - and finally disconnect PVs.
But that is not trivial. You will have to read the basic PVManager Java API (which you can call from within the scripts) and look at the BOY examples which start their own threads from a script.

-Kay


References:
Questions regarding PV access within CSS Abdalla Al-Dalleh
Re: Questions regarding PV access within CSS Kasemir, Kay
Re: Questions regarding PV access within CSS Abdalla Al-Dalleh

Navigate by Date:
Prev: XPS Q8 issue with indexHomeSearch sequence Russ Berg
Next: RE: XPS Q8 issue with indexHomeSearch sequence 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 
Navigate by Thread:
Prev: Re: Questions regarding PV access within CSS Abdalla Al-Dalleh
Next: PV with TSE=-2 and SCAN=I/O Intr returns <undefined> time. Enrique Bernal
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, 15 Jul 2016 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·