Apply()

From SweepMe! Wiki
Jump to navigation Jump to search

The function 'apply' is where the new Sweep value (i.e. set value) should be send to a measurement device. The latest Sweep value is simply available in each instrument driver as 'self.value' and is automatically updated once a new Sweep value is available.

It is good practice to convert the value to the type that you need to process it, e.g. float or str because there is no convention whether self.value must be always str, int, or float, or any other type.

The functions 'apply()' and 'reach()' are only called if the sweep value has changed. This prevents that a set value is sent multiple times to an instrument. For example, a repetitive measurement at a voltage of 0 V, only requires to set 0 V at the first measurement point. However, for all subsequent measurement points, sending 0 V is not needed, which is why apply is called again.