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: CSS Boy Write PVs to file |
From: | "Kasemir, Kay" <[email protected]> |
To: | "Konrad, Martin" <[email protected]> |
Cc: | "[email protected]" <[email protected]> |
Date: | Thu, 22 Sep 2016 11:18:42 +0000 |
Hi:
The PV needs to connect. If you get the value right away, you’ll receive a null because the PV has not connected and not received the initial value, yet.
Waiting via a delay will often be sufficient, but
a) You should not wait within the script, i.e. on the UI thread, because otherwise you’ll next ask:
Why does all of CSS freeze while my script is sleeping?
b) Sometimes you need to wait 3 seconds instead of 0.1.
Better would be to add a listener to the PV which gets notified as values arrive.
Overall, performing logic like data acquisition should not be handled in the user interface.
The user interface can start, stop, monitor the data accusation, but data acquisition needs to be performed by some service.
For example, check the sscan record for IOCs, http://www.aps.anl.gov/bcda/synApps/sscan/sscanRecord.html:
You tell it to take data for some time, it uses data storage clients to write that to files.
-Kay
|