Poweroff()
The function 'poweroff' is the counterpart of poweron(). It is called for a module
- when the next branch starts and the module is not part of it, if the module was switched on with poweron() before,
- at the end of the run for all modules of the last branch, also if the run was stopped by the user or by an error.
If a module is also part of the next branch, it stays switched on and 'poweroff' is not called.
The modules are processed from leaf to root, i.e. starting with the lowest module of the branch. 'poweroff' is called for all of these modules before unconfigure() is called. If 'poweroff' fails for one module, SweepMe! still calls it for the other modules.
Use 'poweroff' to switch off the output of an instrument, e.g. the output of an SMU. As SweepMe! calls 'poweroff' even after an error, it is the right place to bring the instrument into a safe state. Make sure that 'poweroff' itself does not fail if the run was stopped at an early stage, e.g. before the instrument was switched on.