bec/docs/source/developer/scans/scan_stubs.md
2024-07-03 11:48:00 +02:00

5.1 KiB

(developer.scans.scan_stubs)=

Scan stubs - the building blocks of a scan

In order to simplify the creation of new scans, BEC provides a set of scan stubs that can be used as building blocks for new scans. The scan stubs are located in bec_server/bec_server/scan_server/scan_stubs.py. The following scan stubs are available:

Device operations

  • set_and_wait Set a device to a value and wait for it to finish.
  • read_and_wait Read a device and wait for it to finish.
  • stage Stage a device.
  • unstage Unstage a device.
  • kickoff Kickoff a device. Usually only needed for fly scans.
  • complete Wait for a device to finish.
  • get_req_status Check if a device request status matches the given RID and DIID.
  • get_device_progress Get the progress of a device.
  • pre_scan Trigger the pre_scan method of a device.
  • baseline_reading Trigger the baseline readings.
  • wait Wait for an event to finish. Could be a trigger, a readout or a movement.
  • read Read from a device.
  • trigger Trigger a device.
  • set Set a device to a value.
  • rpc Send an RPC command to a device.
  • send_rpc_and_wait Send an RPC command to a device and wait for it to finish.
  • set_with_response Set a device to a specific value and return the request ID. Use this method as an alternative to kickoff if the device does not support kickoff.
  • request_is_completed Check if a request that was initiated with set_with_response is completed.

Scan operations

More information on the scan stubs can be found in the API reference.