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