using System.Collections.Generic;
namespace APS7100TestTool.Libraries
{
///
/// PSW250-4.5 SCPI 命令库
///
public static class PSW250CommandLibrary
{
public static List GetAllCommands()
{
return new List
{
// ==================== 系统命令 ====================
new ScpiCommandInfo
{
Category = "系统命令",
Command = "*IDN?",
Description = "查询设备识别信息",
IsQuery = true,
Example = "返回: GWINSTEK,PSW250-4.5,SN123456,V1.00"
},
new ScpiCommandInfo
{
Category = "系统命令",
Command = "*RST",
Description = "重置设备到出厂状态",
IsQuery = false,
Example = null
},
new ScpiCommandInfo
{
Category = "系统命令",
Command = "*CLS",
Description = "清除状态寄存器",
IsQuery = false,
Example = null
},
new ScpiCommandInfo
{
Category = "系统命令",
Command = "SYST:ERR?",
Description = "查询错误队列",
IsQuery = true,
Example = "返回: 0,\"No error\""
},
new ScpiCommandInfo
{
Category = "系统命令",
Command = "SYST:VERS?",
Description = "查询 SCPI 版本",
IsQuery = true,
Example = "返回: 1999.0"
},
// ==================== 输出控制 ====================
new ScpiCommandInfo
{
Category = "输出控制",
Command = "OUTP ON",
Description = "开启输出",
IsQuery = false,
Example = null
},
new ScpiCommandInfo
{
Category = "输出控制",
Command = "OUTP OFF",
Description = "关闭输出",
IsQuery = false,
Example = null
},
new ScpiCommandInfo
{
Category = "输出控制",
Command = "OUTP?",
Description = "查询输出状态",
IsQuery = true,
Example = "返回: 0(关) 或 1(开)"
},
// ==================== 电压设置 ====================
new ScpiCommandInfo
{
Category = "电压设置",
Command = "SOUR:VOLT 12",
Description = "设置输出电压为 12V",
IsQuery = false,
Example = "范围: 0-72V"
},
new ScpiCommandInfo
{
Category = "电压设置",
Command = "SOUR:VOLT 24",
Description = "设置输出电压为 24V",
IsQuery = false,
Example = "范围: 0-72V"
},
new ScpiCommandInfo
{
Category = "电压设置",
Command = "SOUR:VOLT 48",
Description = "设置输出电压为 48V",
IsQuery = false,
Example = "范围: 0-72V"
},
new ScpiCommandInfo
{
Category = "电压设置",
Command = "SOUR:VOLT?",
Description = "查询电压设定值",
IsQuery = true,
Example = "返回: 12.0"
},
new ScpiCommandInfo
{
Category = "电压设置",
Command = "SOUR:VOLT:PROT 75",
Description = "设置过压保护值",
IsQuery = false,
Example = "设置为 75V"
},
new ScpiCommandInfo
{
Category = "电压设置",
Command = "SOUR:VOLT:PROT?",
Description = "查询过压保护值",
IsQuery = true,
Example = "返回: 75.0"
},
// ==================== 电流设置 ====================
new ScpiCommandInfo
{
Category = "电流设置",
Command = "SOUR:CURR 1",
Description = "设置输出电流为 1A",
IsQuery = false,
Example = "范围: 0-4.5A"
},
new ScpiCommandInfo
{
Category = "电流设置",
Command = "SOUR:CURR 2",
Description = "设置输出电流为 2A",
IsQuery = false,
Example = "范围: 0-4.5A"
},
new ScpiCommandInfo
{
Category = "电流设置",
Command = "SOUR:CURR 3",
Description = "设置输出电流为 3A",
IsQuery = false,
Example = "范围: 0-4.5A"
},
new ScpiCommandInfo
{
Category = "电流设置",
Command = "SOUR:CURR?",
Description = "查询电流设定值",
IsQuery = true,
Example = "返回: 1.0"
},
new ScpiCommandInfo
{
Category = "电流设置",
Command = "SOUR:CURR:PROT 5",
Description = "设置过流保护值",
IsQuery = false,
Example = "设置为 5A"
},
new ScpiCommandInfo
{
Category = "电流设置",
Command = "SOUR:CURR:PROT?",
Description = "查询过流保护值",
IsQuery = true,
Example = "返回: 5.0"
},
// ==================== 输出控制优先级 ====================
// 注意:CV/CC 是运行结果(取决于负载),不是可切换的模式
// OUTP:MODE 设置的是控制优先级和动态响应策略
new ScpiCommandInfo
{
Category = "输出控制优先级",
Command = "OUTP:MODE CVHS",
Description = "恒压优先(高速响应)",
IsQuery = false,
Example = "电压控制优先,快速响应负载变化"
},
new ScpiCommandInfo
{
Category = "输出控制优先级",
Command = "OUTP:MODE CCHS",
Description = "恒流优先(高速响应)",
IsQuery = false,
Example = "电流控制优先,快速响应负载变化"
},
new ScpiCommandInfo
{
Category = "输出控制优先级",
Command = "OUTP:MODE CVLS",
Description = "恒压优先(斜率/平滑变化)",
IsQuery = false,
Example = "电压控制优先,平滑过渡"
},
new ScpiCommandInfo
{
Category = "输出控制优先级",
Command = "OUTP:MODE CCLS",
Description = "恒流优先(斜率/平滑变化)",
IsQuery = false,
Example = "电流控制优先,平滑过渡"
},
new ScpiCommandInfo
{
Category = "输出控制优先级",
Command = "OUTP:MODE?",
Description = "查询当前输出控制优先级",
IsQuery = true,
Example = "返回: 0=CVHS, 1=CCHS, 2=CVLS, 3=CCLS"
},
// ==================== 测量命令 ====================
new ScpiCommandInfo
{
Category = "测量命令",
Command = "MEAS:VOLT?",
Description = "测量实际输出电压",
IsQuery = true,
Example = "返回: 12.05"
},
new ScpiCommandInfo
{
Category = "测量命令",
Command = "MEAS:CURR?",
Description = "测量实际输出电流",
IsQuery = true,
Example = "返回: 1.234"
},
new ScpiCommandInfo
{
Category = "测量命令",
Command = "MEAS:POW?",
Description = "测量实际输出功率",
IsQuery = true,
Example = "返回: 14.87"
},
// ==================== 保护功能 ====================
new ScpiCommandInfo
{
Category = "保护功能",
Command = "VOLT:PROT:STAT ON",
Description = "启用过压保护",
IsQuery = false,
Example = null
},
new ScpiCommandInfo
{
Category = "保护功能",
Command = "VOLT:PROT:STAT OFF",
Description = "禁用过压保护",
IsQuery = false,
Example = null
},
new ScpiCommandInfo
{
Category = "保护功能",
Command = "VOLT:PROT:STAT?",
Description = "查询过压保护状态",
IsQuery = true,
Example = "返回: 0(关) 或 1(开)"
},
new ScpiCommandInfo
{
Category = "保护功能",
Command = "CURR:PROT:STAT ON",
Description = "启用过流保护",
IsQuery = false,
Example = null
},
new ScpiCommandInfo
{
Category = "保护功能",
Command = "CURR:PROT:STAT OFF",
Description = "禁用过流保护",
IsQuery = false,
Example = null
},
new ScpiCommandInfo
{
Category = "保护功能",
Command = "CURR:PROT:STAT?",
Description = "查询过流保护状态",
IsQuery = true,
Example = "返回: 0(关) 或 1(开)"
},
// ==================== 远程控制 ====================
new ScpiCommandInfo
{
Category = "远程控制",
Command = "SYST:REM",
Description = "进入远程控制模式",
IsQuery = false,
Example = "锁定前面板"
},
new ScpiCommandInfo
{
Category = "远程控制",
Command = "SYST:COMM:RLST LOCAL",
Description = "返回本地控制模式(面板有效)",
IsQuery = false,
Example = "解锁前面板"
},
};
}
public static List GetCategories()
{
var categories = new List();
foreach (var cmd in GetAllCommands())
{
if (!categories.Contains(cmd.Category))
{
categories.Add(cmd.Category);
}
}
return categories;
}
public static List GetCommandsByCategory(string category)
{
var commands = new List();
foreach (var cmd in GetAllCommands())
{
if (cmd.Category == category)
{
commands.Add(cmd);
}
}
return commands;
}
}
}