From 8312d669a8aedb52a9c9696e695fa800e3167471 Mon Sep 17 00:00:00 2001 From: Siu Fong Tan Date: Wed, 4 Dec 2024 20:45:45 -0600 Subject: [PATCH 1/2] Add unit test cases for physical property access using mioDAQ --- .../system/test_physical_channel_properties.py | 17 ++++++++++++++++- tests/max_config/nidaqmxMaxConfig.ini | 7 +++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/tests/component/system/test_physical_channel_properties.py b/tests/component/system/test_physical_channel_properties.py index 8560413bd..ce03b61c4 100644 --- a/tests/component/system/test_physical_channel_properties.py +++ b/tests/component/system/test_physical_channel_properties.py @@ -2,7 +2,7 @@ import pytest from nidaqmx import DaqError -from nidaqmx.constants import TerminalConfiguration, UsageTypeAI +from nidaqmx.constants import LogicFamily, TerminalConfiguration, UsageTypeAI from nidaqmx.error_codes import DAQmxErrors from nidaqmx.system import PhysicalChannel from tests.helpers import configure_teds @@ -83,6 +83,21 @@ def test___physical_channel_with_teds___get_uint32_property___returns_configured assert phys_chan.teds_mfg_id == 17 +def test___physical_channel___get_int32_property___returns_value(): + phys_chans = PhysicalChannel("mioDAQ/port0") + + assert phys_chans.dig_port_logic_family in LogicFamily + + +@pytest.mark.library_only( + reason="gRPC interpreter doesn't support setting physical channel property." +) +def test___physical_channel___set_int32_property___success(): + phys_chans = PhysicalChannel("mioDAQ/port0") + + phys_chans.dig_port_logic_family = LogicFamily.ONE_POINT_EIGHT_V + + VALUES_IN_TED = [ 17, 64, diff --git a/tests/max_config/nidaqmxMaxConfig.ini b/tests/max_config/nidaqmxMaxConfig.ini index e2eab77c0..11c2dc03a 100644 --- a/tests/max_config/nidaqmxMaxConfig.ini +++ b/tests/max_config/nidaqmxMaxConfig.ini @@ -293,3 +293,10 @@ DevSerialNum = 0x0 DevIsSimulated = 1 CompactDAQ.ChassisDevName = cdaqChassisTester CompactDAQ.SlotNum = 5 + +[DAQmxDevice mioDAQ] +ProductType = USB-6423 +DevSerialNum = 0x0 +DevIsSimulated = 1 +ProductNum = 0x7B40 +BusType = USB From 9c5e983746d927f3640207883ff9a783b86309b1 Mon Sep 17 00:00:00 2001 From: Siu Fong Tan Date: Tue, 10 Dec 2024 20:18:44 -0600 Subject: [PATCH 2/2] Add azdo work item --- tests/component/system/test_physical_channel_properties.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/component/system/test_physical_channel_properties.py b/tests/component/system/test_physical_channel_properties.py index ce03b61c4..267efd3c7 100644 --- a/tests/component/system/test_physical_channel_properties.py +++ b/tests/component/system/test_physical_channel_properties.py @@ -90,7 +90,7 @@ def test___physical_channel___get_int32_property___returns_value(): @pytest.mark.library_only( - reason="gRPC interpreter doesn't support setting physical channel property." + reason="AB#2375679: gRPC interpreter doesn't support setting physical channel property." ) def test___physical_channel___set_int32_property___success(): phys_chans = PhysicalChannel("mioDAQ/port0")