描述
我想将键盘用作触发源以使用 HMF2525/2550 生成单脉冲。
我想将键盘用作触发源以使用 HMF2525/2550 生成单脉冲。
为了使用 USB 连接 HMF2550 和计算机,您需要下载(见链接 1)并安装 USB 虚拟 COM 端口 (VCP) 驱动程序。
参考的链接 2 描述了如何准确安装 VCP 驱动程序。
正确安装 VCP 之后,设备应显示在设备管理器中。图 1 显示设备分配至 COM 端口 3。
根据设备分配的 COM 端口,必须相应更改用于 VISA 连接的资源字符串“ASRL3::INSTR”。
在 Python 代码中应用以下设置:
- 突发数量
- 设置电压为 3 V
- 脉冲宽度为 10 us
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
从 RsInstrument.RsInstrument 导入 RsInstrument
def main():
instr = RsInstrument('ASRL3::INSTR', True, False)# 设备分配至 COM 端口 3
instr.clear_status()
instr.reset()
print(f'Instrument full name: {instr.full_instrument_model_name}')
# 定义脉冲
num_of_burst_cycles = '1'
voltage = '3'
pulse_width = '0.00001'
instr.write_str('FUNC PULS')
# 设置脉冲值
instr.write_str('BURS:NCYC ' + num_of_burst_cycles)
instr.write_str('VOLT ' + voltage)
instr.write_str('FUNC:PULS:WIDT:HIGH ' + pulse_width)
instr.write_str('BURS:MODE TRIG')
instr.write_str('TRIGGER:SOURCE EXT')
instr.write_str('OUTP ON')
instr.write_str('BURS:STAT ON')
while True:
input("Please press the Enter key to trigger a pulse")
instr.write_str('TRIG')
if __name__=="__main__":
main()
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
使用 RTB2004 测量信号发生器的突发,
并与 Python 脚本应用的设置进行对比
以便进行概念验证。
示波器设为单次采集模式,
并在识别到突发后立即进行记录。
图 2 显示示波器记录了一次采集。
如图所示,Python 脚本正确应用了设置。突发的设置电压为 3 V,
突发宽度为 10 us。