Example #1
0
    def read_temperature_data(self):
        """ Reads the temperature data and appends it to
            self.temperature_data"""

        current_temp = serialChiller.readCoolantTemperature(
            serialPort=self.ser)
        self.temperature_data.append(current_temp)
Example #2
0
    def initSerialToChiller_and_NI_daqmx(self):

        attemps_connect_to_chiller = 0
        while attemps_connect_to_chiller < 3:
            try:
                self.ser = serialChiller.open_chiller_port(chiller_serialport)
                self.logger.debug('Established connection to chiller')
                realtemp = serialChiller.readCoolantTemperature(
                    serialPort=self.ser)
                self.logger.debug('actual temp %.1f' % (realtemp / 10.))
                self.T_set.set(serialChiller.readSetTemperature(self.ser))
                time.sleep(0.3)
                break
            except SerialException:
                attemps_connect_to_chiller += 1
                time.sleep(0.5)
                self.logger.error('Could not connect to chiller %d time(s)' %
                                  attemps_connect_to_chiller)
                if attemps_connect_to_chiller == 3:
                    raise BaseException("Could not connect to chiller")

        self.read = int32()
        self.taskHandle = TaskHandle(0)
        self.nr_samples = 1000  #  changed from 10 samples to more
        self.data = init_channel(self.taskHandle, self.nr_samples, 10000.0)
        self.logger.info('devices initialised')
        self.devices_initialised.set(1)
        def initSerialToChiller_and_NI_daqmx(self):

            attemps_connect_to_chiller = 0
            while attemps_connect_to_chiller < 3:
                try :
                    self.ser = serialChiller.open_chiller_port(chiller_serialport)
                    self.logger.debug('Established connection to chiller')
                    realtemp = serialChiller.readCoolantTemperature(serialPort = self.ser)
                    self.logger.debug('actual temp %.1f' % (realtemp/10.))
                    self.T_set.set(serialChiller.readSetTemperature(self.ser))
                    time.sleep(0.3)
                    break
                except SerialException:
                    attemps_connect_to_chiller += 1
                    time.sleep(0.5)
                    self.logger.error( 'Could not connect to chiller %d time(s)' % attemps_connect_to_chiller)
                    if attemps_connect_to_chiller == 3:
                        raise BaseException(
                                "Could not connect to chiller")


            self.read = int32()
            self.taskHandle = TaskHandle(0)
            self.nr_samples = 1000 #  changed from 10 samples to more
            self.data = init_channel(self.taskHandle,self.nr_samples,10000.0)
            self.logger.info('devices initialised')
            self.devices_initialised.set(1)
        def read_temperature_data(self):
            """ Reads the temperature data and appends it to
            self.temperature_data"""

            current_temp = serialChiller.readCoolantTemperature(serialPort = self.ser)
            self.temperature_data.append(current_temp)