Skip to content

Commit

Permalink
Pick up new metadata for mioDAQ configurable digital voltage feature
Browse files Browse the repository at this point in the history
Signed-off-by: Siu Fong Tan <siu.fong.tan@ni.com>
  • Loading branch information
SiuFong-NI committed Nov 5, 2024
1 parent ba8a962 commit 240a481
Show file tree
Hide file tree
Showing 6 changed files with 417 additions and 12 deletions.
6 changes: 6 additions & 0 deletions generated/nidaqmx/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,7 @@ class LoggingOperation(Enum):


class LogicFamily(Enum):
ONE_POINT_EIGHT_V = 16184 #: Compatible with 1.8 V CMOS signals.
TWO_POINT_FIVE_V = 14620 #: Compatible with 2.5 V CMOS signals.
THREE_POINT_THREE_V = 14621 #: Compatible with LVTTL signals.
FIVE_V = 14619 #: Compatible with TTL and 5 V CMOS signals.
Expand Down Expand Up @@ -473,6 +474,11 @@ class PowerOutputState(Enum):
OUTPUT_DISABLED = 15503 #: Power output is disabled.


class PowerUnits(Enum):
WATTS = 16203 #: Watts.
FROM_CUSTOM_SCALE = 10065 #: Units a custom scale specifies. If you select this value, you must specify a custom scale name.


class PowerUpChannelType(Enum):
CHANNEL_VOLTAGE = 0 #: Voltage Channel
CHANNEL_CURRENT = 1 #: Current Channel
Expand Down
7 changes: 7 additions & 0 deletions generated/nidaqmx/error_codes.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@


class DAQmxErrors(IntEnum):
ATTR_NOT_SUPPORTED_USE_PHYSICAL_CHANNEL_PROPERTY = -209896
AI_CALCULATED_POWER_MIN_MAX_ATTR_NOT_SUPPORTED = -209895
AI_MIN_MAX_ATTR_WRITE_NOT_SUPPORTED_FOR_CALC_POWER = -209894
POWER_VOLTAGE_AND_CURRENT_CONFIGURATION_MISMATCH = -209893
VOLTAGE_AND_CURRENT_CHANNELS_NOT_SAME_DEVICE = -209892
VOLTAGE_AND_CURRENT_CHANNEL_COUNT_MISMATCH = -209891
BREAKPOINT_MODES_INCONSISTENT = -209890
NEEDS_USB_SUPER_SPEED = -209889
REMOTE_SENSE = -209888
OVER_TEMPERATURE_PROTECTION_ACTIVATED = -209887
Expand Down
49 changes: 48 additions & 1 deletion generated/nidaqmx/system/physical_channel.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from nidaqmx._bitfield_utils import enum_bitfield_to_list
from nidaqmx.utils import unflatten_channel_string
from nidaqmx.constants import (
AOPowerUpOutputBehavior, AcquisitionType, SensorPowerType,
AOPowerUpOutputBehavior, AcquisitionType, LogicFamily, SensorPowerType,
TerminalConfiguration, UsageTypeAI, UsageTypeAO, UsageTypeCI, UsageTypeCO,
WriteBasicTEDSOptions, _TermCfg)

Expand Down Expand Up @@ -507,6 +507,53 @@ def di_samp_modes(self):
val = self._interpreter.get_physical_chan_attribute_int32_array(self._name, 0x2fe0)
return [AcquisitionType(e) for e in val]

@property
def dig_port_logic_family(self):
"""
:class:`nidaqmx.constants.LogicFamily`: Specifies the digital
port logic family to use for acquisition and generation. A
logic family corresponds to voltage thresholds that are
compatible with a group of voltage standards. Refer to the
device documentation for information on the logic high and
logic low voltages for these logic families.
"""

val = self._interpreter.get_physical_chan_attribute_int32(self._name, 0x31eb)
return LogicFamily(val)

@dig_port_logic_family.setter
def dig_port_logic_family(self, val):
from nidaqmx._library_interpreter import LibraryInterpreter
from nidaqmx._lib import lib_importer, ctypes_byte_str, c_bool32
if not isinstance(self._interpreter, LibraryInterpreter):
raise NotImplementedError
val = val.value
cfunc = lib_importer.windll.DAQmxSetPhysicalChanDigPortLogicFamily
if cfunc.argtypes is None:
with cfunc.arglock:
if cfunc.argtypes is None:
cfunc.argtypes = [
ctypes_byte_str, ctypes.c_int]
error_code = cfunc(
self._name, val)
self._interpreter.check_for_error(error_code)

@dig_port_logic_family.deleter
def dig_port_logic_family(self):
from nidaqmx._library_interpreter import LibraryInterpreter
from nidaqmx._lib import lib_importer, ctypes_byte_str, c_bool32
if not isinstance(self._interpreter, LibraryInterpreter):
raise NotImplementedError
cfunc = lib_importer.windll.DAQmxResetPhysicalChanDigPortLogicFamily
if cfunc.argtypes is None:
with cfunc.arglock:
if cfunc.argtypes is None:
cfunc.argtypes = [
ctypes_byte_str]
error_code = cfunc(
self._name)
self._interpreter.check_for_error(error_code)

@property
def do_port_width(self):
"""
Expand Down
124 changes: 114 additions & 10 deletions generated/nidaqmx/task/channels/_ai_channel.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,15 @@
ExcitationVoltageOrCurrent, FilterResponse, FilterType,
ForceIEPESensorSensitivityUnits, ForceUnits, FrequencyUnits, Impedance1,
InputDataTransferCondition, LVDTSensitivityUnits, LengthUnits,
PowerIdleOutputBehavior, PowerOutputState, PressureUnits, RTDType,
RVDTSensitivityUnits, RawDataCompressionType, ResistanceConfiguration,
ResistanceUnits, ResolutionType, ScaleType, Sense, SensorPowerCfg,
SensorPowerType, ShuntCalSelect, SoundPressureUnits, SourceSelection,
StrainGageBridgeType, StrainGageRosetteMeasurementType,
StrainGageRosetteType, StrainUnits, TemperatureUnits,
TerminalConfiguration, ThermocoupleType, TorqueUnits, UsageTypeAI,
VelocityIEPESensorSensitivityUnits, VelocityUnits, VoltageUnits)
PowerIdleOutputBehavior, PowerOutputState, PowerUnits, PressureUnits,
RTDType, RVDTSensitivityUnits, RawDataCompressionType,
ResistanceConfiguration, ResistanceUnits, ResolutionType, ScaleType,
Sense, SensorPowerCfg, SensorPowerType, ShuntCalSelect,
SoundPressureUnits, SourceSelection, StrainGageBridgeType,
StrainGageRosetteMeasurementType, StrainGageRosetteType, StrainUnits,
TemperatureUnits, TerminalConfiguration, ThermocoupleType, TorqueUnits,
UsageTypeAI, VelocityIEPESensorSensitivityUnits, VelocityUnits,
VoltageUnits)


class AIChannel(Channel):
Expand Down Expand Up @@ -882,6 +883,90 @@ def ai_bridge_units(self, val):
def ai_bridge_units(self):
self._interpreter.reset_chan_attribute(self._handle, self._name, 0x2f92)

@property
def ai_calculated_power_current_max(self):
"""
float: Specifies the current maximum value you expect to
measure. This value is in the units you specify with a units
property. When you query this property, it returns the
coerced current maximum value that the device can measure
with the current settings.
"""

val = self._interpreter.get_chan_attribute_double(self._handle, self._name, 0x31ef)
return val

@ai_calculated_power_current_max.setter
def ai_calculated_power_current_max(self, val):
self._interpreter.set_chan_attribute_double(self._handle, self._name, 0x31ef, val)

@ai_calculated_power_current_max.deleter
def ai_calculated_power_current_max(self):
self._interpreter.reset_chan_attribute(self._handle, self._name, 0x31ef)

@property
def ai_calculated_power_current_min(self):
"""
float: Specifies the current minimum value you expect to
measure. This value is in the units you specify with a units
property. When you query this property, it returns the
coerced current minimum value that the device can measure
with the current settings.
"""

val = self._interpreter.get_chan_attribute_double(self._handle, self._name, 0x31f0)
return val

@ai_calculated_power_current_min.setter
def ai_calculated_power_current_min(self, val):
self._interpreter.set_chan_attribute_double(self._handle, self._name, 0x31f0, val)

@ai_calculated_power_current_min.deleter
def ai_calculated_power_current_min(self):
self._interpreter.reset_chan_attribute(self._handle, self._name, 0x31f0)

@property
def ai_calculated_power_voltage_max(self):
"""
float: Specifies the voltage maximum value you expect to
measure. This value is in the units you specify with a units
property. When you query this property, it returns the
coerced voltage maximum value that the device can measure
with the current settings.
"""

val = self._interpreter.get_chan_attribute_double(self._handle, self._name, 0x31ed)
return val

@ai_calculated_power_voltage_max.setter
def ai_calculated_power_voltage_max(self, val):
self._interpreter.set_chan_attribute_double(self._handle, self._name, 0x31ed, val)

@ai_calculated_power_voltage_max.deleter
def ai_calculated_power_voltage_max(self):
self._interpreter.reset_chan_attribute(self._handle, self._name, 0x31ed)

@property
def ai_calculated_power_voltage_min(self):
"""
float: Specifies the voltage minimum value you expect to
measure. This value is in the units you specify with a units
property. When you query this property, it returns the
coerced voltage minimum value that the device can measure
with the current settings.
"""

val = self._interpreter.get_chan_attribute_double(self._handle, self._name, 0x31ee)
return val

@ai_calculated_power_voltage_min.setter
def ai_calculated_power_voltage_min(self, val):
self._interpreter.set_chan_attribute_double(self._handle, self._name, 0x31ee, val)

@ai_calculated_power_voltage_min.deleter
def ai_calculated_power_voltage_min(self):
self._interpreter.reset_chan_attribute(self._handle, self._name, 0x31ee)

@property
def ai_charge_units(self):
"""
Expand Down Expand Up @@ -2410,6 +2495,25 @@ def ai_power_supply_fault_detect_enable(self, val):
def ai_power_supply_fault_detect_enable(self):
self._interpreter.reset_chan_attribute(self._handle, self._name, 0x3191)

@property
def ai_power_units(self):
"""
:class:`nidaqmx.constants.PowerUnits`: Specifies the units to
use to return power measurements from the channel.
"""

val = self._interpreter.get_chan_attribute_int32(self._handle, self._name, 0x31ec)
return PowerUnits(val)

@ai_power_units.setter
def ai_power_units(self, val):
val = val.value
self._interpreter.set_chan_attribute_int32(self._handle, self._name, 0x31ec, val)

@ai_power_units.deleter
def ai_power_units(self):
self._interpreter.reset_chan_attribute(self._handle, self._name, 0x31ec)

@property
def ai_pressure_units(self):
"""
Expand Down Expand Up @@ -3563,8 +3667,8 @@ def pwr_remote_sense(self):
"""
:class:`nidaqmx.constants.Sense`: Specifies whether to use local
or remote sense to sense the output voltage. DAQmx Read
(Power) will return remote or local voltage based on the
Remote Sense attribute value. Reading this property will
(Power Supply) will return remote or local voltage based on
the Remote Sense attribute value. Reading this property will
return the user-defined value.
"""

Expand Down
Loading

0 comments on commit 240a481

Please sign in to comment.