self.control_channel.enable_control_loop(True) print( "Control loop enables. This test runs until the actual value raises above ", setpoint - 1) actual_value = self.control_channel.read_actual_value() while actual_value < (setpoint - 1): actual_value = self.control_channel.read_actual_value() print("Actual value: ", actual_value) time.sleep(1) # Now we disable the control loop and wait until the temperature dropped # by 10 degre print( "Control loop disabled. This test runs until the actual value drops below ", setpoint - 10) while actual_value > (setpoint - 10): actual_value = self.control_channel.read_actual_value() print("Actual value: ", actual_value) time.sleep(1) def step25_capi_close(self): print("Closing bus...") self.bus.stop() self.bus.close() if __name__ == '__main__': deviceconfig = test_common.parse_test_args("testconfig_qmixsdk") del sys.argv[1:] unittest.main()
def step10_volume_dosing(self): """ Tests volume dosing in continuous flow """ syringe_pump1 = self.contiflow_pump2.get_syringe_pump(0) max_syringe_level = syringe_pump1.get_volume_max() flow_rate = self.contiflow_pump2.get_flow_rate_max() target_volume = max_syringe_level * 1.5 print("Starting volume dosing with target volume ", target_volume) self.contiflow_pump2.pump_volume(target_volume, flow_rate) time.sleep(0.1) timer = qmixbus.PollingTimer(60000) while (self.contiflow_pump2.is_pumping() == True) and not timer.is_expired(): time.sleep(1) print("Dosed volume: ", self.contiflow_pump2.get_dosed_volume()) def step25_capi_close(self): """ Tests closing of the bus api """ print("Closing bus...") self.bus.stop() self.bus.close() if __name__ == '__main__': deviceconfig = parse_test_args("contiflow") del sys.argv[1:] unittest.main()