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: 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:


On Feb 23, 2016, at 8:58 AM, Patard Charles-Henri <[email protected]> wrote:

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.
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.

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.
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

Replies:
RE: How to cs-studio Scan System Patard Charles-Henri
References:
How to cs-studio Scan System Patard Charles-Henri

Navigate by Date:
Prev: Re: Motor examples missing devSequencer Benjamin Franksen
Next: Re: Motor examples missing devSequencer Gerrit Kühn
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: How to cs-studio Scan System Patard Charles-Henri
Next: RE: How to cs-studio Scan System Patard Charles-Henri
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 ·