完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
电子发烧友论坛|
我使用scpi和pyvisa编写了以下代码,用于自动化与DMM 34470A连接的2线热敏电阻的温度。
导入numpy为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()#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. |
|
相关推荐
2个回答
|
|
|
小错字,* IDN应该是* IDN?
然后你忘记了几个命令。 要启动DMM,您需要发送INIT,这将告诉它开始进行测量。 然后发送FETCH? 然后你的digital_multimeter.read()读回数据如果你想要你可以发送READ? 取代INIT,FETCH? 组合 以上来自于谷歌翻译 以下为原文 Small typo, *IDN should be *IDN? Then you just forgot a couple of commands. To get the DMM started you need to send INIT, this will tell it to start taking measurements. Then send FETCH? followed by your digital_multimeter.read() to read back the data If you want you can send READ? in place of the INIT, FETCH? combination |
|
|
|
|
|
@ lhornburg非常感谢..现在正在工作。 我用过READ命令。 以上来自于谷歌翻译 以下为原文 @ lhornburg Thank you very much..its now working. I have used READ command. |
|
|
|
|
只有小组成员才能发言,加入小组>>
1854 浏览 0 评论
2749 浏览 1 评论
2651 浏览 1 评论
2471 浏览 5 评论
3475 浏览 3 评论
1855浏览 0评论
427浏览 0评论
/9
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2025-12-9 07:17 , Processed in 0.948520 second(s), Total 76, Slave 59 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191

淘帖
7462