Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pick up new metadata for mioDAQ configurable digital voltage feature #653

Merged
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 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
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
4 changes: 2 additions & 2 deletions generated/nidaqmx/task/channels/_ai_channel.py
Original file line number Diff line number Diff line change
Expand Up @@ -3563,8 +3563,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
27 changes: 26 additions & 1 deletion src/codegen/metadata/attributes.py
Original file line number Diff line number Diff line change
Expand Up @@ -16922,7 +16922,7 @@
'name': 'PWR_REMOTE_SENSE',
'python_class_name': 'AIChannel',
'python_data_type': 'Sense',
'python_description': '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 return the user-defined value.',
'python_description': 'Specifies whether to use local or remote sense to sense the output voltage. DAQmx Read (Power Supply) will return remote or local voltage based on the Remote Sense attribute value. Reading this property will return the user-defined value.',
'resettable': True,
'type': 'int32'
}
Expand Down Expand Up @@ -22572,6 +22572,31 @@
'python_name': 'ai_sensor_power_overcurrent',
'resettable': False,
'type': 'bool32'
},
12779: {
'access': 'read-write',
'c_function_name': 'PhysicalChanDigPortLogicFamily',
'calling_convention': 'StdCall',
'ctypes_data_type': 'ctypes.c_int',
'enum': 'LogicFamily',
'handle_parameters': {
'genericNameHandle': {
'accessor': 'self._name',
'ctypes_data_type': 'ctypes.c_char_p',
'cvi_name': 'name'
}
},
'has_explicit_read_buffer_size': False,
'has_explicit_write_buffer_size': False,
'is_list': False,
'is_python_object': False,
'name': 'PHYSICAL_CHAN_DIG_PORT_LOGIC_FAMILY',
'python_class_name': 'PhysicalChannel',
'python_data_type': 'LogicFamily',
'python_description': '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.',
'python_name': 'dig_port_logic_family',
'resettable': True,
'type': 'int32'
}
},
'Read': {
Expand Down
57 changes: 57 additions & 0 deletions src/codegen/metadata/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -1484,6 +1484,55 @@
},
'DAQmxErrors': {
'values': [
{
'documentation': {
'description': ' '
},
'name': 'ATTR_NOT_SUPPORTED_USE_PHYSICAL_CHANNEL_PROPERTY',
'value': -209896
},
{
'documentation': {
'description': ' '
},
'name': 'AI_CALCULATED_POWER_MIN_MAX_ATTR_NOT_SUPPORTED',
'value': -209895
},
{
'documentation': {
'description': ' '
},
'name': 'AI_MIN_MAX_ATTR_WRITE_NOT_SUPPORTED_FOR_CALC_POWER',
'value': -209894
},
{
'documentation': {
'description': ' '
},
'name': 'POWER_VOLTAGE_AND_CURRENT_CONFIGURATION_MISMATCH',
'value': -209893
},
{
'documentation': {
'description': ' '
},
'name': 'VOLTAGE_AND_CURRENT_CHANNELS_NOT_SAME_DEVICE',
'value': -209892
},
{
'documentation': {
'description': ' '
},
'name': 'VOLTAGE_AND_CURRENT_CHANNEL_COUNT_MISMATCH',
'value': -209891
},
{
'documentation': {
'description': ' '
},
'name': 'BREAKPOINT_MODES_INCONSISTENT',
'value': -209890
},
{
'documentation': {
'description': ' '
Expand Down Expand Up @@ -15887,6 +15936,14 @@
},
'LogicFamily': {
'values': [
{
'documentation': {
'description': 'Compatible with 1.8 V CMOS signals.'
},
'name': '1POINT_8_V',
'python_name': 'ONE_POINT_EIGHT_V',
'value': 16184
},
{
'documentation': {
'description': 'Compatible with 2.5 V CMOS signals.'
Expand Down
Loading