Sequencer procedure: Difference between revisions

From SweepMe! Wiki
Jump to navigation Jump to search
No edit summary
mNo edit summary
 
(31 intermediate revisions by 4 users not shown)
Line 1: Line 1:
The following gives an overview of the functions that are called in a [[Device Class]] in the sequencer procedure.
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.2.4 or higher
SweepMe! version 1.5.6 or higher


Before you need to know what a [[Root-To-Leaf]] (branch) is.
{|
'''Sequencer Start:'''
|-
| colspan="3"| [[connect()]] || For all items from root to leaf: get and open a port object to communicate with a device.
|-
| colspan="3"| [[initialize()]]|| For all items from root to leaf: Set values and configurations for devices to prepare for measurement.
|-
| colspan="4"| ---------------------------------------------------------------------------------------------------
|-
| style="width: 15px"| || colspan="3"| '''If a new [[branch]] is entered and the module was not part of the previous branch:'''
|-
| || colspan="2"| [[configure()]] || For all items from root to leaf: Set device configuration.
|-
| || colspan="2"| [[poweron()]]|| For all items from root to leaf: Powers on the device.
|-
| || colspan="3"| '''If an item of the sequencer starts its parameter variation:'''
|-
| || colspan="2"| [[signin()]] || Calls reconfigure() if needed. Can be used to perform actions before parameter variation starts.
|-
| || colspan="2"| transfer() || Hands over parameters to the module. '''Do not override - This function is not called for drivers.'''
|-
| || colspan="3"| -------------------------------------------------------------------------------------------------
|-
| || style="width: 15px"| || colspan="2"| '''For each measurement point:'''
|-
| ||  || colspan="2"| Each step is performed for all items from root to leaf before the next step is started:
|-
| ||  ||  [[start()]] || Preparation before applying a new value.
|-
| ||  || colspan="2"| ----------------------------------------------------------------------------------------------
|-
| ||  ||  [[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.
|-
| ||  || colspan="2"| ----------------------------------------------------------------------------------------------
|-
| ||  ||  [[adapt()]] || Adapts measurement devices to new conditions.
|-
| ||  ||  [[adapt_ready()]] || Ensures all devices have adapted.
|-
| ||  ||  [[trigger_ready()]] || Prepares devices to be triggered.
|-
| ||  ||  trigger() || Deprecated, use measure() instead.
|-
| ||  || colspan="2"| ----------------------------------------------------------------------------------------------
|-
| ||  ||  [[measure()]] || Initiates/Triggers a measurement.
|-
| ||  ||  [[request_result()]] || Requests a result from the device buffer.
|-
| ||  ||  [[read_result()]] || Reads a result from the port buffer.
|-
| ||  || colspan="2"| ----------------------------------------------------------------------------------------------
|-
| ||  ||  [[process_data()]] || Processes measured data after the measurement finishes.
|-
| ||  ||  [[call()]] || '''Mandatory''': Returns values to SweepMe! as defined by self.variables.
|-
| ||  || colspan="2"| ----------------------------------------------------------------------------------------------
|-
| ||  ||  [[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.
|-
| ||  colspan="3"| --------------------------------------------------------------------------------------------------
|-
|  || colspan="3"| '''If an item of the sequencer ends its parameter variation:'''
|-
|  || colspan="2"| [[signout()]] || Optionally performs actions after parameter variation.
|-
|  || colspan="3"| '''Leaving a branch and the module is not part of the next branch or run is stopped by error:'''
|-
|  || colspan="2"| [[poweroff()]] || For all items from root to leaf: Switch off modules and devices.
|-
|  || colspan="2"| [[unconfigure()]] || For all items from root to leaf: Unconfigure modules and devices.
|-
| colspan="4"| ------------------------------------------------------------------------------------------------------
|-
|colspan="4"| '''End of sequencer or if run is stopped by error:''' 
|-
| colspan="3"| [[deinitialize()]] || For all items from root to leaf: Resets the status for any other user of the equipment.
|-
| colspan="3"| [[disconnect()]] || For all items from root to leaf: Closes the port object.
|}


    # at start of the sequencer
 
    [[connect()]]    -> for all items: get and open a port object to communicate with a device
 
    [[initialize()]]  -> for all items: set all value and configurations to make the device ready for a measurement
 
   
 
        # if a item of the sequencer starts its parameter variation
== General rules ==
        [[signin()]]  -> does nothing, but can be used to do something before the parameter variation starts
 
       
* 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.
        # if a Root-To-Leaf is entered
* 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()]].
        [[configure()]]  -> changes the configuration of the device
* 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.
        [[poweron()]]    -> switches the device on
 
   
{{Sequencer_procedure}}
            # if a leaf of a Root-To-Leaf is reached
            # each function is done for all items of the branch before the next function is performed:
            [[start()]]         -> prepare something before value is applied
            ----------------------------------------------------------------------------------------------
            [[apply()]]         -> set the new value to a device if supported
            [[reach()]]         -> wait to reach the new value, start reaching a certain condition
            ----------------------------------------------------------------------------------------------
            [[sleephold()]]     -> sleep the hold time while the value is applied to the device
            ----------------------------------------------------------------------------------------------
            [[adapt()]]          -> adapt the measurement devices to the new conditions
            [[adapt_ready()]]    -> make sure all device have adapted to the new conditions
            [[trigger_ready()]]  -> make devices ready to be triggered
            [[trigger()]]        -> deprecated: will be continued for a while
            ----------------------------------------------------------------------------------------------
            [[measure()]]       -> initiate/trigger a measurement, nothing else
            [[request_result()]] -> request a result from the device buffer
            [[read_result()]]   -> read a result from the port buffer
            ----------------------------------------------------------------------------------------------
            [[process_data()]]   -> process the measured data after the measurement itself has finished
            [[call()]]           -> '''mandatory''': return values to SweepMe!
            ----------------------------------------------------------------------------------------------
            [[process()]]        -> deprecated: will be continued for a while
            [[finish()]]        -> clean up before the next measurement starts
            ----------------------------------------------------------------------------------------------
            [[sleepstop()]]     -> sleep the stop time while the device is set to its idlevale
     
        # if a Root-To-Leaf is left
        [[poweroff()]]     -> for all items: switches the device off
        [[unconfigure()]]   -> set value to idlevalue and apply() it
       
        # if a item of the sequencer finishs its parameter variation
        [[signout()]] -> does nothing, but can be used to do something after the parameter variation
   
    # at end for all items of the sequencer
    [[deinitialize()]]   -> for all items: reset the status for any other user of the equipment
    [[disconnect()]]     -> for all items: closes the port object

Latest revision as of 10:22, 20 August 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.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.
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.
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.
trigger() Deprecated, use measure() instead.
----------------------------------------------------------------------------------------------
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 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 or if 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