Sequencer procedure: Difference between revisions

From SweepMe! Wiki
Jump to navigation Jump to search
No edit summary
(Rewrite for quality and clarity)
Line 1: Line 1:
The following gives an overview of the functions that are called in a [[Modules | Module]] and that are forwarded to a [[Device Class | Driver]] if the Module can load drivers.
This section provides an easy-to-understand overview of the functions executed in a SweepMe! [[Modules|Module]]. These functions are forwarded to a [[Device Class|Driver]] if the Module can load drivers.


SweepMe! version 1.5.4 or higher
SweepMe! version 1.5.4 or higher


    # at start of the sequencer
'''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 all value and configurations to make the device ready for a measurement
* [[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: sets the configuration of the device
'''If a new [[branch]] is entered and the module was not part of the previous branch'''
        [[poweron()]]   -> for all items from root to leaf: switches the device on
 
       
* [[configure()]] - For all items from root to leaf: Set device configuration.
        # if a item of the sequencer starts its parameter variation
* [[poweron()]] - For all items from root to leaf: Powers on the device.
        [[signin()]] -> does nothing except calling reconfigure() if needed, but can be used to do something before the parameter variation starts
 
   
'''If an item of the sequencer starts its parameter variation'''
            # for each measurement point
 
            # each function is done for all items of the branch from root to leaf before the next function is performed:  
* [[signin()]] - Calls reconfigure() if needed. Can be used to perform actions before parameter variation starts.
            [[start()]]         -> prepare something before value is applied
 
            ----------------------------------------------------------------------------------------------
'''For each measurement point'''
            [[apply()]]         -> set the new value to a device if supported, '''only called if sweep value changes'''
 
            [[reach()]]         -> wait to reach the new value, start reaching a certain condition,  '''only called if 'apply' was called previously'''
Each step is performed for all items from root to leaf before the next step is started:
            ----------------------------------------------------------------------------------------------
 
            wait hold time      -> sleep any hold time while the setvalues are applied
* [[start()]] - Preparation before applying a new value.
            ----------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------
            [[adapt()]]         -> adapt the measurement devices to the new conditions
* [[apply()]] - '''Only called if the sweep value changes''': Sets a new value to a device .
            [[adapt_ready()]]   -> make sure all device have adapted to the new conditions
* [[reach()]] - '''Only called if apply() was called''': Wait to reach the new value or start reaching a certain condition
            [[trigger_ready()]] -> make devices ready to be triggered
* sleephold() - Sleeps during hold time while set values are applied.
            [[trigger()]]       -> deprecated: will be continued for a while
----------------------------------------------------------------------------------------------
            ----------------------------------------------------------------------------------------------
* [[adapt()]] - Adapts measurement devices to new conditions.
            [[measure()]]       -> initiate/trigger a measurement, nothing else
* [[adapt_ready()]] - Ensures all devices have adapted.
            [[request_result()]] -> request a result from the device buffer
* [[trigger_ready()]] - Prepares devices to be triggered.
            [[read_result()]]   -> read a result from the port buffer
* [[trigger()]] - Deprecated, continued for a while.
            ----------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------
            [[process_data()]]   -> process the measured data after the measurement itself has finished
* [[measure()]] - Initiates/Triggers a measurement.
            [[call()]]           -> '''mandatory''': return as many values to SweepMe! as defined by self.variables
* [[request_result()]] - Requests a result from the device buffer.
            ----------------------------------------------------------------------------------------------
* [[read_result()]] - Reads a result from the port buffer.
            [[process()]]       -> deprecated: will be continued for a while
----------------------------------------------------------------------------------------------
            [[finish()]]         -> clean up before the next measurement starts
* [[process_data()]] - Processes measured data after the measurement finishes.
       
* [[call()]] - '''Mandatory''': Returns values to SweepMe! as defined by self.variables.
        # if a item of the sequencer finishs its parameter variation
----------------------------------------------------------------------------------------------
        [[signout()]] -> does nothing, but can be used to do something after the parameter variation
* [[process()]] - Deprecated, continued for a while.
       
* [[finish()]] - Cleans up before the next measurement.
        #  if a [[branch]] is left and the module is not part of the next branch; also called if run is stopped by error
 
        [[poweroff()]]     -> for all items from leaf to root: switches the modules and devices off
'''If an item of the sequencer finishes its parameter variation'''
        [[unconfigure()]]   -> for all items from leaf to root: unconfigures the modules and drivers
* [[signout()]] - Optionally performs actions after parameter variation.     
   
 
    # at end for all items of the sequencer; also called if run is stopped by error
'''Leaving a branch and the module is not part of the next branch or run is stopped by error'''
    [[deinitialize()]]   -> for all items from root to leaf: reset the status for any other user of the equipment
* [[poweroff()]] - For all items from root to leaf: Switch off modules and devices.
    [[disconnect()]]     -> for all items from root to leaf: closes the port object
* [[unconfigure()]] - For all items from root to leaf: Unconfigure modules and devices.
 
'''End of sequencer of run is stopped by 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 ==
== General rules ==


* At the beginning of a measurement, modules and drivers use [[connect]] and [[initialize]] to make everything ready for the run. At the end [[deinitialize]] and [[disconnect] to bring the module or the driver back into an idle state and to close the connection.
* 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 is configure and powered on using [[configure]] and [[poweron]] function. If a module is not active anymore it get unconfigured and powered off using [[poweroff]] and [[unconfigure]].
* 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 [[reconfigure]].
* At each measurement point, i.e. a combination of setpoint iteration steps of the 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.
* At each measurement point, i.e. a combination of setpoint iteration steps of the 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.

Revision as of 15:18, 14 February 2024

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.4 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.
  • poweron() - For all items from root to leaf: Powers on the device.

If an item of the sequencer starts its parameter variation

  • signin() - Calls reconfigure() if needed. Can be used to perform actions before parameter variation starts.

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.



  • process_data() - Processes measured data after the measurement finishes.
  • call() - Mandatory: Returns values to SweepMe! as defined by self.variables.

  • process() - Deprecated, continued for a while.
  • finish() - Cleans up before the next measurement.

If an item of the sequencer finishes its parameter variation

  • signout() - Optionally performs actions after parameter variation.

Leaving a branch and the module is not part of the next branch or run is stopped by error

  • poweroff() - For all items from root to leaf: Switch off modules and devices.
  • unconfigure() - For all items from root to leaf: Unconfigure modules and devices.

End of sequencer of run is stopped by 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 reconfigure.
  • At each measurement point, i.e. a combination of setpoint iteration steps of the 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.