@@ -308,26 +308,60 @@ Pushing the "Go!" button executes `example/opi/scripts/xy_scan.py`:
308308
309309.. literalinclude :: ../example/opi/scripts/xy_scan.py
310310
311+ This script executes within the GUI with access to the widgets in the display.
312+ It is handled by Jython and can use the PyScanClient the same way as
313+ C-Python running outside the GUI.
311314
312315Table Scan
313316----------
314317
315- Scans that need to set devices like motors, temperature controllers etc.
316- to a list of desired position, then maybe start data acquisition at each
317- point, wait for some condition, then move to the next point can often
318- be expressed in a concise table notation.
318+ Scans that need to set devices like motors to a list of desired positions,
319+ start data acquisition at each point, wait for some condition, stop data acquisition,
320+ and then move to the next point can often be expressed in a concise table notation.
319321
320- In CS-Studio, use the menu `File `, `Open`` to open `PyScanClient/example/opi/3_Table_Scan.bob `.
321- Push the file folder button next to the "Table:____" text field and
322- locate the file `PyScanClient/example/tablescan.csv `,
323- then press "Load" and "Submit".
322+ In CS-Studio, use the menu `File `, `Open ` to open `PyScanClient/example/opi/3_Table_Scan.bob `.
323+ Push the file folder button next to the "Table:____" text field to
324+ locate the file `PyScanClient/example/tablescan.csv `.
325+ Press "Load" and "Submit".
324326
327+ .. image :: table_scan.png
325328
326- TODO .. more ..
329+ In short, table columns are typically PV names, and cells contain their values.
330+ Cell values for PVs may contain plain values as in the first row
331+ which sets both motors to 1.
332+ Cells may also contain lists of values or `loop(start, end, step) ` constructs,
333+ as in the second row which will create nested loops setting
334+ `motor_x ` to 1, 3, 5, while an inner loop will set
335+ `motor_y ` to 1, 1.5, 2, ..., 4.5, 5.0.
327336
337+ The triplet "Wait For", "Value" and "Or Time" columns have a special meaning.
338+ In the first row, after setting the motor positions, we wait for 5 seconds.
339+ In the second, we wait for the proton charge to increment by 1e9,
340+ or move on after 1 minute, whichever comes first.
341+ Either way, the `Start() ` commands which presumably start data aquisition are executed just
342+ before we wait, and the `Stop() ` commands which close data aquisition are executed after each "Wait For".
343+ Each PV that is used in a table row is logged at the end of each row.
344+
345+ Finally, the list of commands created for a table scan start with `Pre() ` commands and end with `Post() `
346+ commands. In the `beamline_setup.py ` shown above those are used to open and then close the shutter.
347+ The created list of commands can be seen in the scan editor:
348+
349+ .. image :: table_scan_commands.png
328350
329351See :mod: `scan.table.table_scan ` for more on the table syntax.
330352
353+ The PyScanClient fundamentally supports table scans in CSV format.
354+ The CS-Studio GUI offers a basic table display where values
355+ can be adjusted before submitting.
356+ Most spreadsheet programs can be used to create or edit more
357+ extensive table scans, which are then exported as CSV
358+ to load and submit them from the GUI.
359+ You may also extend your local copy of the tablescan GUI scripts
360+ to call out to tools like the LibreOffice file converter,
361+ "soffice --convert-to csv ...",
362+ which then allows the GUI to directly load such spreadsheet files
363+ without manual conversion to CSV.
364+
331365
332366Alignment Scan
333367--------------
@@ -345,3 +379,5 @@ https://github.com/ralphlange/procServ
345379Both the scan server and the CS-Studio GUI are typically started by a site-specific
346380launcher script that adds `-settings /path/to/site/settings.ini `.
347381
382+
383+ TODO: scan server's pre and post commands
0 commit comments