在SCPI指令中设置双向直流电源输出电压序列的延迟时间,需结合序列模式(List Mode)与输出使能延迟(Output Enable Delay)或软启动延迟(Soft Start Delay)功能,具体取决于电源型号的支持情况。以下是分步说明与示例:
序列模式(List Mode)
若电源支持序列模式,可通过定义每个序列点的电压值与持续时间(
SOURce:LIST:VOLTage:DATA
)实现延迟效果。此时,每个点的
参数即代表该电压值的保持时间,间接实现延迟。
输出使能延迟(Output Enable Delay)
若需在启动输出前延迟一段时间,可使用
OUTPut:DELay:STATe ON
启用延迟功能,并通过
OUTPut:DELay:TIME
设置延迟时间(单位:秒或电源支持的单位)。
软启动延迟(Soft Start Delay)
部分电源支持通过软启动时间(
SOURce:VOLTage:SOFT:TIME
)控制电压上升斜率,间接实现延迟效果。
设置序列点数量
plaintextSOURce:LIST:COUNt // 为序列点总数(如3表示3个点)
定义每个序列点的电压值与持续时间
plaintextSOURce:LIST:VOLTage:DATA1 5, 2 // 第1点:5V,持续2秒SOURce:LIST:VOLTage:DATA2 0, 1 // 第2点:0V,持续1秒
启用序列模式
plaintextSOURce:LIST:FUNCtion ON
启动输出
plaintextOUTPut:STATe ON
启用输出延迟功能
plaintextOUTPut:DELay:STATe ON
设置延迟时间
plaintextOUTPut:DELay:TIME 0.5 // 延迟0.5秒后启动输出
启动输出
plaintextOUTPut:STATe ON
设置软启动时间
plaintextSOURce:VOLTage:SOFT:TIME 0.2 // 软启动时间200ms
启动输出
plaintextOUTPut:STATe ON
SOURce:LIST:VOLTage
直接定义序列点,但需结合时间参数(如
SOURce:LIST:TIME
)。
plaintextSOURce:LIST:VOLTage 5, 0, -10 // 3个点的电压值(需结合时间参数)
plaintextLIST:VOLT:DATA1 5, 2000 // 2000=200ms
PROG:LIST:VOLT:DATA
定义序列点,支持编程输出使能延迟。
plaintextPROG:LIST:VOLT:DATA1 5, 2 // 第1点:5V,2秒
查询当前序列点索引
plaintextSOURce:LIST:INDEx? // 返回当前执行的序列点序号(如1表示第1点)
查询序列点参数
plaintextSOURce:LIST:VOLTage:DATA1? // 查询第1点的电压值与时间
错误处理
plaintextSYSTem:ERRor?
-400 Parameter Error
:参数超出范围(如时间值无效)。
-107 No Sequence Active
:序列未启用时查询状态。
pythonimport pyvisaimport timerm = pyvisa.ResourceManager()power = rm.open_resource("TCPIP0::192.168.1.100::inst0::INSTR")# 配置序列参数power.write("SYST:REM")power.write("SOUR:LIST:COUN 3")power.write("SOUR:LIST:VOLT:DATA1 5, 2") # 第1点:5V,2秒power.write("SOUR:LIST:VOLT:DATA2 0, 1") # 第2点:0V,1秒power.write("SOUR:LIST:VOLT:DATA3 -10, 3") # 第3点:-10V,3秒power.write("SOUR:LIST:FUNC ON")# 启动输出power.write("OUTP ON")# 查询当前点验证current_index = int(power.query("SOUR:LIST:INDEx?"))print(f"当前序列点: {current_index}") # 应输出: 当前序列点: 1power.close()