資源簡(jiǎn)介
Read an Digit-Multimeter in Python
代碼片段和文件信息
################################################################################
#???GWINSTEK?2019
#???GDM-8300?series?DMM??USB_CDC?&?RS232?port?DEMO?Program
################################################################################
import?visa????#?Need?install?pyvisainstrument
#?Change?VISA_ADDRESS?to?a?serial?VISA?address?e.g.?‘ASRL2::INSTR‘
VISA_ADDRESS?=?‘ASRL27::INSTR‘???#Your?instruments?VISA?address?goes?here!‘
try:
????#?Create?a?connection?(session)?to?the?serial?instrument
????resourceManager?=?visa.ResourceManager()
????session?=?resourceManager.open_resource(VISA_ADDRESS)
????print(VISA_ADDRESS)
????#?For?Serial?and?TCP/IP?socket?connections?enable?the?read?Termination?Character?or?read‘s?will?timeout
????if?session.resource_name.startswith(‘ASRL‘)?or?session.resource_name.endswith(‘SOCKET‘):
????????session.rea
評(píng)論
共有 條評(píng)論