在 LabVIEW 中动态改变直流电源的电压或电流水平

更新 Mar 31, 2025

适用于

硬件

  • PXIe-4113
  • PXI-4110
  • PXIe-4112
  • PXI-4116
  • PXIe-4118
  • PXI-4130
  • PXI-4132
  • PXIe-4133
  • PXIe-4135
  • PXIe-4136
  • PXIe-4137
  • PXIe-4138
  • PXIe-4140
  • PXIe-4141
  • PXIe-4142
  • PXIe-4143
  • PXIe-4144
  • PXIe-4145
  • PXIe-4147
  • PXIe-4190

驱动

  • NI-DCPower

问题详述

我正在尝试创建一个 LabVIEW 应用程序。在程序中,我可以通过一些配置,让它在后台可以动态地设定电压或电流大小,并且能够向它即时地发送指令并改变输出的大小。

另外,我在LabVIEW Example Finder 中找到的示例都是在重置和关闭会话之前只输出了一个电压或电流值。是否可以动态调整电压或电流水平,并在重置和关闭会话之前让设备输出不同的电压或电流?

解决方案

是的,电源的电压和电流水平可以在设备运行时动态重新配置。

在 LabVIEW 中,可以使用niDCPower Voltage Level和niDCPower Current Level属性节点或 NI DCPOWER 函数面板中的niDCPower Configure Voltage LevelniDCPower Configure Current Level VI 来更改这些电平值。

除此之外,ni-DCPower还有一些其他的动态重配置参数,具体可参照特定设备支持的VI或者属性。下表列举了部分支持的VI和函数。具体信息可以参照此链接

VIFunction
niDCPower Configure Voltage LevelniDCPower_ConfigureVoltageLevel
niDCPower Configure Voltage Level RangeniDCPower_ConfigureVoltageLevelRange
niDCPower Configure Voltage LimitniDCPower_ConfigureVoltageLimit
niDCPower Configure Voltage Limit RangeniDCPower_ConfigureVoltageLimitRange
niDCPower Configure Current LevelniDCPower_ConfigureCurrentLevel
niDCPower Configure Current Level RangeniDCPower_ConfigureCurrentLevelRange
niDCPower Configure Current LimitniDCPower_ConfigureCurrentLimit
niDCPower Configure Current Limit RangeniDCPower_ConfigureCurrentLimitRange
niDCPower Configure Output EnabledniDCPower_ConfigureOutputEnabled

 

相关信息

针对动态重配置的一些建议:

  • 可以将动态重配置嵌套在 While 循环中的事件结构,该循环持续检查电压或电流电平控制的变化。控件值的变化可以触发事件结构。该结构再使用属性节点或 VI 配置电压或电流,并反映改动后的电压、电流新值。
  • 您也可以在其中使用功能全局变量 (FGV) 来存储和传递仪器的会话句柄。会话启动后,您可以在仪表运行中来调用 FGV 改变电压或者电流属性节点/ VI的值,从而改变仪器的电压或电流水平。如使用此方法,请确保在 VI 终止执行前重置并关闭仪器会话。