def set_sense_protect(self, state): """ Sets the open sense lead detection state :type state: str :param state: the state to set """ (err, msg) = W.SetSenseProtect(self, state) self._error_check(err, msg)
def configure_basic_parameters(self): """ Configure basic parameters of the power supply and register power supply outputs in equipment catalog dictionary """ self.perform_full_preset() ps_params = self.get_bench_params() # Sort power supply parameters list ps_params_list = ps_params.get_parameters_name() ps_params_list.sort() # Set the compensation mode if ps_params.has_parameter("CompensationMode"): mode = str(ps_params.get_param_value("CompensationMode")) self.set_compensation_mode(mode) # Set sense protection using if ps_params.has_parameter("SenseProtect"): protect = str(ps_params.get_param_value("SenseProtect")) W.SetSenseProtect(self, protect) # Set over current protection state using # OverProtectState parameter if ps_params.has_parameter("OverProtectState"): state = str(ps_params.get_param_value("OverProtectState")) self.set_over_current_protection_state(state) # Set current source using CurrentSource if ps_params.has_parameter("CurrentSource"): detector = str(ps_params.get_param_value("CurrentSource")) self.set_curr_sense_detector(detector) # Set Voltage protection level using VoltageProtectLevel parameter if ps_params.has_parameter("VoltageProtectLevel"): level = float(ps_params.get_param_value("VoltageProtectLevel")) self.set_voltage_protection_level(level) # Set resistance using Resistance parameter if ps_params.has_parameter("Resistance"): resistance = float(ps_params.get_param_value("Resistance")) self.set_resistance(resistance) # Set the protection delay using delay parameter if ps_params.has_parameter("ProtectDelay"): delay = float(ps_params.get_param_value("ProtectDelay")) self.set_protection_delay(delay) # Configure each output of the power supply for attr_name in ps_params_list: if "OUTPUT" in attr_name: output_params = ps_params.get_parameters(attr_name) output_type = output_params.get_param_value("Type") # Set output properties if type is not NONE if output_type == "NONE": continue port = int(output_params.get_param_value("PortNumber")) max_cur = float(output_params.get_param_value("MaxCurrent")) voltage = float(output_params.get_param_value("Voltage")) # Disable the output self.set_output_state("OFF", port) # Set the max current using CurrrentLevel and PortNumber self.set_max_current(max_cur, port) # Set voltage level using VoltageLevel and PortNumber self.set_current_voltage(voltage, port) # Enable the output self.set_output_state("ON", port)