Commit f28cf50b authored by Peter Jansweijer's avatar Peter Jansweijer

Replaced 4 wire 100 ohm and PT_100 function and do a direct temp measurement on the DMM

parent 2278009c
......@@ -239,36 +239,6 @@ def get_statusline(ser_slave):
return(stat_lst)
############################################################################
def pt_100(ohm):
"""
Calculates the temperature for a given measured PT-100 resistance.
ohm -- Ohmic value of the PT-100
"""
# Rt = R0.(1 + A.t + B.t^2 + C.(t-100).t^3)
R0 = float(100.0)
A = float(3.9083e-3)
B = float(-5.7750e-7)
# C = -4,1430e-12 for t < 0 degrees / 0.0 for t >= 0 degrees
# For C = 0 =>
temp = (-R0 * A + (R0**2 * A**2 - 4 * R0 * B * (R0 - ohm))**0.5)/(2 * R0 * B)
return (temp)
############################################################################
def get_spool_temp(dmm):
"""
Read the fiber spool temperature with the Digital Multimeter
"""
ohm= float(dmm.ask("READ?"))
return(pt_100(ohm))
###############################################
# Main
......@@ -347,10 +317,10 @@ if __name__ == "__main__":
print(dmm.ask("*IDN?"))
# Returns 'Keysight Technologies,34465A,MY57501367,A.02.14-02.40-02.14-00.49-03-01'
# Configure for 4 wire resistance range 100 ohm
dmm.write("CONFigure:FRESistance 100")
# Configure for 4 wire temperature measurement
dmm.write("SAMPle:COUNt 1")
#print("Fiber Spool temperature", get_spool_temp(dmm))
dmm.write("UNIT:TEMPerature C")
print("Fiber Spool temperature", float(dmm.ask("MEAS:TEMP? FRTD")))
ser_slave = serial.Serial()
......@@ -512,7 +482,7 @@ if __name__ == "__main__":
crtt_mean = numpy.mean(crtt[(crtt_skip + 1):]) # skip first measurements
if args.t != None: # open and configue Digital Multimeter with attached PT100
spool_temp = get_spool_temp(dmm)
spool_temp =float(dmm.ask("MEAS:TEMP? FRTD"))
print("sfp_channel: ", sfp_ch ,"itu_channel: ", ch ,"crtt avarage over "+str(crtt_measurement)+" measurments: "+str(crtt_mean)+" fiber-spool temp: "+str(spool_temp))
data_file.write(str(sfp_ch)+", "+str(ch)+", "+str(wavelength)+", "+str(crtt_mean)+", "+str(curr_drxm)+", "+str(curr_drxs)+", "+str(spool_temp)+", "+str(curr_temp)+"\n")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment