我使用scpi和pyvisa编写了以下代码,用于自动化与DMM 34470A连接的2线热敏电阻的温度。
导入numpy为np rm = visa.open.ResourceManager('@ py')digital_mul
timeter = rm.open_resource(“TCPIP0:186:129:300:243 :: inst0 :: INSTR”)digital_multimeter.timeout = 5000 number_of_readings =
1 digital_multimeter.wrote(“* cls”)digital_multimeter.write(“* IDN”)print digital_multimeter.read()#configuration instrument digital_multimeter.write(“CONF:TEMP THER”)digital_multimeter.write(“TEMP:TRAN:THER:
TYPE 5000“)digital_multimeter.write(”TEMP:TRAN:THER:POW:LTM ON“)digital_multimeter.write(”SAMP:COUN%d“%number_of_readings)print”readtemp of thermister“print digital_multimeter.read()digital_multimeter.close
()在打印设备的IDN后打印“完成”,它只打印:读取热敏电阻的温度“但它没有打印显示在设备中的温度。我是这个编程的新手。请帮我纠正我的代码和
获得所需的输出。
以上来自于谷歌翻译
以下为原文
I have written the following code using scpi and pyvisa for automating the temperature of 2 wire thermister connected with DMM 34470A.
import visa
import numpy as np
rm =visa.open.ResourceManager('@py')
digital_multimeter = rm.open_resource("TCPIP0:186:129:300:243::inst0::INSTR")
digital_multimeter.timeout= 5000
number_of_readings =1
digital_multimeter.wrote("*cls")
digital_multimeter.write("*IDN")
print digital_multimeter.read()
#configuring instrument
digital_multimeter.write("CONF:TEMP THER")
digital_multimeter.write("TEMP:TRAN:THER:TYPE 5000")
digital_multimeter.write("TEMP:TRAN:THER:POW:LTM ON")
digital_multimeter.write("SAMP:COUN %d" %number_of_readings)
print "readingtemp of thermister"
print digital_multimeter.read()
digital_multimeter.close()
print "complete"
after printing the IDN of device, it is only printing : reading temp of thermister" but it is not printing the temperature showing into the device.
I am new to this programming. Please help me to correct my code and get the desired output.
0