Hello,
I need to use cs-studio Scan System for scanning output beams from accelerator sources. We need to create two independents scans one for each sources. End users start scan by clicking on BOY action button. Output data from scan need
to integrated to a xml file which is used a java program in charge of draw the spectrum plot. I’ve some questions :
· Do
I need to create two scan servers ?
· How
to create server ? By copying org.csstudio.scan.server plugin two times rename it like this org.csstudio.scan.server.source1 and org.csstudio.scan.server.source2. After that configure each server and export it as eclipse product.
The scan server is an executable.
Then you start it with a -pluginCustomization command line option to your configuration file to set its EPICS CA address list etc.
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.
· Is
it possible to create scan commands by code and ask to scan server to execute commands ?
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.
· How
to call scans by end user BOY interface ? Python script which call java program created with java scan system API or Jython script ?
Thank you.
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.