python技巧:pyvisa打开hislip设备;IEEE 488.2
python技巧:pyvisa打开hislip设备;IEEE 488.2。
有时候print("Available resources:", rm.list_resources()) 没有打印出想要的设备,如果inst0连不上,可以尝试hislip0。
查阅了一下资料:
High-Speed LAN Instrument Protocol (HiSLIP)
HiSLIP is a TCP-based protocol for remote control of Test & Measurement instruments (such as oscilloscopes, power supplies, multimeters, spectrum analyzers etc.). HiSLIP was developed by the IVI Foundation as a successor of the VXI-11 protocol. In comparison to VXI-11 HiSLIP improves performance, supports IPv6 and shared locking.
The High-Speed LAN Instrument Protocol specification was published in 2010 by IVI Foundation
HiSLIP is the future protocol for TCP/IP-based control of IEEE 488.2 message-based instruments.
import pyvisa# 初始化 VISA 资源管理器
rm = pyvisa.ResourceManager()# 列出所有可用资源(可选,用于调试)
print("Available resources:", rm.list_resources())# 尝试通过 IP 地址连接设备
try:# 使用 TCP/IP 连接,格式为 'TCPIP0::<IP地址>::INSTR'device = rm.open_resource('TCPIP0::169.254.199.11::hislip0::INSTR')# 查询设备标识(示例命令,具体命令取决于设备)print("Device ID:", device.query('*IDN?'))# 在这里添加你的设备操作代码...except pyvisa.VisaIOError as e:print(f"Error connecting to device: {e}")
finally:# 确保设备连接被关闭if 'device' in locals():device.close()