Scan Support
The Scan Server can execute a sequence of scan commands.
Several scan configurations can be submitted to the server.
Ongoing scans can be monitored, paused, resumed, aborted.
Setup
Prepare CSS
- Create a CSS product that includes the org.csstudio.scan.ui.feature.
- It's suggested to also add PyDev to the product.
Get Python client and examples
Run Demo IOC
cd PyScanClient/example/ioc
. runIoc.sh
Run Scan Server
Run or export the org.csstudio.scan.server/scan-server.product.
The default settings in org.csstudio.scan.server/plugin_customization.ini
configure it for 'localhost', sufficient for initial tests.
For a production setup, you need to set the EPICS connection parameters
and move the log database location to a directory outside of /tmp.
The ScanServer product can be run with command-line option
-console
or
-console 4884
for the (network) console. Type "help" in the console to see ScanServer commands.
If the ScanServer is run on a host that is different from the CSS client that
later accesses it, make sure that its ports are accessible via the firewall.
By default, the scan server REST interface uses port 4810.
Use /etc/sysconfig/iptables to enable that port for TCP access.
Access Scan Server Web Interface
Open a web browser for the URL
http://localhost:4810/index.html.
In particular, follow the links to submit a scan and then monitor its progress.
This REST API is the underlying interface to the scan server.
While it can be used to debug the system,
it is more practical to access it via the CSS Scan UI
and the PyScanClient.
Interact with Scan Server from CSS and Python
Configure the CS-Studio product as follows after its initial start:
- Check the Menu Edit > Preferences > Scan for the host and port of the scan server.
- In CSS, create a "linked folder" for the PyScanClient/example directory.
- Configure "CSS Applications", "Display", "BOY", "OPI Runtime", "PYTHONPATH" to
include the following:
- The path to your PyScanClient installation
- The path to your PyScanClient/example
Things to try:
- Open the PyScanClient/example/opi/1_BeamLine.opi.
Manually open the shutter, move the simulated motors or the 'device'.
- Invoke menu CSS > Scan > Scan Monitor.
Press the "i" info icon and note the paths that the scan server uses.
By default, this will include platform:/plugin/org.csstudio.scan/examples,
i.e. it uses a built-in set of configuration files.
These files mostly match what's in the PyScanClient/example/server folder.
You can try to update the scan server configuration
to use the PyScanClient/example/server instead of its
built-in examples because it will allow you to edit the files.
- Invoke menu CSS > Scan > Scan Editor, use it to assemble a scan that consists of some 'Delay' and 'Set' commands,
using the PV names from the simulated beamline.
- Open the examples/*.py files.
When PyDev is installed, these can be executed within CSS.
Otherwise, use python on the command line.
- Open the remaining examples/opi files and see how they
invoke PyScanClient-based scripts.
For more on the CS-Studio scan UI see
../org.csstudio.scan.ui/doc/scansystem.html
For more on the PyScanClient see its documentation.