要用SCPI指令查询双向直流电源的输出电压上限(OVP阈值),核心指令为
SOURce:VOLTage:PROTection:LEVel?
,该指令可返回当前设置的电压保护阈值(单位:伏特)。以下是具体步骤与注意事项:
进入远程控制模式(若设备未处于远程状态):
plaintextSYSTem:REMote
查询电压上限值:
plaintextSOURce:VOLTage:PROTection:LEVel?
60.0
表示60V)。
(可选)查询保护状态:
plaintextSOURce:VOLTage:PROTection:STATe?
ON
(启用)或
OFF
(禁用)。
假设需验证双向电源的电压上限是否设置为60V:
plaintextSYST:REMSOUR:VOLT:PROT:LEV? ; 查询电压上限
60.0
,则表示电压上限已正确配置。
不同厂商的设备可能使用略有差异的指令格式,常见变体包括:
plaintextSOUR:VOLT:PROT:HIGH? ; 查询电压上限
plaintextPROT:VOLT:HIGH? ; 查询电压上限
SOUR:VOLT:PROT:LEV?
)。
OUTPut:STATe ON
)。
plaintextSOURce:VOLTage:PROTection:ACTion?
plaintextOUTPut:PROTect:CLEar
pythonimport pyvisarm = pyvisa.ResourceManager()power = rm.open_resource("TCPIP0::192.168.1.100::inst0::INSTR") # 替换为实际地址# 查询电压上限volt_limit = float(power.query("SOUR:VOLT:PROT:LEV?"))print(f"当前电压上限: {volt_limit}V")# 查询保护状态prot_state = power.query("SOUR:VOLT:PROT:STAT?")print(f"保护功能状态: {'启用' if prot_state.strip() == 'ON' else '禁用'}")power.close()