diff --git a/instruments/T7Pro.py b/instruments/T7Pro.py index 1517da3..706f00a 100644 --- a/instruments/T7Pro.py +++ b/instruments/T7Pro.py @@ -4,11 +4,12 @@ import numpy #============================================================================== -ALL_VAL_TYPE = ['RES'] +ALL_VAL_TYPE = ['RES', 'TEMP PT100 K', 'TEMP PT100 C'] ALL_CHANNELS = ['1', '2', '3', '4'] ADRESS = "192.168.0.25" CONF_CHANNELS = [["AIN0", "AIN10"], ["AIN2", "AIN11"], ["AIN4", "AIN12"], ["AIN6", "AIN13"]] +VISHAY_CHANNELS = [1000., 1000., 1079., 10000.] #============================================================================== @@ -66,8 +67,16 @@ class T7Pro(abstract_instrument): def getValue(self): strMes = '' for ch in self.channels: - raw = self.read(CONF_CHANNELS[ALL_CHANNELS.index(ch)]) - strMes = strMes + str(100.*raw[0]/raw[1]) + ';' + if self.vtypes[self.channels.index(ch)] == 'RES': + raw = self.read(CONF_CHANNELS[ALL_CHANNELS.index(ch)]) + strMes = strMes + str(VISHAY_CHANNELS[ALL_CHANNELS.index(ch)]*raw[0]/raw[1]) + ';' + elif self.vtypes[self.channels.index(ch)] == 'TEMP PT100 K': + raw = self.read(CONF_CHANNELS[ALL_CHANNELS.index(ch)]) + strMes = strMes + str(((VISHAY_CHANNELS[ALL_CHANNELS.index(ch)]*raw[0]/raw[1])/100.-1)/0.003850+273.15) + ';' + elif self.vtypes[self.channels.index(ch)] == 'TEMP PT100 C': + raw = self.read(CONF_CHANNELS[ALL_CHANNELS.index(ch)]) + strMes = strMes + str(((VISHAY_CHANNELS[ALL_CHANNELS.index(ch)]*raw[0]/raw[1])/100.-1)/0.003850) + ';' + strMes = strMes[0:-1] + '\n' return(strMes)