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 2025 | 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 2025 |
<== Date ==> | <== Thread ==> |
---|
Subject: | Re: How to cs-studio Scan System |
From: | "Kasemir, Kay" <[email protected]> |
To: | Patard Charles-Henri <[email protected]> |
Cc: | "[email protected]" <[email protected]> |
Date: | Tue, 23 Feb 2016 14:30:05 +0000 |
Hi:
You can get a basic idea of how it works in http://accelconf.web.cern.ch/AccelConf/ICALEPCS2013/papers/frcoaab01.pdf
The scan server is an executable.
I create it with the scan-server.product in
https://github.com/ControlSystemStudio/org.csstudio.sns/tree/master/repository
You can also download the binary from https://ics-web.sns.ornl.gov/css/nightly/
Then you start it with a -pluginCustomization command line option to your configuration file to set its EPICS CA address list etc.
See example from https://github.com/ControlSystemStudio/cs-studio/blob/master/applications/scan/scan-plugins/org.csstudio.scan.server/plugin_customization.ini
How many instances you start depends on what you want to do.
We run one scan server on each beam line, for two reasons:
1) Each beam line is on its own network, so a scan server on beam line A cannot control PVs on beam line B
-> Each beam line needs its own scan server
2) Typically, only one operation should be active at a time.
The one scan server on each beam line then handles all the scans on that beam line.
They are submitted to the scan server queue, which means only one scan runs at a time.
But scans can be submitted without queuing, so they execute right away. That way, multiple scans can be executed in parallel on a beam line.
The basic list of commands is there.
Python code assembles a list of commands, submits them.
May then wait for the end of execution and do something about it.
The basic commands are just setting PVs to a value, awaiting callback, maybe checking a readback to match.
If you need special new commands, you can write them in Jython and execute them inside the scan server via the “Script” command.
In principle, you can also add new commands in Java and add them to the scan server via Eclipse extension points, but that would be a bit like adding a new reserved word to python, certainly requiring you to assemble a new scan server binary and restart
it on the beam line. We’ve not had a need to do that.
Again the scan server is a flexible way to execute a recipe of PV writes and waits.
It tells a motor record to go to a position and awaits the callback.
The motor record does the actual motor movement, retries, backlash compensation, ..
The scan server tells an area detector camera to take a picture and awaits the callback.
The area detector opens the shutter, exposes the camera for some time, saves the image, updates the image PV, adds the overlay, ..
If you always need to do some complicated operation on the beam line, that’s put in an IOC with PVs to configure the operation and a “DoIt” PV, and the scan server then writes to those configuration PVs and the “DoIt” PV, with completion callback.
Again using https://ics-web.sns.ornl.gov/css/PyScanClient/ , jython code in a BOY script assembles a list of commands. Typically is uses information from the display, i.e. values entered in widgets on the screen, to determine what commands to assemble. Then it submits them, but doesn’t wait for completion because the script runs in the BOY UI thread and waiting would block all of CSS. We often use the Table-based scans,
https://ics-web.sns.ornl.gov/css/PyScanClient/table_scan.html, were the BOY screen is a table, which can also be loaded from a spreadsheet.
As for “output data”: The scan server executes a list of commands, and the commands perform channel access calls.
To “collect data”, we basically
Set(“PVThatControlsDataAcquisition”, 1, completion=True)
at the start of the scan, then
Set(“PVThatControlsDataAcquisition”, 0)
at the end of the scan.
The data acquisition then opens data files, writes the instrument events into that file.
The scan server Log() command can log data within a scan and the PyScanClient can later fetch the data, see https://ics-web.sns.ornl.gov/css/PyScanClient/scan_client.html#example.
But that logging is limited to operations like move motor, get some counts, then log motor position and counts. It’s not meant to capture images or fast neutron events.
Thanks,
-Kay
|