Deinitialize()

From SweepMe! Wiki
Jump to navigation Jump to search

The function 'deinitialize' is part of the Sequencer procedure and the counterpart of initialize(). It is called once at the end of the run for all checked modules of the sequencer, in the order they appear in the sequencer from top to bottom. It is called after poweroff() and unconfigure(), and afterwards disconnect() is called.

'deinitialize' is also called if the run is stopped by the user or by an error. If it fails for one module, SweepMe! still calls it for the other modules.

Use 'deinitialize' to undo what was done in initialize() and to perform a final reset of some parameters, e.g. to switch the instrument back to local mode so that it can be operated from its front panel again. As it is also called after errors, make sure that 'deinitialize' does not fail if the run was stopped at an early stage.