Sequencer procedure

From SweepMe! Wiki
Jump to navigation Jump to search

This section provides an easy-to-understand overview of the functions executed in a SweepMe! Module. These functions are forwarded to a Driver if the Module can load drivers.

SweepMe! version 1.5.6 or higher

Sequencer Start:
connect() For all items from root to leaf: get and open a port object to communicate with a device.
initialize() For all items from root to leaf: Set values and configurations for devices to prepare for measurement.
---------------------------------------------------------------------------------------------------
If a new branch is entered and the module was not part of the previous branch:
configure() For all items from root to leaf: Set device configuration. Right after configure, each module hands over its sweep value, so that modules lower in the sequencer can already use it.
poweron() For all items from root to leaf: Powers on the device.
If an item of the sequencer starts its parameter variation:
signin() Module by module from root to leaf: first calls reconfigure() if a GUI parameter has changed (e.g. via the parameter syntax {...}), then signin(). Can be used to perform actions before parameter variation starts.
transfer() Hands over parameters to the module. Do not override: this function is not called for drivers.
-------------------------------------------------------------------------------------------------
For each measurement point:
Each step is performed for all items from root to leaf before the next step is started:
start() Preparation before applying a new value.
----------------------------------------------------------------------------------------------
apply() Only called if the sweep value changes: Sets a new value to a device.
reach() Only called if apply() was called: Wait to reach the new value or start reaching a certain condition
sleephold() Sleeps during hold time while set values are applied.
----------------------------------------------------------------------------------------------
adapt() Adapts measurement devices to new conditions.
adapt_ready() Ensures all devices have adapted.
trigger_ready() Prepares devices to be triggered.
----------------------------------------------------------------------------------------------
measure() Initiates/Triggers a measurement.
request_result() Requests a result from the device buffer.
read_result() Reads a result from the port buffer.
----------------------------------------------------------------------------------------------
process_data() Processes measured data after the measurement finishes.
call() Mandatory: Returns values to SweepMe! as defined by self.variables.
----------------------------------------------------------------------------------------------
process() Only for Modules: Perform postprocessing after measurement data was obtained from the driver. Drivers should use process_data() to process data before it is transferred to SweepMe!.
finish() Cleans up before the next measurement.
--------------------------------------------------------------------------------------------------
If an item of the sequencer ends its parameter variation:
signout() Optionally performs actions after parameter variation.
Leaving a branch and the module is not part of the next branch, at the end of the run, or if the run is stopped:
poweroff() For all items from leaf to root: Switch off modules and devices.
unconfigure() For all items from leaf to root: Unconfigure modules and devices.
------------------------------------------------------------------------------------------------------
End of the run, also if the run is stopped by the user or by an error:
deinitialize() For all items from root to leaf: Resets the status for any other user of the equipment.
disconnect() For all items from root to leaf: Closes the port object.



General rules

  • At the beginning of a measurement, modules and drivers use connect() and initialize(). At the end deinitialize() and disconnect() to bring the module or the driver back to an idle state and to close the connection.
  • When a module gets active, i.e. it is part of an active branch, it runs configure() and poweron(). If a module is not active anymore it runs poweroff() and unconfigure(). These two functions are processed from leaf to root, so that modules lower in the sequencer are switched off first.
  • Each time a module starts its parameter variation, it runs signin(), and signout() when the variation ends.
  • At each measurement point, i.e. a combination of setpoint iteration steps of all modules in a branch, a couple of functions are called to perform the measurement point such as start(), apply(), reach(), adapt(), measure(), call() to name the most important ones.