Disconnect()

From SweepMe! Wiki
Jump to navigation Jump to search

The function 'disconnect' is the last function of a run and the counterpart of connect(). It is called once after deinitialize() for all checked modules of the sequencer, in the order they appear in the sequencer from top to bottom. It is also called if the run is stopped by the user or by an error.

Use 'disconnect' to close communication objects that you created yourself in connect(). If your driver uses the Port manager, you do not need to close the port: SweepMe! closes it after 'disconnect' was called, so self.port can still be used inside 'disconnect'.

'disconnect' is called even if connect() failed. Make sure that it does not fail if an attribute that is created in connect() does not exist.