PXI PROGRAMMABLE POWER SUPPLIES

PXI 可编程电源曲线控制

在浏览器中生成、编辑和导出电压或电流曲线,再通过本机 NI-DCPower Python 脚本驱动 PXI 可编程电源按序列输出。

PXI 可编程电源电压 / 电流曲线CSV → nidcpower

曲线设计

参数只影响浏览器内的预览和导出文件,实际输出前请再次核对负载与限值。

本地生成
已生成 201 个采样点。

曲线预览

201 个点 · 2.000 s · 电压 (V)

最小值0.0000000 V
最大值5.0000000 V
步进间隔10.00 ms
滚轮缩放 · 拖动画布 · 拖动节点(同步重绘线段)· 双击新增节点
-80 ms280 ms640 ms1.00 s1.36 s1.72 s2.08 s5.6004.3603.1201.8800.6400-0.6000
时间 (s)未选择节点电压 (V)

CSV 数据

导出的 CSV 使用 `index,time_s,level,voltage_v,current_a`;表格只显示一列曲线输出值,避免电压字段重复。

显示前 200 / 201 行
#时间 (s)曲线输出值 (V)
00.0000000000.0000000
10.0100000000.025000000
20.0200000000.050000000
30.0300000000.075000000
40.0400000000.10000000
50.0500000000.12500000
60.0600000000.15000000
70.0700000000.17500000
80.0800000000.20000000
90.0900000000.22500000
100.1000000000.25000000
110.1100000000.27500000
120.1200000000.30000000
130.1300000000.32500000
140.1400000000.35000000
150.1500000000.37500000
160.1600000000.40000000
170.1700000000.42500000
180.1800000000.45000000
190.1900000000.47500000
200.2000000000.50000000
210.2100000000.52500000
220.2200000000.55000000
230.2300000000.57500000
240.2400000000.60000000
250.2500000000.62500000
260.2600000000.65000000
270.2700000000.67500000
280.2800000000.70000000
290.2900000000.72500000
300.3000000000.75000000
310.3100000000.77500000
320.3200000000.80000000
330.3300000000.82500000
340.3400000000.85000000
350.3500000000.87500000
360.3600000000.90000000
370.3700000000.92500000
380.3800000000.95000000
390.3900000000.97500000
400.4000000001.0000000
410.4100000001.0250000
420.4200000001.0500000
430.4300000001.0750000
440.4400000001.1000000
450.4500000001.1250000
460.4600000001.1500000
470.4700000001.1750000
480.4800000001.2000000
490.4900000001.2250000
500.5000000001.2500000
510.5100000001.2750000
520.5200000001.3000000
530.5300000001.3250000
540.5400000001.3500000
550.5500000001.3750000
560.5600000001.4000000
570.5700000001.4250000
580.5800000001.4500000
590.5900000001.4750000
600.6000000001.5000000
610.6100000001.5250000
620.6200000001.5500000
630.6300000001.5750000
640.6400000001.6000000
650.6500000001.6250000
660.6600000001.6500000
670.6700000001.6750000
680.6800000001.7000000
690.6900000001.7250000
700.7000000001.7500000
710.7100000001.7750000
720.7200000001.8000000
730.7300000001.8250000
740.7400000001.8500000
750.7500000001.8750000
760.7600000001.9000000
770.7700000001.9250000
780.7800000001.9500000
790.7900000001.9750000
800.8000000002.0000000
810.8100000002.0250000
820.8200000002.0500000
830.8300000002.0750000
840.8400000002.1000000
850.8500000002.1250000
860.8600000002.1500000
870.8700000002.1750000
880.8800000002.2000000
890.8900000002.2250000
900.9000000002.2500000
910.9100000002.2750000
920.9200000002.3000000
930.9300000002.3250000
940.9400000002.3500000
950.9500000002.3750000
960.9600000002.4000000
970.9700000002.4250000
980.9800000002.4500000
990.9900000002.4750000
1001.0000000002.5000000
1011.0100000002.5250000
1021.0200000002.5500000
1031.0300000002.5750000
1041.0400000002.6000000
1051.0500000002.6250000
1061.0600000002.6500000
1071.0700000002.6750000
1081.0800000002.7000000
1091.0900000002.7250000
1101.1000000002.7500000
1111.1100000002.7750000
1121.1200000002.8000000
1131.1300000002.8250000
1141.1400000002.8500000
1151.1500000002.8750000
1161.1600000002.9000000
1171.1700000002.9250000
1181.1800000002.9500000
1191.1900000002.9750000
1201.2000000003.0000000
1211.2100000003.0250000
1221.2200000003.0500000
1231.2300000003.0750000
1241.2400000003.1000000
1251.2500000003.1250000
1261.2600000003.1500000
1271.2700000003.1750000
1281.2800000003.2000000
1291.2900000003.2250000
1301.3000000003.2500000
1311.3100000003.2750000
1321.3200000003.3000000
1331.3300000003.3250000
1341.3400000003.3500000
1351.3500000003.3750000
1361.3600000003.4000000
1371.3700000003.4250000
1381.3800000003.4500000
1391.3900000003.4750000
1401.4000000003.5000000
1411.4100000003.5250000
1421.4200000003.5500000
1431.4300000003.5750000
1441.4400000003.6000000
1451.4500000003.6250000
1461.4600000003.6500000
1471.4700000003.6750000
1481.4800000003.7000000
1491.4900000003.7250000
1501.5000000003.7500000
1511.5100000003.7750000
1521.5200000003.8000000
1531.5300000003.8250000
1541.5400000003.8500000
1551.5500000003.8750000
1561.5600000003.9000000
1571.5700000003.9250000
1581.5800000003.9500000
1591.5900000003.9750000
1601.6000000004.0000000
1611.6100000004.0250000
1621.6200000004.0500000
1631.6300000004.0750000
1641.6400000004.1000000
1651.6500000004.1250000
1661.6600000004.1500000
1671.6700000004.1750000
1681.6800000004.2000000
1691.6900000004.2250000
1701.7000000004.2500000
1711.7100000004.2750000
1721.7200000004.3000000
1731.7300000004.3250000
1741.7400000004.3500000
1751.7500000004.3750000
1761.7600000004.4000000
1771.7700000004.4250000
1781.7800000004.4500000
1791.7900000004.4750000
1801.8000000004.5000000
1811.8100000004.5250000
1821.8200000004.5500000
1831.8300000004.5750000
1841.8400000004.6000000
1851.8500000004.6250000
1861.8600000004.6500000
1871.8700000004.6750000
1881.8800000004.7000000
1891.8900000004.7250000
1901.9000000004.7500000
1911.9100000004.7750000
1921.9200000004.8000000
1931.9300000004.8250000
1941.9400000004.8500000
1951.9500000004.8750000
1961.9600000004.9000000
1971.9700000004.9250000
1981.9800000004.9500000
1991.9900000004.9750000

生成 nidcpower 脚本

下载后在安装 NI-DCPower Python API 的本机运行,脚本会读取同目录 CSV。

#!/usr/bin/env python3
"""Run a CSV curve on a PXI programmable power supply with NI-DCPower.
Generated by the Instrument Data tools. Verify the resource and limits first.
"""
import argparse
import csv
import time
from pathlib import Path

import nidcpower

DEFAULT_RESOURCE = "PXI1Slot2/0"
DEFAULT_MODE = "voltage"
DEFAULT_REPEAT = 1
DEFAULT_VOLTAGE_LIMIT = 6
DEFAULT_CURRENT_LIMIT = 0.1


def load_curve(path: Path):
    with path.open("r", newline="", encoding="utf-8-sig") as handle:
        rows = list(csv.DictReader(handle))
    if len(rows) < 2:
        raise ValueError("CSV must contain at least two data rows")
    values = []
    times = []
    for row in rows:
        value_text = row.get("level") or row.get("voltage_v") or row.get("current_a") or row.get("value")
        if value_text in (None, ""):
            raise ValueError("CSV is missing level/voltage_v/current_a")
        values.append(float(value_text))
        time_text = row.get("time_s") or row.get("time")
        times.append(float(time_text) if time_text not in (None, "") else None)
    if any(value is None for value in times):
        delay = 0.001
        delays = [delay] * len(values)
    else:
        delays = []
        for index in range(len(values)):
            if index + 1 < len(times):
                delays.append(max(0.000001, times[index + 1] - times[index]))
            elif len(times) > 1:
                delays.append(max(0.000001, times[-1] - times[-2]))
            else:
                delays.append(0.001)
    return values, delays, sum(delays)


def main():
    parser = argparse.ArgumentParser(description="Run a CSV voltage/current curve on a PXI programmable power supply")
    parser.add_argument("--resource", default=DEFAULT_RESOURCE)
    parser.add_argument("--csv", type=Path, default=Path("ni_4112_curve.csv"))
    parser.add_argument("--mode", choices=("voltage", "current"), default=DEFAULT_MODE)
    parser.add_argument("--voltage-limit", type=float, default=DEFAULT_VOLTAGE_LIMIT)
    parser.add_argument("--current-limit", type=float, default=DEFAULT_CURRENT_LIMIT)
    parser.add_argument("--repeat", type=int, default=DEFAULT_REPEAT)
    parser.add_argument("--simulate", action="store_true", help="Use the NI driver simulator")
    args = parser.parse_args()
    values, delays, total_time = load_curve(args.csv)
    if args.repeat < 1:
        raise ValueError("--repeat must be at least 1")

    session_args = {"resource_name": args.resource}
    if args.simulate:
        session_args["options"] = "Simulate=1, DriverSetup=Model:4112"

    with nidcpower.Session(**session_args) as session:
        session.output_function = (nidcpower.OutputFunction.DC_VOLTAGE
                                   if args.mode == "voltage"
                                   else nidcpower.OutputFunction.DC_CURRENT)
        session.source_mode = nidcpower.SourceMode.SEQUENCE
        if args.mode == "voltage":
            session.voltage_level_autorange = True
            session.current_limit = args.current_limit
        else:
            session.current_level_autorange = True
            session.voltage_limit = args.voltage_limit
        session.set_sequence(values, delays)
        try:
            session.output_enabled = True
            for cycle in range(args.repeat):
                print(f"Running cycle {cycle + 1}/{args.repeat}: {len(values)} points")
                with session.initiate():
                    time.sleep(total_time)
        finally:
            session.output_enabled = False
            print("Output disabled")


if __name__ == "__main__":
    main()

CSV → PXI 电源运行

本页负责准备文件;硬件动作由本机脚本执行。

  1. 1

    下载 CSV 和 Python 脚本,确认资源名、输出范围、负载和保护限值。

  2. 2

    在安装 NI-DCPower 的本机执行 python run_ni_4112.py --resource PXI1Slot2/0 --csv curve.csv

  3. 3

    脚本使用 PXI 可编程电源的 simple sequence,在每轮结束后关闭输出;可先加 --simulate 做驱动连通性检查。

依赖:NI-DCPower 驱动、Python nidcpower 包。浏览器不会直接打开本机 NI 仪器。
输出安全提示

请确认 PXI 可编程电源的资源名、量程、负载、电流限制和电压限制。生成或下载文件不会产生实际输出,执行脚本前请连接并确认正确的仪器。

账户

收藏夹

还没有收藏的工具

在线状态

后端服务离线
SatNOGS离线

同步: N/A

更新时间: N/A

Space-Track离线

同步: N/A

更新时间: N/A

Broadcast Ephemeris离线

同步: N/A

更新时间: N/A

Global Ionosphere Map离线

同步: N/A

更新时间: N/A

Earth Loading Atmosphere离线

同步: N/A

更新时间: N/A

NASA DONKI离线

同步: N/A

更新时间: N/A

查看 15 天同步历史

最近使用

暂无记录

网站信息

213+

在线工具

10K+

月访问量

99%+

可用性