要使用SCPI指令設(shè)置雙向直流電源輸出電流序列的起始值,需結(jié)合序列模式(List Mode)的配置指令,通過定義序列點參數(shù)實現(xiàn)。以下是具體步驟和示例:
plaintextSOURce:LIST:COUNt <N>
<N>為序列點總數(shù)(如3表示3個點)。plaintextSOURce:LIST:CURRent:DATA<n> <I_n>, <T_n>
<n>為序列點序號(從1開始,如DATA1表示第1點)。<I_n>為當前點的電流值(單位:A,如-10表示-10A)。<T_n>為當前點的持續(xù)時間(單位:秒或電源支持的單位,如2表示2秒)。plaintextSOURce:LIST:CURRent:DATA1 -5, 2 // 第1點:-5A,持續(xù)2秒SOURce:LIST:CURRent:DATA2 0, 1 // 第2點:0A,持續(xù)1秒
plaintextSOURce:LIST:FUNCtion ON
plaintextSOURce:LIST:CYCLe OFF
初始化與復(fù)位
plaintextSYSTem:REMote // 進入遠程模式*RST // 復(fù)位設(shè)備(可選)
配置序列參數(shù)
plaintextSOURce:LIST:COUNt 3 // 3個序列點SOURce:LIST:CURRent:DATA1 -5, 2 // 第1點:-5A,2秒
SOURce:LIST:CURRent:DATA2 0, 1 // 第2點:0A,1秒
SOURce:LIST:CURRent:DATA3 10, 3 // 第3點:10A,3秒
啟用序列模式
plaintextSOURce:LIST:FUNCtion ON
啟動輸出
plaintextOUTPut:STATe ON // 開啟輸出,電源將按序列輸出電流
SOURce:LIST:CURRent直接定義序列點:plaintextSOURce:LIST:CURRent -5, 0, 10 // 3個點的電流值(需結(jié)合時間參數(shù))
plaintextSOURce:LIST:GOTO 2 // 跳轉(zhuǎn)到第2點
plaintextLIST:CURR:DATA1 -5, 2000 // 2000=200ms
plaintextLIST:JUMP:INDEx 2 // 跳轉(zhuǎn)到第2點
PROG:LIST:CURR:DATA定義序列點:plaintextPROG:LIST:CURR:DATA1 -5, 2 // 第1點:-5A,2秒
查詢當前序列點索引
plaintextSOURce:LIST:INDEx?
1表示第1點)。查詢序列點參數(shù)
plaintextSOURce:LIST:CURRent:DATA1? // 查詢第1點的電流值與時間
錯誤處理
plaintextSYSTem:ERRor?
-400 Parameter Error:參數(shù)超出范圍(如電流值超過電源規(guī)格)。-107 No Sequence Active:序列未啟用時查詢狀態(tài)。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:CURR:DATA1 -5, 2")power.write("SOUR:LIST:CURR:DATA2 0, 1")power.write("SOUR:LIST:CURR:DATA3 10, 3")power.write("SOUR:LIST:FUNC ON")# 啟動輸出power.write("OUTP ON")# 查詢當前點驗證current_index = int(power.query("SOUR:LIST:INDEx?"))print(f"當前序列點: {current_index}") # 應(yīng)輸出: 當前序列點: 1power.close()
SOURce:LIST:COUNt?返回的總點數(shù)。-5A)。