Skip to content
Merged
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ All notable changes to this project will be documented in this file.

* ### Major Changes
* Removed support for Python 3.9.
* Add support for create calculated power channel API.

* ### Known Issues
* ...
Expand Down
8 changes: 8 additions & 0 deletions generated/nidaqmx/_base_interpreter.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,14 @@ def create_ai_bridge_chan(
voltage_excit_val, nominal_bridge_resistance, custom_scale_name):
raise NotImplementedError

@abc.abstractmethod
def create_ai_calculated_power_chan(
self, task, voltage_physical_channel, current_physical_channel,
name_to_assign_to_channel, terminal_config, voltage_min_val,
voltage_max_val, current_min_val, current_max_val, units,
shunt_resistor_loc, ext_shunt_resistor_val, custom_scale_name):
raise NotImplementedError

@abc.abstractmethod
def create_ai_charge_chan(
self, task, physical_channel, name_to_assign_to_channel,
Expand Down
20 changes: 20 additions & 0 deletions generated/nidaqmx/_grpc_interpreter.py
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,26 @@ def create_ai_bridge_chan(
nominal_bridge_resistance=nominal_bridge_resistance,
custom_scale_name=custom_scale_name))

def create_ai_calculated_power_chan(
self, task, voltage_physical_channel, current_physical_channel,
name_to_assign_to_channel, terminal_config, voltage_min_val,
voltage_max_val, current_min_val, current_max_val, units,
shunt_resistor_loc, ext_shunt_resistor_val, custom_scale_name):
response = self._invoke(
self._client.CreateAICalculatedPowerChan,
grpc_types.CreateAICalculatedPowerChanRequest(
task=task, voltage_physical_channel=voltage_physical_channel,
current_physical_channel=current_physical_channel,
name_to_assign_to_channel=name_to_assign_to_channel,
terminal_config_raw=terminal_config,
voltage_min_val=voltage_min_val,
voltage_max_val=voltage_max_val,
current_min_val=current_min_val,
current_max_val=current_max_val, units_raw=units,
shunt_resistor_loc_raw=shunt_resistor_loc,
ext_shunt_resistor_val=ext_shunt_resistor_val,
custom_scale_name=custom_scale_name))

def create_ai_charge_chan(
self, task, physical_channel, name_to_assign_to_channel,
terminal_config, min_val, max_val, units, custom_scale_name):
Expand Down
23 changes: 23 additions & 0 deletions generated/nidaqmx/_library_interpreter.py
Original file line number Diff line number Diff line change
Expand Up @@ -685,6 +685,29 @@ def create_ai_bridge_chan(
voltage_excit_val, nominal_bridge_resistance, custom_scale_name)
self.check_for_error(error_code)

def create_ai_calculated_power_chan(
self, task, voltage_physical_channel, current_physical_channel,
name_to_assign_to_channel, terminal_config, voltage_min_val,
voltage_max_val, current_min_val, current_max_val, units,
shunt_resistor_loc, ext_shunt_resistor_val, custom_scale_name):
cfunc = lib_importer.windll.DAQmxCreateAICalculatedPowerChan
if cfunc.argtypes is None:
with cfunc.arglock:
if cfunc.argtypes is None:
cfunc.argtypes = [
lib_importer.task_handle, ctypes_byte_str,
ctypes_byte_str, ctypes_byte_str, ctypes.c_int,
ctypes.c_double, ctypes.c_double, ctypes.c_double,
ctypes.c_double, ctypes.c_int, ctypes.c_int,
ctypes.c_double, ctypes_byte_str]

error_code = cfunc(
task, voltage_physical_channel, current_physical_channel,
name_to_assign_to_channel, terminal_config, voltage_min_val,
voltage_max_val, current_min_val, current_max_val, units,
shunt_resistor_loc, ext_shunt_resistor_val, custom_scale_name)
self.check_for_error(error_code)

def create_ai_charge_chan(
self, task, physical_channel, name_to_assign_to_channel,
terminal_config, min_val, max_val, units, custom_scale_name):
Expand Down
4,276 changes: 2,141 additions & 2,135 deletions generated/nidaqmx/_stubs/nidaqmx_pb2.py

Large diffs are not rendered by default.

134 changes: 133 additions & 1 deletion generated/nidaqmx/_stubs/nidaqmx_pb2.pyi

Large diffs are not rendered by default.

33 changes: 33 additions & 0 deletions generated/nidaqmx/_stubs/nidaqmx_pb2_grpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,11 @@ def __init__(self, channel):
request_serializer=nidaqmx__pb2.CreateAIBridgeChanRequest.SerializeToString,
response_deserializer=nidaqmx__pb2.CreateAIBridgeChanResponse.FromString,
)
self.CreateAICalculatedPowerChan = channel.unary_unary(
'/nidaqmx_grpc.NiDAQmx/CreateAICalculatedPowerChan',
request_serializer=nidaqmx__pb2.CreateAICalculatedPowerChanRequest.SerializeToString,
response_deserializer=nidaqmx__pb2.CreateAICalculatedPowerChanResponse.FromString,
)
self.CreateAIChargeChan = channel.unary_unary(
'/nidaqmx_grpc.NiDAQmx/CreateAIChargeChan',
request_serializer=nidaqmx__pb2.CreateAIChargeChanRequest.SerializeToString,
Expand Down Expand Up @@ -2483,6 +2488,12 @@ def CreateAIBridgeChan(self, request, context):
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')

def CreateAICalculatedPowerChan(self, request, context):
"""Missing associated documentation comment in .proto file."""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')

def CreateAIChargeChan(self, request, context):
"""Missing associated documentation comment in .proto file."""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
Expand Down Expand Up @@ -5123,6 +5134,11 @@ def add_NiDAQmxServicer_to_server(servicer, server):
request_deserializer=nidaqmx__pb2.CreateAIBridgeChanRequest.FromString,
response_serializer=nidaqmx__pb2.CreateAIBridgeChanResponse.SerializeToString,
),
'CreateAICalculatedPowerChan': grpc.unary_unary_rpc_method_handler(
servicer.CreateAICalculatedPowerChan,
request_deserializer=nidaqmx__pb2.CreateAICalculatedPowerChanRequest.FromString,
response_serializer=nidaqmx__pb2.CreateAICalculatedPowerChanResponse.SerializeToString,
),
'CreateAIChargeChan': grpc.unary_unary_rpc_method_handler(
servicer.CreateAIChargeChan,
request_deserializer=nidaqmx__pb2.CreateAIChargeChanRequest.FromString,
Expand Down Expand Up @@ -7831,6 +7847,23 @@ def CreateAIBridgeChan(request,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

@staticmethod
def CreateAICalculatedPowerChan(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/nidaqmx_grpc.NiDAQmx/CreateAICalculatedPowerChan',
nidaqmx__pb2.CreateAICalculatedPowerChanRequest.SerializeToString,
nidaqmx__pb2.CreateAICalculatedPowerChanResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

@staticmethod
def CreateAIChargeChan(request,
target,
Expand Down
19 changes: 18 additions & 1 deletion generated/nidaqmx/_stubs/nidaqmx_pb2_grpc.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
@generated by mypy-protobuf. Do not edit manually!
isort:skip_file
---------------------------------------------------------------------
This file is generated from NI-DAQMX API metadata version 23.0.0
This file is generated from NI-DAQMX API metadata version 26.0.0
---------------------------------------------------------------------
Proto file for the NI-DAQMX Metadata
---------------------------------------------------------------------
Expand Down Expand Up @@ -219,6 +219,11 @@ class NiDAQmxStub:
nidaqmx_pb2.CreateAIBridgeChanResponse,
]

CreateAICalculatedPowerChan: grpc.UnaryUnaryMultiCallable[
nidaqmx_pb2.CreateAICalculatedPowerChanRequest,
nidaqmx_pb2.CreateAICalculatedPowerChanResponse,
]

CreateAIChargeChan: grpc.UnaryUnaryMultiCallable[
nidaqmx_pb2.CreateAIChargeChanRequest,
nidaqmx_pb2.CreateAIChargeChanResponse,
Expand Down Expand Up @@ -2450,6 +2455,11 @@ class NiDAQmxAsyncStub:
nidaqmx_pb2.CreateAIBridgeChanResponse,
]

CreateAICalculatedPowerChan: grpc.aio.UnaryUnaryMultiCallable[
nidaqmx_pb2.CreateAICalculatedPowerChanRequest,
nidaqmx_pb2.CreateAICalculatedPowerChanResponse,
]

CreateAIChargeChan: grpc.aio.UnaryUnaryMultiCallable[
nidaqmx_pb2.CreateAIChargeChanRequest,
nidaqmx_pb2.CreateAIChargeChanResponse,
Expand Down Expand Up @@ -4759,6 +4769,13 @@ class NiDAQmxServicer(metaclass=abc.ABCMeta):
context: _ServicerContext,
) -> typing.Union[nidaqmx_pb2.CreateAIBridgeChanResponse, collections.abc.Awaitable[nidaqmx_pb2.CreateAIBridgeChanResponse]]: ...

@abc.abstractmethod
def CreateAICalculatedPowerChan(
self,
request: nidaqmx_pb2.CreateAICalculatedPowerChanRequest,
context: _ServicerContext,
) -> typing.Union[nidaqmx_pb2.CreateAICalculatedPowerChanResponse, collections.abc.Awaitable[nidaqmx_pb2.CreateAICalculatedPowerChanResponse]]: ...

@abc.abstractmethod
def CreateAIChargeChan(
self,
Expand Down
7 changes: 7 additions & 0 deletions generated/nidaqmx/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -479,6 +479,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 Expand Up @@ -773,6 +778,8 @@ class ThermocoupleType(Enum):
T = 10086 #: T-type thermocouple.
B = 10047 #: B-type thermocouple.
E = 10055 #: E-type thermocouple.
A = 16208 #: A-type thermocouple.
C = 16209 #: C-type thermocouple.


class TimeUnits(Enum):
Expand Down
120 changes: 112 additions & 8 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
Loading
Loading