From 08fc91ae565beb32dda986ddc1736eee1dcaef6a Mon Sep 17 00:00:00 2001 From: Mark Silva Date: Thu, 29 Aug 2019 16:50:40 -0500 Subject: [PATCH 01/56] Add initial metadata --- src/nitclk/metadata/__init__.py | 19 + src/nitclk/metadata/attributes.py | 147 +++ src/nitclk/metadata/attributes_addon.py | 18 + src/nitclk/metadata/config.py | 40 + src/nitclk/metadata/config_addon.py | 5 + src/nitclk/metadata/enums.py | 4 + src/nitclk/metadata/enums_addon.py | 14 + src/nitclk/metadata/functions.py | 1177 +++++++++++++++++++++++ src/nitclk/metadata/functions_addon.py | 53 + 9 files changed, 1477 insertions(+) create mode 100644 src/nitclk/metadata/__init__.py create mode 100644 src/nitclk/metadata/attributes.py create mode 100644 src/nitclk/metadata/attributes_addon.py create mode 100644 src/nitclk/metadata/config.py create mode 100644 src/nitclk/metadata/config_addon.py create mode 100644 src/nitclk/metadata/enums.py create mode 100644 src/nitclk/metadata/enums_addon.py create mode 100644 src/nitclk/metadata/functions.py create mode 100644 src/nitclk/metadata/functions_addon.py diff --git a/src/nitclk/metadata/__init__.py b/src/nitclk/metadata/__init__.py new file mode 100644 index 000000000..736945551 --- /dev/null +++ b/src/nitclk/metadata/__init__.py @@ -0,0 +1,19 @@ +from metadata.config import config +from metadata.functions import functions +from metadata.attributes import attributes +from metadata.enums import enums +import metadata.functions_addon +import metadata.attributes_addon +import metadata.enums_addon +import metadata.config_addon + +import build.helper as helper +import sys + +# Update generated functions data with hand maintained data +config['modules'] = sys.modules +helper.add_all_metadata(functions, attributes, enums, config) + +__version__ = config['module_version'] + + diff --git a/src/nitclk/metadata/attributes.py b/src/nitclk/metadata/attributes.py new file mode 100644 index 000000000..a7042a702 --- /dev/null +++ b/src/nitclk/metadata/attributes.py @@ -0,0 +1,147 @@ +# -*- coding: utf-8 -*- +# This file is generated from NI-TClk API metadata version 255.0.0d0 +attributes = { + 1: { + 'access': 'read-write', + 'channel_based': False, + 'documentation': { + 'description': "\nSpecifies the Sync Pulse source. This attribute is most often used when synchronizing a multichassis system.\nValues\nEmpty string\nPXI Devices - 'PXI_Trig0' through 'PXI_Trig7' and device-specific settings\nPCI Devices - 'RTSI_0' through 'RTSI_7' and device-specific settings\nExamples of Device-Specific Settings\n- NI PXI-5122 supports 'PFI0' and 'PFI1'\n- NI PXI-5421 supports 'PFI0', 'PFI1', 'PFI2', and 'PFI3'\n- NI PXI-6551/6552 supports 'PFI0', 'PFI1', 'PFI2', and 'PFI3'\nDefault Value - Empty string. This default value directs niTClk_Synchronize to set this attribute when all the synchronized devices are in one PXI chassis. To synchronize a multichassis system, you must set this attribute before calling niTClk_Synchronize.\n" + }, + 'lv_property': 'Sync Pulse Source', + 'name': 'SYNC_PULSE_SOURCE', + 'resettable': False, + 'type': 'ViString' + }, + 2: { + 'access': 'read-write', + 'channel_based': False, + 'documentation': { + 'description': "\nSpecifies the destination of the Sync Pulse. This attribute is most often used when synchronizing a multichassis system.\nValues\nEmpty string. Empty string is a valid value, indicating that the signal is not exported.\nPXI Devices - 'PXI_Trig0' through 'PXI_Trig7' and device-specific settings\nPCI Devices - 'RTSI_0' through 'RTSI_7' and device-specific settings\nExamples of Device-Specific Settings\n- NI PXI-5122 supports 'PFI0' and 'PFI1'\n- NI PXI-5421 supports 'PFI0', 'PFI1', 'PFI4', and 'PFI5'\n- NI PXI-6551/6552 supports 'PFI0', 'PFI1', 'PFI2', and 'PFI3'\nDefault Value is empty string\n" + }, + 'lv_property': 'Export Sync Pulse Output Terminal', + 'name': 'EXPORTED_SYNC_PULSE_OUTPUT_TERMINAL', + 'resettable': False, + 'type': 'ViString' + }, + 3: { + 'access': 'read-write', + 'attribute_class': 'AttributeViInt32SessionReference', + 'channel_based': False, + 'documentation': { + 'description': '\nSpecifies the start trigger master session.\nFor external triggers, the session that originally receives the trigger. For None (no trigger configured) or software triggers, the session that originally generates the trigger.\n' + }, + 'lv_property': 'Start Trigger Master Session', + 'name': 'START_TRIGGER_MASTER_SESSION', + 'resettable': False, + 'type': 'ViInt32', + 'type_in_documentation': 'nimi-python Session class, nitclk.SessionReference, NI-TClk Session Number' + }, + 4: { + 'access': 'read-write', + 'attribute_class': 'AttributeViInt32SessionReference', + 'channel_based': False, + 'documentation': { + 'description': '\nSpecifies the reference trigger master session.\nFor external triggers, the session that originally receives the trigger. For None (no trigger configured) or software triggers, the session that originally generates the trigger.\n' + }, + 'lv_property': 'Reference Trigger Master Session', + 'name': 'REF_TRIGGER_MASTER_SESSION', + 'resettable': False, + 'type': 'ViInt32', + 'type_in_documentation': 'nimi-python Session class, nitclk.SessionReference, NI-TClk Session Number' + }, + 5: { + 'access': 'read-write', + 'attribute_class': 'AttributeViInt32SessionReference', + 'channel_based': False, + 'documentation': { + 'description': '\nSpecifies the script trigger master session.\nFor external triggers, the session that originally receives the trigger. For None (no trigger configured) or software triggers, the session that originally generates the trigger.\n' + }, + 'lv_property': 'Script Trigger Master Session', + 'name': 'SCRIPT_TRIGGER_MASTER_SESSION', + 'resettable': False, + 'type': 'ViInt32', + 'type_in_documentation': 'nimi-python Session class, nitclk.SessionReference, NI-TClk Session Number' + }, + 6: { + 'access': 'read-write', + 'attribute_class': 'AttributeViInt32SessionReference', + 'channel_based': False, + 'documentation': { + 'description': '\nSpecifies the pause trigger master session.\nFor external triggers, the session that originally receives the trigger. For None (no trigger configured) or software triggers, the session that originally generates the trigger.\n' + }, + 'lv_property': 'Pause Trigger Master Session', + 'name': 'PAUSE_TRIGGER_MASTER_SESSION', + 'resettable': False, + 'type': 'ViInt32', + 'type_in_documentation': 'nimi-python Session class, nitclk.SessionReference, NI-TClk Session Number' + }, + 8: { + 'access': 'read only', + 'channel_based': False, + 'documentation': { + 'description': '\nIndicates the computed TClk period that will be used during the acquisition.\n' + }, + 'lv_property': 'Period', + 'name': 'TCLK_ACTUAL_PERIOD', + 'resettable': False, + 'type': 'ViReal64', + }, + 9: { + 'access': 'read-write', + 'channel_based': False, + 'documentation': { + 'description': "\nSpecifies the destination of the device's TClk signal.\nValues\nEmpty string. Empty string is a valid value, indicating that the signal is not exported.\nPXI Devices - 'PXI_Trig0' through 'PXI_Trig7' and device-specific settings\nPCI Devices - 'RTSI_0' through 'RTSI_7' and device-specific settings\nExamples of Device-Specific Settings\n- NI PXI-5122 supports 'PFI0' and 'PFI1'\n- NI PXI-5421 supports 'PFI0', 'PFI1', 'PFI4', and 'PFI5'\n- NI PXI-6551/6552 supports 'PFI0', 'PFI1', 'PFI2', and 'PFI3'\nDefault Value is empty string\n" + }, + 'lv_property': 'Output Terminal', + 'name': 'EXPORTED_TCLK_OUTPUT_TERMINAL', + 'resettable': False, + 'type': 'ViString', + }, + 10: { + 'access': 'read-write', + 'channel_based': False, + 'documentation': { + 'description': "\nSpecifies the Sync Pulse Clock source. This attribute is typically used to synchronize PCI devices when you want to control RTSI 7 yourself. Make sure that a 10 MHz clock is driven onto RTSI 7.\nValues\nPCI Devices - 'RTSI_7' and 'None'\nPXI Devices - 'PXI_CLK10' and 'None'\nDefault Value - 'None' directs niTClk_Synchronize to create the necessary routes. For PCI, one of the synchronized devices drives a 10 MHz clock on RTSI 7 unless that line is already being driven.\n" + }, + 'lv_property': 'Sync Pulse Clock Source', + 'name': 'SYNC_PULSE_CLOCK_SOURCE', + 'resettable': False, + 'type': 'ViString' + }, + 11: { + 'access': 'read-write', + 'channel_based': False, + 'documentation': { + 'description': '\nSpecifies the sample clock delay.\nSpecifies the delay, in seconds, to apply to the session sample clock relative to the other synchronized sessions. During synchronization, NI-TClk aligns the sample clocks on the synchronized devices. If you want to delay the sample clocks, set this attribute before calling niTClk_Synchronize.\nnot supported for acquisition sessions.\nValues - Between minus one and plus one period of the sample clock.\nOne sample clock period is equal to (1/sample clock rate). For example, for a session with sample rate of 100 MS/s, you can specify sample clock delays between -10.0 ns and +10.0 ns.\nDefault Value is 0\n', + 'note': 'Sample clock delay is supported for generation sessions only; it is' + }, + 'lv_property': 'Sample Clock Delay', + 'name': 'SAMPLE_CLOCK_DELAY', + 'resettable': False, + 'type': 'ViReal64' + }, + 13: { + 'access': 'read-write', + 'channel_based': False, + 'documentation': { + 'description': "\nSpecifies the external sync pulse source for the Sync Pulse Sender. You can use this source to synchronize the Sync Pulse Sender with an external non-TClk source.\nValues\nEmpty string. Empty string is a valid value, indicating that the signal is not exported.\nPXI Devices - 'PXI_Trig0' through 'PXI_Trig7' and device-specific settings\nPCI Devices - 'RTSI_0' through 'RTSI_7' and device-specific settings\nExamples of Device-Specific Settings\n- NI PXI-5122 supports 'PFI0' and 'PFI1'\n- NI PXI-5421 supports 'PFI0', 'PFI1', 'PFI4', and 'PFI5'\n- NI PXI-6551/6552 supports 'PFI0', 'PFI1', 'PFI2', and 'PFI3'\nDefault Value is empty string\n" + }, + 'lv_property': 'External Pulse Source', + 'name': 'SYNC_PULSE_SENDER_SYNC_PULSE_SOURCE', + 'resettable': False, + 'type': 'ViString' + }, + 16: { + 'access': 'read-write', + 'attribute_class': 'AttributeViInt32SessionReference', + 'channel_based': False, + 'documentation': { + 'description': '\nSpecifies the sequencer flag master session.\nFor external triggers, the session that originally receives the trigger.\nFor None (no trigger configured) or software triggers, the session that\noriginally generates the trigger.\n' + }, + 'lv_property': 'Sequencer Flag Master Session', + 'name': 'SEQUENCER_FLAG_MASTER_SESSION', + 'resettable': False, + 'type': 'ViInt32', + 'type_in_documentation': 'nimi-python Session class, nitclk.SessionReference, NI-TClk Session Number' + } +} diff --git a/src/nitclk/metadata/attributes_addon.py b/src/nitclk/metadata/attributes_addon.py new file mode 100644 index 000000000..395f33212 --- /dev/null +++ b/src/nitclk/metadata/attributes_addon.py @@ -0,0 +1,18 @@ +# These dictionaries are applied to the generated attributes dictionary at build time +# Any changes to the API should be made here. attributes.py is code generated + +# We are not code genning attributes that have been marked as obsolete prior to the initial +# Python API bindings release + +attributes_codegen_method = { +} + +attributes_converters = { +} + +attributes_enums = { +} + +# If the associated enum represents boolean values only, disconnect +attributes_remove_enum = { +} diff --git a/src/nitclk/metadata/config.py b/src/nitclk/metadata/config.py new file mode 100644 index 000000000..5d2b32e0e --- /dev/null +++ b/src/nitclk/metadata/config.py @@ -0,0 +1,40 @@ +# -*- coding: utf-8 -*- +# This file is generated from NI-TClk API metadata version 255.0.0d0 +config = { + 'api_version': '255.0.0d0', + 'c_function_prefix': 'niTClk_', + 'close_function': None, + 'context_manager_name': { + 'abort_function': None, + 'initiate_function': 'Initiate', + 'task': 'acquisition' + }, + 'custom_types': [ + ], + 'driver_name': 'NI-TClk', + 'init_function': 'InitForDocumentation', + 'library_info': { + 'Linux': { + '64bit': { + 'name': 'libnitclk.so', + 'type': 'cdll' + } + }, + 'Windows': { + '32bit': { + 'name': 'nitclk.dll', + 'type': 'windll' + }, + '64bit': { + 'name': 'nitclk_64.dll', + 'type': 'cdll' + } + } + }, + 'metadata_version': '2.0', + 'module_name': 'nitclk', + 'repeated_capabilities': [ + ], + 'session_class_description': 'An NI-TClk session.', + 'session_handle_parameter_name': 'session' +} diff --git a/src/nitclk/metadata/config_addon.py b/src/nitclk/metadata/config_addon.py new file mode 100644 index 000000000..6245f3081 --- /dev/null +++ b/src/nitclk/metadata/config_addon.py @@ -0,0 +1,5 @@ +# We need to maintain the version here since it needs to be updated by the build process on GitHub +config_additional_config = { + 'module_version': '0.1.0.dev0', + 'latest_runtime_version_tested_against': '18.0.0', +} diff --git a/src/nitclk/metadata/enums.py b/src/nitclk/metadata/enums.py new file mode 100644 index 000000000..cecf8a9f4 --- /dev/null +++ b/src/nitclk/metadata/enums.py @@ -0,0 +1,4 @@ +# -*- coding: utf-8 -*- +# This file is generated from NI-TClk API metadata version 255.0.0d0 +enums = { +} diff --git a/src/nitclk/metadata/enums_addon.py b/src/nitclk/metadata/enums_addon.py new file mode 100644 index 000000000..74cd6913c --- /dev/null +++ b/src/nitclk/metadata/enums_addon.py @@ -0,0 +1,14 @@ +# These dictionaries are applied to the generated enums dictionary at build time +# Any changes to the API should be made here. attributes.py is code generated + +# We are not code genning enums that have been marked as obsolete prior to the initial +# Python API bindings release +# We also do not codegen enums associated with P2P or External Calibration since neither +# are supported in Python +enums_codegen_method = { +} + +enums_additional_enums = { +} + + diff --git a/src/nitclk/metadata/functions.py b/src/nitclk/metadata/functions.py new file mode 100644 index 000000000..abca1a5ae --- /dev/null +++ b/src/nitclk/metadata/functions.py @@ -0,0 +1,1177 @@ +# -*- coding: utf-8 -*- +# This file is generated from NI-TClk API metadata version 255.0.0d0 +functions = { + 'AdjustSyncPulseSenderTClkDivisors': { + 'codegen_method': 'no', + 'documentation': { + 'description': 'TBD' + }, + 'parameters': [ + { + 'direction': 'in', + 'name': 'sessionCount', + 'type': 'ViUInt32' + }, + { + 'direction': 'in', + 'name': 'sessions', + 'size': { + 'mechanism': 'TBD', + 'value': 'TBD' + }, + 'type': 'ViSession[]' + }, + { + 'direction': 'in', + 'name': 'tclkAdjustment', + 'type': 'ViReal64' + } + ], + 'returns': 'ViStatus' + }, + 'AdjustSyncPulseSenderTClkTimebase': { + 'codegen_method': 'no', + 'documentation': { + 'description': 'TBD' + }, + 'parameters': [ + { + 'direction': 'in', + 'name': 'sessionCount', + 'type': 'ViUInt32' + }, + { + 'direction': 'in', + 'name': 'sessions', + 'size': { + 'mechanism': 'TBD', + 'value': 'TBD' + }, + 'type': 'ViSession[]' + }, + { + 'direction': 'in', + 'name': 'tclkAdjustment', + 'type': 'ViReal64' + } + ], + 'returns': 'ViStatus' + }, + 'ConfigureForHomogeneousTriggers': { + 'documentation': { + 'description': '\nConfigures the attributes commonly required for the TClk synchronization\nof device sessions with homogeneous triggers in a single PXI chassis or\na single PC. Use niTClk_ConfigureForHomogeneousTriggers to configure\nthe attributes for the reference clocks, start triggers, reference\ntriggers, script triggers, and pause triggers. If\nniTClk_ConfigureForHomogeneousTriggers cannot perform all the steps\nappropriate for the given sessions, it returns an error. If an error is\nreturned, use the instrument driver functions and attributes for signal\nrouting, along with the following NI-TClk attributes:\nNITCLK_ATTR_START_TRIGGER_MASTER_SESSION\nNITCLK_ATTR_REF_TRIGGER_MASTER_SESSION\nNITCLK_ATTR_SCRIPT_TRIGGER_MASTER_SESSION\nNITCLK_ATTR_PAUSE_TRIGGER_MASTER_SESSION\nniTClk_ConfigureForHomogeneousTriggers affects the following clocks and\ntriggers: - Reference clocks - Start triggers - Reference triggers -\nScript triggers - Pause triggers Reference Clocks\nniTClk_ConfigureForHomogeneousTriggers configures the reference clocks\nif they are needed. Specifically, if the internal sample clocks or\ninternal sample clock timebases are used, and the reference clock source\nis not configured--or is set to None (no trigger\nconfigured)--niTClk_ConfigureForHomogeneousTriggers configures the\nfollowing: PXI--The reference clock source on all devices is set to be\nthe 10 MHz PXI backplane clock (PXI_CLK10). PCI--One of the devices\nexports its 10 MHz onboard reference clock to RTSI 7. The reference\nclock source on all devices is set to be RTSI 7. Note: If the reference\nclock source is set to a value other than None,\nniTClk_ConfigureForHomogeneousTriggers cannot configure the reference\nclock source. Start Triggers If the start trigger is set to None (no\ntrigger configured) for all sessions, the sessions are configured to\nshare the start trigger. The start trigger is shared by: - Implicitly\nexporting the start trigger from one session - Configuring the other\nsessions for digital edge start triggers with sources corresponding to\nthe exported start trigger - Setting\nNITCLK_ATTR_START_TRIGGER_MASTER_SESSION to the session that is\nexporting the trigger for all sessions If the start triggers are None\nfor all except one session, niTClk_ConfigureForHomogeneousTriggers\nconfigures the sessions to share the start trigger from the one excepted\nsession. The start trigger is shared by: - Implicitly exporting start\ntrigger from the session with the start trigger that is not None -\nConfiguring the other sessions for digital-edge start triggers with\nsources corresponding to the exported start trigger - Setting\nNITCLK_ATTR_START_TRIGGER_MASTER_SESSION to the session that is\nexporting the trigger for all sessions If start triggers are configured\nfor all sessions, niTClk_ConfigureForHomogeneousTriggers does not\naffect the start triggers. Start triggers are considered to be\nconfigured for all sessions if either of the following conditions is\ntrue: - No session has a start trigger that is None - One session has a\nstart trigger that is None, and all other sessions have start triggers\nother than None. The one session with the None trigger must have\nNITCLK_ATTR_START_TRIGGER_MASTER_SESSION set to itself, indicating\nthat the session itself is the start trigger master Reference Triggers\nniTClk_ConfigureForHomogeneousTriggers configures sessions that support\nreference triggers to share the reference triggers if the reference\ntriggers are None (no trigger configured) for all except one session.\nThe reference triggers are shared by: - Implicitly exporting the\nreference trigger from the session whose reference trigger is not None -\nConfiguring the other sessions that support the reference trigger for\ndigital-edge reference triggers with sources corresponding to the\nexported reference trigger - Setting\nNITCLK_ATTR_REF_TRIGGER_MASTER_SESSION to the session that is\nexporting the trigger for all sessions that support reference trigger If\nthe reference triggers are configured for all sessions that support\nreference triggers, niTClk_ConfigureForHomogeneousTriggers does not\naffect the reference triggers. Reference triggers are considered to be\nconfigured for all sessions if either one or the other of the following\nconditions is true: - No session has a reference trigger that is None -\nOne session has a reference trigger that is None, and all other sessions\nhave reference triggers other than None. The one session with the None\ntrigger must have NITCLK_ATTR_REF_TRIGGER_MASTER_SESSION set to\nitself, indicating that the session itself is the reference trigger\nmaster Reference Trigger Holdoffs Acquisition sessions may be configured\nwith the reference trigger. For acquisition sessions, when the reference\ntrigger is shared, niTClk_ConfigureForHomogeneousTriggers configures\nthe holdoff attributes (which are instrument driver specific) on the\nreference trigger master session so that the session does not recognize\nthe reference trigger before the other sessions are ready. This\ncondition is only relevant when the sample clock rates, sample clock\ntimebase rates, sample counts, holdoffs, and/or any delays for the\nacquisitions are different. When the sample clock rates, sample clock\ntimebase rates, and/or the sample counts are different in acquisition\nsessions sharing the reference trigger, you should also set the holdoff\nattributes for the reference trigger master using the instrument driver.\nScript Triggers niTClk_ConfigureForHomogeneousTriggers configures\nsessions that support script triggers to share them, if the script\ntriggers are None (no trigger configured) for all except one session.\nThe script triggers are shared in the following ways: - Implicitly\nexporting the script trigger from the session whose script trigger is\nnot None - Configuring the other sessions that support the script\ntrigger for digital-edge script triggers with sources corresponding to\nthe exported script trigger - Setting\nNITCLK_ATTR_SCRIPT_TRIGGER_MASTER_SESSION to the session that is\nexporting the trigger for all sessions that support script triggers If\nthe script triggers are configured for all sessions that support script\ntriggers, niTClk_ConfigureForHomogeneousTriggers does not affect script\ntriggers. Script triggers are considered to be configured for all\nsessions if either one or the other of the following conditions are\ntrue: - No session has a script trigger that is None - One session has a\nscript trigger that is None and all other sessions have script triggers\nother than None. The one session with the None trigger must have\nNITCLK_ATTR_SCRIPT_TRIGGER_MASTER_SESSION set to itself, indicating\nthat the session itself is the script trigger master Pause Triggers\nniTClk_ConfigureForHomogeneousTriggers configures generation sessions\nthat support pause triggers to share them, if the pause triggers are\nNone (no trigger configured) for all except one session. The pause\ntriggers are shared by: - Implicitly exporting the pause trigger from\nthe session whose script trigger is not None - Configuring the other\nsessions that support the pause trigger for digital-edge pause triggers\nwith sources corresponding to the exported pause trigger - Setting\nNITCLK_ATTR_PAUSE_TRIGGER_MASTER_SESSION to the session that is\nexporting the trigger for all sessions that support script triggers If\nthe pause triggers are configured for all generation sessions that\nsupport pause triggers, niTClk_ConfigureForHomogeneousTriggers does not\naffect pause triggers. Pause triggers are considered to be configured\nfor all sessions if either one or the other of the following conditions\nis true: - No session has a pause trigger that is None - One session has\na pause trigger that is None and all other sessions have pause triggers\nother than None. The one session with the None trigger must have\nNITCLK_ATTR_PAUSE_TRIGGER_MASTER_SESSION set to itself, indicating\nthat the session itself is the pause trigger master Note: TClk\nsynchronization is not supported for pause triggers on acquisition\nsessions.\n' + }, + 'parameters': [ + { + 'direction': 'in', + 'documentation': { + 'description': 'Number of elements in the sessions array' + }, + 'name': 'sessionCount', + 'type': 'ViUInt32' + }, + { + 'direction': 'in', + 'documentation': { + 'description': 'sessions is an array of sessions that are being synchronized.' + }, + 'python_api_converter_name': 'convert_to_nitclk_session_num_list', + 'name': 'sessions', + 'is_session_handle': False, + 'size': { + 'mechanism': 'len', + 'value': 'sessionCount' + }, + 'type': 'ViSession[]' + } + ], + 'returns': 'ViStatus' + }, + 'CorrespondingCAttrId': { + 'codegen_method': 'no', + 'documentation': { + 'description': 'TBD' + }, + 'parameters': [ + { + 'direction': 'in', + 'name': 'labviewAttrId', + 'type': 'ViUInt32' + } + ], + 'returns': 'ViUInt32' + }, + 'FinishSyncPulseSenderSynchronize': { + 'documentation': { + 'description': 'TBD' + }, + 'parameters': [ + { + 'direction': 'in', + 'documentation': { + 'description': 'Number of elements in the sessions array' + }, + 'name': 'sessionCount', + 'type': 'ViUInt32' + }, + { + 'direction': 'in', + 'documentation': { + 'description': 'sessions is an array of sessions that are being synchronized.' + }, + 'is_session_handle': False, + 'name': 'sessions', + 'python_api_converter_name': 'convert_to_nitclk_session_num_list', + 'size': { + 'mechanism': 'len', + 'value': 'sessionCount' + }, + 'type': 'ViSession[]' + }, + { + 'direction': 'in', + 'documentation': { + 'description': '\nMinimal period of TClk, expressed in seconds. Supported values are\nbetween 0.0 s and 0.050 s (50 ms). Minimal period for a single\nchassis/PC is 200 ns. If the specified value is less than 200 ns,\nNI-TClk automatically coerces minTime to 200 ns. For multichassis\nsynchronization, adjust this value to account for propagation delays\nthrough the various devices and cables.\n' + }, + 'name': 'minTime', + 'type': 'ViReal64' + } + ], + 'returns': 'ViStatus' + }, + 'FinishSyncPulseSenderSynchronizeWithAdjustmentType': { + 'codegen_method': 'no', + 'documentation': { + 'description': 'TBD' + }, + 'parameters': [ + { + 'direction': 'in', + 'name': 'sessionCount', + 'type': 'ViUInt32' + }, + { + 'direction': 'in', + 'name': 'sessions', + 'size': { + 'mechanism': 'TBD', + 'value': 'TBD' + }, + 'type': 'ViSession[]' + }, + { + 'direction': 'in', + 'name': 'minTime', + 'type': 'ViReal64' + }, + { + 'direction': 'in', + 'name': 'adjustmentType', + 'type': 'ViUInt32' + } + ], + 'returns': 'ViStatus' + }, + 'GetAttributeViBoolean': { + 'codegen_method': 'private', + 'documentation': { + 'description': 'TBD' + }, + 'parameters': [ + { + 'direction': 'in', + 'name': 'session', + 'type': 'ViSession' + }, + { + 'direction': 'in', + 'name': 'channelName', + 'type': 'ViConstString' + }, + { + 'direction': 'in', + 'name': 'attributeId', + 'type': 'ViAttr' + }, + { + 'direction': 'out', + 'name': 'value', + 'type': 'ViBoolean' + } + ], + 'returns': 'ViStatus' + }, + 'GetAttributeViReal64': { + 'codegen_method': 'private', + 'documentation': { + 'description': 'Gets the value of an NI-TClk ViReal64 attribute.' + }, + 'parameters': [ + { + 'direction': 'in', + 'documentation': { + 'description': 'session references the sessions being synchronized.' + }, + 'name': 'session', + 'type': 'ViSession' + }, + { + 'direction': 'in', + 'documentation': { + 'description': 'Pass VI_NULL or an empty string' + }, + 'name': 'channelName', + 'type': 'ViConstString' + }, + { + 'direction': 'in', + 'documentation': { + 'description': '\nThe ID of the attribute that you want to get Supported Attribute\nNITCLK_ATTR_SAMPLE_CLOCK_DELAY\n' + }, + 'name': 'attributeId', + 'type': 'ViAttr' + }, + { + 'direction': 'out', + 'documentation': { + 'description': 'The value that you are getting' + }, + 'name': 'value', + 'type': 'ViReal64' + } + ], + 'returns': 'ViStatus' + }, + 'GetAttributeViSession': { + 'codegen_method': 'private', + 'documentation': { + 'description': 'Gets the value of an NI-TClk ViSession attribute.' + }, + 'parameters': [ + { + 'direction': 'in', + 'documentation': { + 'description': 'session references the sessions being synchronized.' + }, + 'name': 'session', + 'type': 'ViSession' + }, + { + 'direction': 'in', + 'documentation': { + 'description': '\nPass VI_NULL or an empty string, except for\nNITCLK_ATTR_SCRIPT_TRIGGER_MASTER_SESSION, for which you should\nspecify scriptTrigger0, scriptTrigger1, scriptTrigger2, or\nscriptTrigger3. VI_NULL and the empty string are treated as\nscriptTrigger0 for NITCLK_ATTR_SCRIPT_TRIGGER_MASTER_SESSION.\n' + }, + 'name': 'channelName', + 'type': 'ViConstString' + }, + { + 'direction': 'in', + 'documentation': { + 'description': '\nThe ID of the attribute that you want to set Supported Attributes\nNITCLK_ATTR_START_TRIGGER_MASTER_SESSION\nNITCLK_ATTR_REF_TRIGGER_MASTER_SESSION\nNITCLK_ATTR_SCRIPT_TRIGGER_MASTER_SESSION\nNITCLK_ATTR_PAUSE_TRIGGER_MASTER_SESSION\n' + }, + 'name': 'attributeId', + 'type': 'ViAttr' + }, + { + 'direction': 'out', + 'documentation': { + 'description': 'The value that you are getting' + }, + 'name': 'value', + 'type': 'ViSession' + } + ], + 'returns': 'ViStatus' + }, + 'GetAttributeViString': { + 'codegen_method': 'private', + 'documentation': { + 'description': '\nThis function queries the value of an NI-TClk ViString attribute. You\nmust provide a ViChar array to serve as a buffer for the value. You pass\nthe number of bytes in the buffer as bufSize. If the current value of\nthe attribute, including the terminating NULL byte, is larger than the\nsize you indicate in bufSize, the function copies bufSize minus 1 bytes\ninto the buffer, places an ASCII NULL byte at the end of the buffer, and\nreturns the array size that you must pass to get the entire value. For\nexample, if the value is "123456" and bufSize is 4, the function places\n"123" into the buffer and returns 7. If you want to call\nniTClk_GetAttributeViString just to get the required array size, pass 0\nfor bufSize and VI_NULL for the value.\n' + }, + 'parameters': [ + { + 'direction': 'in', + 'documentation': { + 'description': 'session references the sessions being synchronized.' + }, + 'name': 'session', + 'type': 'ViSession' + }, + { + 'direction': 'in', + 'documentation': { + 'description': 'Pass VI_NULL or an empty string' + }, + 'name': 'channelName', + 'type': 'ViConstString' + }, + { + 'direction': 'in', + 'documentation': { + 'description': '\nThe ID of the attribute that you want to get Supported Attributes\nNITCLK_ATTR_SYNC_PULSE_SOURCE\nNITCLK_ATTR_SYNC_PULSE_CLOCK_SOURCE\nNITCLK_ATTR_EXPORTED_SYNC_PULSE_OUTPUT_TERMINAL\n' + }, + 'name': 'attributeId', + 'type': 'ViAttr' + }, + { + 'direction': 'in', + 'documentation': { + 'description': '\nThe number of bytes in the ViChar array that you specify for the value\nparameter\n' + }, + 'name': 'bufSize', + 'type': 'ViInt32' + }, + { + 'direction': 'in', + 'documentation': { + 'description': 'The value that you are getting' + }, + 'name': 'value', + 'type': 'ViChar[]' + } + ], + 'returns': 'ViStatus' + }, + 'GetExtendedErrorInfo': { + 'codegen_method': 'private', + 'documentation': { + 'description': '\nReports extended error information for the most recent NI-TClk function\nthat returned an error. To establish the function that returned an\nerror, use the return values of the individual functions because once\nniTClk_GetExtendedErrorInfo reports an errorString, it does not report\nan empty string again.\n' + }, + 'is_error_handling': True, + 'parameters': [ + { + 'direction': 'out', + 'documentation': { + 'description': '\nExtended error description. If errorString is NULL, then it is not large\nenough to hold the entire error description. In this case, the return\nvalue of niTClk_GetExtendedErrorInfo is the size that you should use\nfor niTClk_GetExtendedErrorInfo to return the full error string.\n' + }, + 'name': 'errorString', + 'size': { + 'mechanism': 'ivi-dance', + 'value': 'errorStringSize' + }, + 'type': 'ViChar[]' + }, + { + 'direction': 'in', + 'documentation': { + 'description': '\nSize of the errorString. If errorStringSize is 0, then it is not large\nenough to hold the entire error description. In this case, the return\nvalue of niTClk_GetExtendedErrorInfo is the size that you should use\nfor niTClk_GetExtendedErrorInfo to return the full error string.\n' + }, + 'name': 'errorStringSize', + 'type': 'ViUInt32' + } + ], + 'returns': 'ViStatus' + }, + 'GetTClkAdjustmentForDistributedTClk': { + 'codegen_method': 'no', + 'documentation': { + 'description': 'TBD' + }, + 'parameters': [ + { + 'direction': 'in', + 'name': 'tclkPeriod', + 'type': 'ViReal64' + }, + { + 'direction': 'in', + 'name': 'measurementsForSenderSize', + 'type': 'ViUInt32' + }, + { + 'direction': 'in', + 'name': 'measurementsForSender', + 'size': { + 'mechanism': 'TBD', + 'value': 'TBD' + }, + 'type': 'ViReal64[]' + }, + { + 'direction': 'in', + 'name': 'measurementsForReceiverSize', + 'type': 'ViUInt32' + }, + { + 'direction': 'in', + 'name': 'measurementsForReceiver', + 'size': { + 'mechanism': 'TBD', + 'value': 'TBD' + }, + 'type': 'ViReal64[]' + }, + { + 'direction': 'out', + 'name': 'tclkAdjustment', + 'type': 'ViReal64' + } + ], + 'returns': 'ViStatus' + }, + 'GetTClkDriftInPpm': { + 'codegen_method': 'no', + 'documentation': { + 'description': 'TBD' + }, + 'parameters': [ + { + 'direction': 'in', + 'name': 'sessionCount', + 'type': 'ViUInt32' + }, + { + 'direction': 'in', + 'name': 'sessions', + 'size': { + 'mechanism': 'TBD', + 'value': 'TBD' + }, + 'type': 'ViSession[]' + }, + { + 'direction': 'in', + 'name': 'minTime', + 'type': 'ViReal64' + }, + { + 'direction': 'out', + 'name': 'maxTClkDriftInPpm', + 'type': 'ViReal64' + } + ], + 'returns': 'ViStatus' + }, + 'GetTClkMeasurementForExternalSyncPulse': { + 'codegen_method': 'no', + 'documentation': { + 'description': 'TBD' + }, + 'parameters': [ + { + 'direction': 'in', + 'name': 'session', + 'type': 'ViSession' + }, + { + 'direction': 'out', + 'name': 'measurement', + 'type': 'ViReal64' + } + ], + 'returns': 'ViStatus' + }, + 'InitForDocumentation': { + 'codegen_method': 'python-only', + 'documentation': { + 'description': 'TBD' + }, + 'parameters': [ + { + 'default_value': None, + 'direction': 'in', + 'documentation': { + 'description': 'Array of driver session object or sessions' + }, + 'name': 'sessionList', + 'type': 'ViSession' + } + ], + 'returns': 'ViStatus' + }, + 'Initiate': { + 'documentation': { + 'description': '\nInitiates the acquisition or generation sessions specified, taking into\nconsideration any special requirements needed for synchronization. For\nexample, the session exporting the TClk-synchronized start trigger is\nnot initiated until after niTClk_Initiate initiates all the sessions\nthat import the TClk-synchronized start trigger.\n' + }, + 'parameters': [ + { + 'direction': 'in', + 'documentation': { + 'description': 'Number of elements in the sessions array' + }, + 'name': 'sessionCount', + 'type': 'ViUInt32' + }, + { + 'direction': 'in', + 'documentation': { + 'description': 'sessions is an array of sessions that are being synchronized.' + }, + 'is_session_handle': False, + 'name': 'sessions', + 'python_api_converter_name': 'convert_to_nitclk_session_num_list', + 'size': { + 'mechanism': 'len', + 'value': 'sessionCount' + }, + 'type': 'ViSession[]' + } + ], + 'returns': 'ViStatus' + }, + 'InternalCalibrateTClkTdcIfNeeded': { + 'codegen_method': 'no', + 'documentation': { + 'description': 'TBD' + }, + 'parameters': [ + { + 'direction': 'in', + 'name': 'session', + 'type': 'ViUInt32' + } + ], + 'returns': 'ViInt32' + }, + 'InternalConnectTClkSyncPulseToTdc': { + 'codegen_method': 'no', + 'documentation': { + 'description': 'TBD' + }, + 'parameters': [ + { + 'direction': 'in', + 'name': 'session', + 'type': 'ViUInt32' + } + ], + 'returns': 'ViInt32' + }, + 'InternalDisconnectTClkSyncPulseFromTdc': { + 'codegen_method': 'no', + 'documentation': { + 'description': 'TBD' + }, + 'parameters': [ + { + 'direction': 'in', + 'name': 'session', + 'type': 'ViUInt32' + } + ], + 'returns': 'ViInt32' + }, + 'InternalFinishSyncPulseSenderSynchronize': { + 'codegen_method': 'no', + 'documentation': { + 'description': 'TBD' + }, + 'parameters': [ + { + 'direction': 'in', + 'name': 'sessionCount', + 'type': 'ViUInt32' + }, + { + 'direction': 'in', + 'name': 'sessions', + 'size': { + 'mechanism': 'TBD', + 'value': 'TBD' + }, + 'type': 'ViSession[]' + }, + { + 'direction': 'in', + 'name': 'minTime', + 'type': 'ViReal64' + }, + { + 'direction': 'in', + 'name': 'adjustment', + 'type': 'ViUInt32' + }, + { + 'direction': 'out', + 'name': 'measuredSyncPulseClkRefEdgeToTClkDelay', + 'type': 'ViReal64' + } + ], + 'returns': 'ViInt32' + }, + 'InternalGetRawCalTdcReadings': { + 'codegen_method': 'no', + 'documentation': { + 'description': 'TBD' + }, + 'parameters': [ + { + 'direction': 'in', + 'name': 'session', + 'type': 'ViUInt32' + }, + { + 'direction': 'in', + 'name': 'calPulseWidthInPicoSec', + 'type': 'ViUInt32' + }, + { + 'direction': 'in', + 'name': 'numReadings', + 'type': 'ViUInt32' + }, + { + 'direction': 'in', + 'name': 'rawReadings', + 'size': { + 'mechanism': 'TBD', + 'value': 'TBD' + }, + 'type': 'ViUInt32[]' + } + ], + 'returns': 'ViInt32' + }, + 'InternalGetRawTClkMeasurements': { + 'codegen_method': 'no', + 'documentation': { + 'description': 'TBD' + }, + 'parameters': [ + { + 'direction': 'in', + 'name': 'sessionCount', + 'type': 'ViUInt32' + }, + { + 'direction': 'in', + 'name': 'sessions', + 'size': { + 'mechanism': 'TBD', + 'value': 'TBD' + }, + 'type': 'ViUInt32[]' + }, + { + 'direction': 'in', + 'name': 'numberOfMeasurements', + 'type': 'ViUInt32' + }, + { + 'direction': 'out', + 'name': 'measurements', + 'type': 'ViReal64' + } + ], + 'returns': 'ViInt32' + }, + 'InternalGetTClkMeasurement': { + 'codegen_method': 'no', + 'documentation': { + 'description': 'TBD' + }, + 'parameters': [ + { + 'direction': 'in', + 'name': 'session', + 'type': 'ViUInt32' + }, + { + 'direction': 'out', + 'name': 'clk10Count', + 'type': 'ViUInt32' + }, + { + 'direction': 'out', + 'name': 'tClkTdcReading', + 'type': 'ViUInt32' + } + ], + 'returns': 'ViInt32' + }, + 'InternalGetTClkMeasurementForExternalSyncPulse': { + 'codegen_method': 'no', + 'documentation': { + 'description': 'TBD' + }, + 'parameters': [ + { + 'direction': 'in', + 'name': 'session', + 'type': 'ViUInt32' + }, + { + 'direction': 'out', + 'name': 'measurement', + 'type': 'ViReal64' + } + ], + 'returns': 'ViInt32' + }, + 'InternalMeasTClkDeltas': { + 'codegen_method': 'no', + 'documentation': { + 'description': 'TBD' + }, + 'parameters': [ + { + 'direction': 'in', + 'name': 'sessionCount', + 'type': 'ViUInt32' + }, + { + 'direction': 'in', + 'name': 'sessions', + 'size': { + 'mechanism': 'TBD', + 'value': 'TBD' + }, + 'type': 'ViUInt32[]' + }, + { + 'direction': 'in', + 'name': 'averagingFactor', + 'type': 'ViUInt32' + }, + { + 'direction': 'in', + 'name': 'tClkDeltas', + 'size': { + 'mechanism': 'TBD', + 'value': 'TBD' + }, + 'type': 'ViReal64[]' + } + ], + 'returns': 'ViInt32' + }, + 'InternalProgramTClkAndEnableTdc': { + 'codegen_method': 'no', + 'documentation': { + 'description': 'TBD' + }, + 'parameters': [ + { + 'direction': 'in', + 'name': 'session', + 'type': 'ViUInt32' + }, + { + 'direction': 'in', + 'name': 'tClkDivisor', + 'type': 'ViUInt32' + } + ], + 'returns': 'ViInt32' + }, + 'InternalTestAttributes': { + 'codegen_method': 'no', + 'documentation': { + 'description': 'TBD' + }, + 'parameters': [ + { + 'direction': 'in', + 'name': 'session', + 'type': 'ViUInt32' + } + ], + 'returns': 'ViInt32' + }, + 'IsDone': { + 'documentation': { + 'description': '\nMonitors the progress of the acquisitions and/or generations\ncorresponding to sessions.\n' + }, + 'parameters': [ + { + 'direction': 'in', + 'documentation': { + 'description': 'Number of elements in the sessions array' + }, + 'name': 'sessionCount', + 'type': 'ViUInt32' + }, + { + 'direction': 'in', + 'documentation': { + 'description': 'sessions is an array of sessions that are being synchronized.' + }, + 'is_session_handle': False, + 'name': 'sessions', + 'python_api_converter_name': 'convert_to_nitclk_session_num_list', + 'size': { + 'mechanism': 'len', + 'value': 'sessionCount' + }, + 'type': 'ViSession[]' + }, + { + 'direction': 'out', + 'documentation': { + 'description': '\nIndicates that the operation is done. The operation is done when each\nsession has completed without any errors or when any one of the sessions\nreports an error.\n' + }, + 'name': 'done', + 'type': 'ViBoolean' + } + ], + 'returns': 'ViStatus' + }, + 'SetAttributeViBoolean': { + 'codegen_method': 'private', + 'documentation': { + 'description': 'TBD' + }, + 'parameters': [ + { + 'direction': 'in', + 'name': 'session', + 'type': 'ViSession' + }, + { + 'direction': 'in', + 'name': 'channelName', + 'type': 'ViConstString' + }, + { + 'direction': 'in', + 'name': 'attributeId', + 'type': 'ViAttr' + }, + { + 'direction': 'in', + 'name': 'value', + 'type': 'ViBoolean' + } + ], + 'returns': 'ViStatus' + }, + 'SetAttributeViReal64': { + 'codegen_method': 'private', + 'documentation': { + 'description': '\nSets the value of an NI-TClk VIReal64 attribute.\nniTClk_SetAttributeViReal64 is a low-level function that you can use to\nset the values NI-TClk attributes. NI-TClk contains high-level functions\nthat set most of the attributes. It is best to use the high-level\nfunctions as much as possible.\n' + }, + 'parameters': [ + { + 'direction': 'in', + 'documentation': { + 'description': 'session references the sessions being synchronized.' + }, + 'name': 'session', + 'type': 'ViSession' + }, + { + 'direction': 'in', + 'documentation': { + 'description': 'Pass VI_NULL or an empty string' + }, + 'name': 'channelName', + 'type': 'ViConstString' + }, + { + 'direction': 'in', + 'documentation': { + 'description': '\nThe ID of the attribute that you want to set Supported Attribute\nNITCLK_ATTR_SAMPLE_CLOCK_DELAY\n' + }, + 'name': 'attributeId', + 'type': 'ViAttr' + }, + { + 'direction': 'in', + 'documentation': { + 'description': 'The value for the attribute' + }, + 'name': 'value', + 'type': 'ViReal64' + } + ], + 'returns': 'ViStatus' + }, + 'SetAttributeViSession': { + 'codegen_method': 'private', + 'documentation': { + 'description': '\nSets the value of an NI-TClk ViSession attribute.\nniTClk_SetAttributeViSession is a low-level function that you can use\nto set the values NI-TClk attributes. NI-TClk contains high-level\nfunctions that set most of the attributes. It is best to use the\nhigh-level functions as much as possible.\n' + }, + 'parameters': [ + { + 'direction': 'in', + 'documentation': { + 'description': 'session references the sessions being synchronized.' + }, + 'name': 'session', + 'type': 'ViSession' + }, + { + 'direction': 'in', + 'documentation': { + 'description': '\nPass VI_NULL or an empty string, except for\nNITCLK_ATTR_SCRIPT_TRIGGER_MASTER_SESSION, for which you should\nspecify scriptTrigger0, scriptTrigger1, scriptTrigger2, or\nscriptTrigger3. VI_NULL and the empty string are treated as\nscriptTrigger0 for NITCLK_ATTR_SCRIPT_TRIGGER_MASTER_SESSION.\n' + }, + 'name': 'channelName', + 'type': 'ViConstString' + }, + { + 'direction': 'in', + 'documentation': { + 'description': '\nThe ID of the attribute that you want to set Supported Attributes\nNITCLK_ATTR_START_TRIGGER_MASTER_SESSION\nNITCLK_ATTR_REF_TRIGGER_MASTER_SESSION\nNITCLK_ATTR_SCRIPT_TRIGGER_MASTER_SESSION\nNITCLK_ATTR_PAUSE_TRIGGER_MASTER_SESSION\n' + }, + 'name': 'attributeId', + 'type': 'ViAttr' + }, + { + 'direction': 'in', + 'documentation': { + 'description': 'The value for the attribute' + }, + 'name': 'value', + 'type': 'ViSession' + } + ], + 'returns': 'ViStatus' + }, + 'SetAttributeViString': { + 'codegen_method': 'private', + 'documentation': { + 'description': '\nSets the value of an NI-TClk VIString attribute.\nniTClk_SetAttributeViString is a low-level function that you can use to\nset the values of NI-TClk attributes. NI-TClk contain high-level\nfunctions that set most of the attributes. It is best to use the\nhigh-level functions as much as possible.\n' + }, + 'parameters': [ + { + 'direction': 'in', + 'documentation': { + 'description': 'session references the sessions being synchronized.' + }, + 'name': 'session', + 'type': 'ViSession' + }, + { + 'direction': 'in', + 'documentation': { + 'description': 'Pass VI_NULL or an empty string' + }, + 'name': 'channelName', + 'type': 'ViConstString' + }, + { + 'direction': 'in', + 'documentation': { + 'description': '\nPass the ID of the attribute that you want to set Supported Attributes\nNITCLK_ATTR_SYNC_PULSE_SOURCE\nNITCLK_ATTR_SYNC_PULSE_CLOCK_SOURCE\nNITCLK_ATTR_EXPORTED_SYNC_PULSE_OUTPUT_TERMINAL\n' + }, + 'name': 'attributeId', + 'type': 'ViAttr' + }, + { + 'direction': 'in', + 'documentation': { + 'description': 'Pass the value for the attribute' + }, + 'name': 'value', + 'type': 'ViConstString' + } + ], + 'returns': 'ViStatus' + }, + 'SetupForSyncPulseSenderSynchronize': { + 'documentation': { + 'description': 'TBD' + }, + 'parameters': [ + { + 'direction': 'in', + 'documentation': { + 'description': 'Number of elements in the sessions array' + }, + 'name': 'sessionCount', + 'type': 'ViUInt32' + }, + { + 'direction': 'in', + 'documentation': { + 'description': 'sessions is an array of sessions that are being synchronized.' + }, + 'is_session_handle': False, + 'name': 'sessions', + 'python_api_converter_name': 'convert_to_nitclk_session_num_list', + 'size': { + 'mechanism': 'len', + 'value': 'sessionCount' + }, + 'type': 'ViSession[]' + }, + { + 'direction': 'in', + 'documentation': { + 'description': '\nMinimal period of TClk, expressed in seconds. Supported values are\nbetween 0.0 s and 0.050 s (50 ms). Minimal period for a single\nchassis/PC is 200 ns. If the specified value is less than 200 ns,\nNI-TClk automatically coerces minTime to 200 ns. For multichassis\nsynchronization, adjust this value to account for propagation delays\nthrough the various devices and cables.\n' + }, + 'name': 'minTime', + 'type': 'ViReal64' + } + ], + 'returns': 'ViStatus' + }, + 'Synchronize': { + 'documentation': { + 'description': '\nSynchronizes the TClk signals on the given sessions. After\nniTClk_Synchronize executes, TClk signals from all sessions are\nsynchronized. Note: Before using this NI-TClk function, verify that your\nsystem is configured as specified in the PXI Trigger Lines and RTSI\nLines topic of the NI-TClk Synchronization Help. You can locate this\nhelp file at Start>>Programs>>National Instruments>>NI-TClk.\n' + }, + 'parameters': [ + { + 'direction': 'in', + 'documentation': { + 'description': 'Number of elements in the sessions array' + }, + 'name': 'sessionCount', + 'type': 'ViUInt32' + }, + { + 'direction': 'in', + 'documentation': { + 'description': 'sessions is an array of sessions that are being synchronized.' + }, + 'is_session_handle': False, + 'name': 'sessions', + 'python_api_converter_name': 'convert_to_nitclk_session_num_list', + 'size': { + 'mechanism': 'len', + 'value': 'sessionCount' + }, + 'type': 'ViSession[]' + }, + { + 'direction': 'in', + 'documentation': { + 'description': '\nMinimal period of TClk, expressed in seconds. Supported values are\nbetween 0.0 s and 0.050 s (50 ms). Minimal period for a single\nchassis/PC is 200 ns. If the specified value is less than 200 ns,\nNI-TClk automatically coerces minTime to 200 ns. For multichassis\nsynchronization, adjust this value to account for propagation delays\nthrough the various devices and cables.\n' + }, + 'default_value': 'datetime.timedelta(seconds=0.0)', + 'python_api_converter_name': 'convert_timedelta_to_seconds', + 'type_in_documentation': 'float in seconds or datetime.timedelta', + 'name': 'minTclkPeriod', + 'type': 'ViReal64' + } + ], + 'returns': 'ViStatus' + }, + 'SynchronizeToSyncPulseSender': { + 'codegen_method': 'no', + 'documentation': { + 'description': 'TBD' + }, + 'parameters': [ + { + 'direction': 'in', + 'name': 'sessionCount', + 'type': 'ViUInt32' + }, + { + 'direction': 'in', + 'name': 'sessions', + 'size': { + 'mechanism': 'TBD', + 'value': 'TBD' + }, + 'type': 'ViSession[]' + }, + { + 'direction': 'in', + 'name': 'minTime', + 'type': 'ViReal64' + } + ], + 'returns': 'ViStatus' + }, + 'SynchronizeWithOptions': { + 'codegen_method': 'no', + 'documentation': { + 'description': 'TBD' + }, + 'parameters': [ + { + 'direction': 'in', + 'name': 'sessionCount', + 'type': 'ViUInt32' + }, + { + 'direction': 'in', + 'name': 'sessions', + 'size': { + 'mechanism': 'TBD', + 'value': 'TBD' + }, + 'type': 'ViSession[]' + }, + { + 'direction': 'in', + 'name': 'minTime', + 'type': 'ViReal64' + }, + { + 'direction': 'in', + 'name': 'options', + 'type': 'ViUInt32' + } + ], + 'returns': 'ViStatus' + }, + 'SynchronizeToSyncPulseSender': { + 'documentation': { + 'description': 'TBD' + }, + 'parameters': [ + { + 'direction': 'in', + 'documentation': { + 'description': 'Number of elements in the sessions array' + }, + 'name': 'sessionCount', + 'type': 'ViUInt32' + }, + { + 'direction': 'in', + 'documentation': { + 'description': 'sessions is an array of sessions that are being synchronized.' + }, + 'is_session_handle': False, + 'name': 'sessions', + 'python_api_converter_name': 'convert_to_nitclk_session_num_list', + 'size': { + 'mechanism': 'len', + 'value': 'sessionCount' + }, + 'type': 'ViSession[]' + }, + { + 'direction': 'in', + 'documentation': { + 'description': '\nMinimal period of TClk, expressed in seconds. Supported values are\nbetween 0.0 s and 0.050 s (50 ms). Minimal period for a single\nchassis/PC is 200 ns. If the specified value is less than 200 ns,\nNI-TClk automatically coerces minTime to 200 ns. For multichassis\nsynchronization, adjust this value to account for propagation delays\nthrough the various devices and cables.\n' + }, + 'name': 'minTime', + 'type': 'ViReal64' + } + ], + 'returns': 'ViStatus' + }, + 'WaitUntilDone': { + 'documentation': { + 'description': '\nCall this function to pause execution of your program until the\nacquisitions and/or generations corresponding to sessions are done or\nuntil the function returns a timeout error. niTClk_WaitUntilDone is a\nblocking function that periodically checks the operation status. It\nreturns control to the calling program if the operation completes\nsuccessfully or an error occurs (including a timeout error). This\nfunction is most useful for finite data operations that you expect to\ncomplete within a certain time.\n' + }, + 'parameters': [ + { + 'direction': 'in', + 'documentation': { + 'description': 'Number of elements in the sessions array' + }, + 'name': 'sessionCount', + 'type': 'ViUInt32' + }, + { + 'direction': 'in', + 'documentation': { + 'description': 'sessions is an array of sessions that are being synchronized.' + }, + 'is_session_handle': False, + 'name': 'sessions', + 'python_api_converter_name': 'convert_to_nitclk_session_num_list', + 'size': { + 'mechanism': 'len', + 'value': 'sessionCount' + }, + 'type': 'ViSession[]' + }, + { + 'direction': 'in', + 'documentation': { + 'description': '\nThe amount of time in seconds that niTClk_WaitUntilDone waits for the\nsessions to complete. If timeout is exceeded, niTClk_WaitUntilDone\nreturns an error.\n' + }, + 'name': 'timeout', + 'type': 'ViReal64' + } + ], + 'returns': 'ViStatus' + } +} diff --git a/src/nitclk/metadata/functions_addon.py b/src/nitclk/metadata/functions_addon.py new file mode 100644 index 000000000..2725caab2 --- /dev/null +++ b/src/nitclk/metadata/functions_addon.py @@ -0,0 +1,53 @@ +# These dictionaries are merged with the extracted function metadata at build time. +# Changes to the metadata should be made here, because functions.py is generated thus any changes get overwritten. + +# By default all functions in functions.py are "public". +# This will override that with private (prefixes name with '_'), or don't generate at all +functions_codegen_method = { +} + +functions_locking = { +} + +# Attach the given parameter to the given enum from enums.py +functions_enums = { +} + +# This is the additional metadata needed by the code generator in order create code that can properly handle buffer allocation. +functions_buffer_info = { +} + +# These are functions we mark as "error_handling":True. The generator uses this information to +# change how error handling is done within those functions themselves - basically, if an error occurs, +# dont try to handle it, since the functions are only used within the context of error handling. +functions_is_error_handling = { +} + +# There are some parameters that are needed in the C function call we use under the hood, but that we do not want in the Python API +functions_remove_from_python_api = { +} + +# Default values for method parameters +functions_default_value = { +} + +# Parameter that need to be array.array +functions_array = { +} + +# We want to use a common name for self_cal across all drivers +functions_name = { +} + +# Functions not in original metadata. +functions_additional_functions = { +} + +# Converted parameters +functions_converters = { +} + +# The extracted metadata is incorrect. Patch it here. +functions_bad_source_metadata = { +} + From 9d53c62e2991f9e4d823ad3ddadf668a3371f52c Mon Sep 17 00:00:00 2001 From: Mark Silva Date: Thu, 29 Aug 2019 17:02:38 -0500 Subject: [PATCH 02/56] Create nitclk.mak --- src/nitclk/nitclk.mak | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 src/nitclk/nitclk.mak diff --git a/src/nitclk/nitclk.mak b/src/nitclk/nitclk.mak new file mode 100644 index 000000000..a3cec519c --- /dev/null +++ b/src/nitclk/nitclk.mak @@ -0,0 +1,19 @@ + + +include $(BUILD_HELPER_DIR)/defines.mak + +MODULE_FILES_TO_GENERATE := $(filter-out enums.py,$(DEFAULT_PY_FILES_TO_GENERATE)) + +MODULE_FILES_TO_COPY := $(DEFAULT_PY_FILES_TO_COPY) + +RST_FILES_TO_GENERATE := $(filter-out enums.rst,$(DEFAULT_RST_FILES_TO_GENERATE)) + + +include $(BUILD_HELPER_DIR)/rules.mak + +# We need to override the default rule for generating session since we have +# a specialized copy for TClk +$(MODULE_DIR)/session.py: $(DRIVER_DIR)/templates/session.py.mako $(BUILD_HELPER_SCRIPTS) $(METADATA_FILES) + $(call trace_to_console, "Generating",$@) + $(_hide_cmds)$(call GENERATE_SCRIPT, $<, $(MODULE_DIR), $(METADATA_DIR)) + From 39c2ed7a13be820e274df677e41eb9b418e6b084 Mon Sep 17 00:00:00 2001 From: Mark Silva Date: Thu, 29 Aug 2019 17:22:55 -0500 Subject: [PATCH 03/56] Remove numpy restriction Bug fixed --- tox.ini | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/tox.ini b/tox.ini index c6d6ddf3c..42c056ae2 100644 --- a/tox.ini +++ b/tox.ini @@ -161,15 +161,7 @@ deps = test: mock test: mako test: six - py27-test: numpy - py34-test: numpy - py35-test: numpy - py36-test: numpy - py37-test: numpy - py38-test: numpy - # pypy doesn't work with numpy >= 1.16 - pypy-test: numpy<1.16 - pypy3-test: numpy<1.16 + test: numpy build_test: enum34;python_version<"3.4" build_test: pytest build_test: coverage From 571206f939aaeb95bc7d0eb8695b2c68ff2c416b Mon Sep 17 00:00:00 2001 From: Mark Silva Date: Thu, 29 Aug 2019 17:23:07 -0500 Subject: [PATCH 04/56] Upgrade pip --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index 42c056ae2..8f7a4a13c 100644 --- a/tox.ini +++ b/tox.ini @@ -65,7 +65,7 @@ commands = build_test: flake8 --config=./tox.ini build/ test: python --version test: python -c "import platform; print(platform.architecture())" - test: python -m pip install --upgrade pip + test: python -m pip install pip --upgrade pip test: coverage run --rcfile=tools/coverage_unit_tests.rc --append --source nifake -m py.test bin/nifake/nifake {posargs} -s test: coverage run --rcfile=tools/coverage_unit_tests.rc --append --source nimodinst -m py.test bin/nimodinst/nimodinst {posargs} -s test: coverage report --rcfile=tools/coverage_unit_tests.rc From b7732eb820d3b8fa88a8b9f23402e839f8e3fcd1 Mon Sep 17 00:00:00 2001 From: Mark Silva Date: Thu, 29 Aug 2019 17:29:14 -0500 Subject: [PATCH 05/56] Remove specific version of flake8 '\' in comments now need to be escaped --- tools/build_release.py | 6 +++--- tox.ini | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/tools/build_release.py b/tools/build_release.py index e16b25931..9ab9b7a08 100644 --- a/tools/build_release.py +++ b/tools/build_release.py @@ -8,7 +8,7 @@ pp = pprint.PrettyPrinter(indent=4, width=100) -default_python_cmd = ['c://Python27//python.exe'] +default_python_cmd = ['c:/Python27/python.exe'] def configure_logging(lvl=logging.WARNING, logfile=None): @@ -37,13 +37,13 @@ def main(): * Update the changelog to show the version of the release * Change unreleased in TOC to new version * Commit to master - * `c:\Python36\python.exe tools\build_release.py --build --update --upload --release` + * `c:\\Python36\\python.exe tools\\build_release.py --build --update --upload --release` * This will update all the versions to remove any '.devN' * Clean and build to update generated files with new version * Upload to PyPI - you will need to type in your credentials * Push all changes to GitHub * Create a release on GitHub using the portion from the changelog for this release for the description - * `c:\Python36\python.exe tools\build_release.py --build --update` + * `c:\\Python36\\python.exe tools\\build_release.py --build --update` * This will update the version to X.X.(N+1).dev0 * Clean and Build to update generated files * Copy Unreleased section from bottom of changelog to the top and add a link to it in the TOC diff --git a/tox.ini b/tox.ini index 8f7a4a13c..2d1133ca7 100644 --- a/tox.ini +++ b/tox.ini @@ -166,12 +166,14 @@ deps = build_test: pytest build_test: coverage build_test: mako + build_test: flake8 build_test: hacking build_test: pep8-naming codegen: enum34;python_version<"3.4" codegen: mako codegen: wheel codegen: setuptools + flake8: flake8 flake8: hacking flake8: pep8-naming docs: sphinx From 41cf6caec76a1ecf6d77024fc3f575abe01b5654 Mon Sep 17 00:00:00 2001 From: Mark Silva Date: Thu, 29 Aug 2019 17:29:41 -0500 Subject: [PATCH 06/56] Add basepython section --- tox.ini | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tox.ini b/tox.ini index 2d1133ca7..086bdf3be 100644 --- a/tox.ini +++ b/tox.ini @@ -28,6 +28,22 @@ description = nimodinst_system_tests: Run system tests for nimodinst nise_system_tests: Run system tests for nise +basepython = + clean: python + build_test: python + codegen: python3 + py27: python2.7 + py34: python3.4 + py35: python3.5 + py36: python3.6 + py37: python3.7 + py38: python3.8 + pypy: pypy + pypy3: pypy3 + flake8: python3 + docs: python + pkg: python + changedir = build_test: . test: . From e0745618ea7313382e1abb991ef5aa1b7a8c2f86 Mon Sep 17 00:00:00 2001 From: Mark Silva Date: Thu, 29 Aug 2019 17:35:40 -0500 Subject: [PATCH 07/56] Try using pypy3.5 --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index d913b853e..736fe1b55 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,7 +7,7 @@ matrix: # We put pypy towards the beginning because for some reason the build takes much longer, this starts it earlier # so multiple others can be running while these continue to run. - python: pypy - - python: pypy3 + - python: pypy3.5 - python: 2.7 - python: 3.4 - python: 3.5 From defd961f54ea0c283f142dd5164dacf5893c29e4 Mon Sep 17 00:00:00 2001 From: Mark Silva Date: Thu, 29 Aug 2019 17:42:16 -0500 Subject: [PATCH 08/56] Go back to pypy3 and remove basepython block --- .travis.yml | 2 +- tox.ini | 16 ---------------- 2 files changed, 1 insertion(+), 17 deletions(-) diff --git a/.travis.yml b/.travis.yml index 736fe1b55..d913b853e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,7 +7,7 @@ matrix: # We put pypy towards the beginning because for some reason the build takes much longer, this starts it earlier # so multiple others can be running while these continue to run. - python: pypy - - python: pypy3.5 + - python: pypy3 - python: 2.7 - python: 3.4 - python: 3.5 diff --git a/tox.ini b/tox.ini index 086bdf3be..2d1133ca7 100644 --- a/tox.ini +++ b/tox.ini @@ -28,22 +28,6 @@ description = nimodinst_system_tests: Run system tests for nimodinst nise_system_tests: Run system tests for nise -basepython = - clean: python - build_test: python - codegen: python3 - py27: python2.7 - py34: python3.4 - py35: python3.5 - py36: python3.6 - py37: python3.7 - py38: python3.8 - pypy: pypy - pypy3: pypy3 - flake8: python3 - docs: python - pkg: python - changedir = build_test: . test: . From ae86324d0f77fea561a5676cf422b14f889c2944 Mon Sep 17 00:00:00 2001 From: Mark Silva Date: Thu, 29 Aug 2019 17:53:13 -0500 Subject: [PATCH 09/56] Don't need to run build_test for all builds - only 3.6 --- .travis.yml | 2 +- tox.ini | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index d913b853e..49614519b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -31,7 +31,7 @@ install: - travis_retry pip install --upgrade tox tox-travis coveralls codecov script: - - tox -e clean,build_test,codegen PRINT=1 + - tox -e clean,codegen PRINT=1 - tox after_success: diff --git a/tox.ini b/tox.ini index 2d1133ca7..d4354d8cd 100644 --- a/tox.ini +++ b/tox.ini @@ -259,6 +259,6 @@ python_files = *.py [travis] python = - 3.6: py36-test, flake8, docs + 3.6: build_test, flake8, docs, py36-test From 5a97c42366cba30fdd9dd7e18ebba54cdada6c7e Mon Sep 17 00:00:00 2001 From: Mark Silva Date: Fri, 30 Aug 2019 09:24:25 -0500 Subject: [PATCH 10/56] Remove warning from coverage --- tools/coverage_unit_tests.rc | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/tools/coverage_unit_tests.rc b/tools/coverage_unit_tests.rc index d9dc5f1c8..4a4536a65 100644 --- a/tools/coverage_unit_tests.rc +++ b/tools/coverage_unit_tests.rc @@ -1,7 +1,4 @@ [run] omit = */_library* -include = - */nifake/* - */nimodinst/session.py - build/* + From ef21c76f466e8058008b1db27134a8ae34f05333 Mon Sep 17 00:00:00 2001 From: Mark Silva Date: Fri, 30 Aug 2019 09:35:04 -0500 Subject: [PATCH 11/56] Undo previous change --- tools/coverage_unit_tests.rc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/coverage_unit_tests.rc b/tools/coverage_unit_tests.rc index 4a4536a65..d9dc5f1c8 100644 --- a/tools/coverage_unit_tests.rc +++ b/tools/coverage_unit_tests.rc @@ -1,4 +1,7 @@ [run] omit = */_library* - +include = + */nifake/* + */nimodinst/session.py + build/* From 143e08f8292f3bf1059be5ffe12d95e15636d7b3 Mon Sep 17 00:00:00 2001 From: Mark Silva Date: Fri, 30 Aug 2019 09:35:16 -0500 Subject: [PATCH 12/56] Try disabling faulthandler --- tox.ini | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tox.ini b/tox.ini index d4354d8cd..e70034234 100644 --- a/tox.ini +++ b/tox.ini @@ -66,8 +66,8 @@ commands = test: python --version test: python -c "import platform; print(platform.architecture())" test: python -m pip install pip --upgrade pip - test: coverage run --rcfile=tools/coverage_unit_tests.rc --append --source nifake -m py.test bin/nifake/nifake {posargs} -s - test: coverage run --rcfile=tools/coverage_unit_tests.rc --append --source nimodinst -m py.test bin/nimodinst/nimodinst {posargs} -s + test: coverage run --rcfile=tools/coverage_unit_tests.rc --append --source nifake -m py.test bin/nifake/nifake {posargs} -s --no-faulthandler + test: coverage run --rcfile=tools/coverage_unit_tests.rc --append --source nimodinst -m py.test bin/nimodinst/nimodinst {posargs} -s --no-faulthandler test: coverage report --rcfile=tools/coverage_unit_tests.rc test: coverage html --rcfile=tools/coverage_unit_tests.rc --directory=bin/htmlcov/unit_tests clean: python --version From 3673d09b68f8d254373c634a50f08617c400a0ce Mon Sep 17 00:00:00 2001 From: Mark Silva Date: Fri, 30 Aug 2019 14:43:33 -0500 Subject: [PATCH 13/56] Remove --no-faulthandler --- tox.ini | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tox.ini b/tox.ini index e70034234..d4354d8cd 100644 --- a/tox.ini +++ b/tox.ini @@ -66,8 +66,8 @@ commands = test: python --version test: python -c "import platform; print(platform.architecture())" test: python -m pip install pip --upgrade pip - test: coverage run --rcfile=tools/coverage_unit_tests.rc --append --source nifake -m py.test bin/nifake/nifake {posargs} -s --no-faulthandler - test: coverage run --rcfile=tools/coverage_unit_tests.rc --append --source nimodinst -m py.test bin/nimodinst/nimodinst {posargs} -s --no-faulthandler + test: coverage run --rcfile=tools/coverage_unit_tests.rc --append --source nifake -m py.test bin/nifake/nifake {posargs} -s + test: coverage run --rcfile=tools/coverage_unit_tests.rc --append --source nimodinst -m py.test bin/nimodinst/nimodinst {posargs} -s test: coverage report --rcfile=tools/coverage_unit_tests.rc test: coverage html --rcfile=tools/coverage_unit_tests.rc --directory=bin/htmlcov/unit_tests clean: python --version From f1ae55d72f31046259e2f08814cf6dba0b9da03d Mon Sep 17 00:00:00 2001 From: Mark Silva Date: Fri, 30 Aug 2019 14:44:00 -0500 Subject: [PATCH 14/56] pypy needs an older version of pytest See https://github.com/pytest-dev/pytest/issues/5807 --- tox.ini | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index d4354d8cd..a9a6eac24 100644 --- a/tox.ini +++ b/tox.ini @@ -156,7 +156,8 @@ commands = deps = test: enum34;python_version<"3.4" test: singledispatch;python_version<"3.4" - test: pytest + test: pytest==4.6.5;implementation_name=='pypy' + test: pytest;implementation_name=='cpython' test: coverage test: mock test: mako From a4a28fa905ee79aea5294ae1158ea75648bb6a4d Mon Sep 17 00:00:00 2001 From: Mark Silva Date: Fri, 30 Aug 2019 15:17:13 -0500 Subject: [PATCH 15/56] Use platform_python_implementation since implementation_name is not defined on Python2 --- tox.ini | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tox.ini b/tox.ini index a9a6eac24..b179f6622 100644 --- a/tox.ini +++ b/tox.ini @@ -156,8 +156,8 @@ commands = deps = test: enum34;python_version<"3.4" test: singledispatch;python_version<"3.4" - test: pytest==4.6.5;implementation_name=='pypy' - test: pytest;implementation_name=='cpython' + test: pytest==4.6.5;platform_python_implementation=='PyPy' + test: pytest;platform_python_implementation=='CPython' test: coverage test: mock test: mako From 1251734c8a239d67c4fee26c007581330f5e0429 Mon Sep 17 00:00:00 2001 From: Mark Silva Date: Fri, 30 Aug 2019 16:05:09 -0500 Subject: [PATCH 16/56] Try to get back to the initial coverage --- .travis.yml | 2 +- tox.ini | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 49614519b..d913b853e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -31,7 +31,7 @@ install: - travis_retry pip install --upgrade tox tox-travis coveralls codecov script: - - tox -e clean,codegen PRINT=1 + - tox -e clean,build_test,codegen PRINT=1 - tox after_success: diff --git a/tox.ini b/tox.ini index b179f6622..97777adbd 100644 --- a/tox.ini +++ b/tox.ini @@ -260,6 +260,6 @@ python_files = *.py [travis] python = - 3.6: build_test, flake8, docs, py36-test + 3.6: flake8, docs, py36-test From b3005f0d78d42c86639db89151b4024c8abe7f8b Mon Sep 17 00:00:00 2001 From: Mark Silva Date: Fri, 30 Aug 2019 16:25:56 -0500 Subject: [PATCH 17/56] Do the same thing for build_test --- tox.ini | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index 97777adbd..b7d86c13c 100644 --- a/tox.ini +++ b/tox.ini @@ -164,7 +164,8 @@ deps = test: six test: numpy build_test: enum34;python_version<"3.4" - build_test: pytest + build_test: pytest==4.6.5;platform_python_implementation=='PyPy' + build_test: pytest;platform_python_implementation=='CPython' build_test: coverage build_test: mako build_test: flake8 From b6b5a30e0d5b5a577f84a42d6939547c00fc771d Mon Sep 17 00:00:00 2001 From: Mark Silva Date: Fri, 30 Aug 2019 16:56:23 -0500 Subject: [PATCH 18/56] Remove redundant pip --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index b7d86c13c..66af8d69a 100644 --- a/tox.ini +++ b/tox.ini @@ -65,7 +65,7 @@ commands = build_test: flake8 --config=./tox.ini build/ test: python --version test: python -c "import platform; print(platform.architecture())" - test: python -m pip install pip --upgrade pip + test: python -m pip install --upgrade pip test: coverage run --rcfile=tools/coverage_unit_tests.rc --append --source nifake -m py.test bin/nifake/nifake {posargs} -s test: coverage run --rcfile=tools/coverage_unit_tests.rc --append --source nimodinst -m py.test bin/nimodinst/nimodinst {posargs} -s test: coverage report --rcfile=tools/coverage_unit_tests.rc From 8fd761dc6074c2407935b454cdf8c915ff171986 Mon Sep 17 00:00:00 2001 From: Mark Silva Date: Tue, 3 Sep 2019 11:01:04 -0500 Subject: [PATCH 19/56] Add codecov file to try to control limits for passing --- .codecov.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 .codecov.yml diff --git a/.codecov.yml b/.codecov.yml new file mode 100644 index 000000000..ab610d719 --- /dev/null +++ b/.codecov.yml @@ -0,0 +1,14 @@ +coverage: + precision: 2 + round: down + range: "70...100" + + status: + project: + default: + threshhold: 5% + patch: + default: + threshhold: 5% + + From d84d22f627fb88a55e4eb6dd8d026e016d1ad835 Mon Sep 17 00:00:00 2001 From: Mark Silva Date: Tue, 3 Sep 2019 13:36:41 -0500 Subject: [PATCH 20/56] Enable nitclk build --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index ee407e9dd..7af56f175 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ -# In alphabetical order except put nifake first and nimodinst last +# In alphabetical order except put nifake first and nimodinst/nitclk last # - nifake first to get the most code generator coverage # - nimodinst last so that the version from nimodinst is used for any global versions (docs/conf.py) -ALL_DRIVERS := nifake nidcpower nidigital nidmm nifgen niscope niswitch nise nimodinst +ALL_DRIVERS := nifake nidcpower nidigital nidmm nifgen niscope niswitch nise nimodinst nitclk DRIVERS ?= $(ALL_DRIVERS) ROOT_DIR := $(abspath .) From b135799ee03ea47285837285a5c1164db0fc4839 Mon Sep 17 00:00:00 2001 From: Mark Silva Date: Tue, 3 Sep 2019 13:37:01 -0500 Subject: [PATCH 21/56] There are some files we will need to skip for now --- src/nitclk/nitclk.mak | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/nitclk/nitclk.mak b/src/nitclk/nitclk.mak index a3cec519c..28c8b2fa6 100644 --- a/src/nitclk/nitclk.mak +++ b/src/nitclk/nitclk.mak @@ -2,11 +2,15 @@ include $(BUILD_HELPER_DIR)/defines.mak -MODULE_FILES_TO_GENERATE := $(filter-out enums.py,$(DEFAULT_PY_FILES_TO_GENERATE)) +# Eventually we will get back to this as we add/update more templates +# MODULE_FILES_TO_GENERATE := $(filter-out enums.py,$(DEFAULT_PY_FILES_TO_GENERATE)) +MODULE_FILES_TO_GENERATE := $(filter-out session.py enums.py,$(DEFAULT_PY_FILES_TO_GENERATE)) MODULE_FILES_TO_COPY := $(DEFAULT_PY_FILES_TO_COPY) -RST_FILES_TO_GENERATE := $(filter-out enums.rst,$(DEFAULT_RST_FILES_TO_GENERATE)) +# Eventually we will get back to this as we add/update more files +# RST_FILES_TO_GENERATE := $(filter-out enums.rst,$(DEFAULT_RST_FILES_TO_GENERATE)) +RST_FILES_TO_GENERATE := $(filter-out README.rst examples.rst enums.rst,$(DEFAULT_RST_FILES_TO_GENERATE)) include $(BUILD_HELPER_DIR)/rules.mak From b1f32906bc78edc3380e8839d10ea25581095970 Mon Sep 17 00:00:00 2001 From: Mark Silva Date: Tue, 3 Sep 2019 13:37:36 -0500 Subject: [PATCH 22/56] Add generated nitclk files --- docs/nitclk/class.rst | 954 ++++++++++++++++++++ docs/nitclk/errors.rst | 62 ++ docs/nitclk/installation.inc | 18 + docs/nitclk/status.inc | 41 + docs/nitclk/toc.inc | 10 + generated/nitclk/_attributes.py | 112 +++ generated/nitclk/_converters.py | 503 +++++++++++ generated/nitclk/_library.py | 173 ++++ generated/nitclk/_library_singleton.py | 54 ++ generated/nitclk/_visatype.py | 28 + generated/nitclk/errors.py | 100 ++ generated/nitclk/setup.py | 74 ++ generated/nitclk/unit_tests/_matchers.py | 302 +++++++ generated/nitclk/unit_tests/_mock_helper.py | 210 +++++ 14 files changed, 2641 insertions(+) create mode 100644 docs/nitclk/class.rst create mode 100644 docs/nitclk/errors.rst create mode 100644 docs/nitclk/installation.inc create mode 100644 docs/nitclk/status.inc create mode 100644 docs/nitclk/toc.inc create mode 100644 generated/nitclk/_attributes.py create mode 100644 generated/nitclk/_converters.py create mode 100644 generated/nitclk/_library.py create mode 100644 generated/nitclk/_library_singleton.py create mode 100644 generated/nitclk/_visatype.py create mode 100644 generated/nitclk/errors.py create mode 100644 generated/nitclk/setup.py create mode 100644 generated/nitclk/unit_tests/_matchers.py create mode 100644 generated/nitclk/unit_tests/_mock_helper.py diff --git a/docs/nitclk/class.rst b/docs/nitclk/class.rst new file mode 100644 index 000000000..4dc89edde --- /dev/null +++ b/docs/nitclk/class.rst @@ -0,0 +1,954 @@ +nitclk.Session +============== + +.. py:module:: nitclk + +.. py:class:: Session(self) + + + + TBD + + + + + + + **Properties** + + +------------------------------------------------+----------------------------------------------------------------------------+ + | Property | Datatype | + +================================================+============================================================================+ + | :py:attr:`exported_sync_pulse_output_terminal` | str | + +------------------------------------------------+----------------------------------------------------------------------------+ + | :py:attr:`exported_tclk_output_terminal` | str | + +------------------------------------------------+----------------------------------------------------------------------------+ + | :py:attr:`pause_trigger_master_session` | nimi-python Session class, nitclk.SessionReference, NI-TClk Session Number | + +------------------------------------------------+----------------------------------------------------------------------------+ + | :py:attr:`ref_trigger_master_session` | nimi-python Session class, nitclk.SessionReference, NI-TClk Session Number | + +------------------------------------------------+----------------------------------------------------------------------------+ + | :py:attr:`sample_clock_delay` | float | + +------------------------------------------------+----------------------------------------------------------------------------+ + | :py:attr:`script_trigger_master_session` | nimi-python Session class, nitclk.SessionReference, NI-TClk Session Number | + +------------------------------------------------+----------------------------------------------------------------------------+ + | :py:attr:`sequencer_flag_master_session` | nimi-python Session class, nitclk.SessionReference, NI-TClk Session Number | + +------------------------------------------------+----------------------------------------------------------------------------+ + | :py:attr:`start_trigger_master_session` | nimi-python Session class, nitclk.SessionReference, NI-TClk Session Number | + +------------------------------------------------+----------------------------------------------------------------------------+ + | :py:attr:`sync_pulse_clock_source` | str | + +------------------------------------------------+----------------------------------------------------------------------------+ + | :py:attr:`sync_pulse_sender_sync_pulse_source` | str | + +------------------------------------------------+----------------------------------------------------------------------------+ + | :py:attr:`sync_pulse_source` | str | + +------------------------------------------------+----------------------------------------------------------------------------+ + | :py:attr:`tclk_actual_period` | float | + +------------------------------------------------+----------------------------------------------------------------------------+ + + **Public methods** + + +----------------------------------------------------+ + | Method name | + +====================================================+ + | :py:func:`configure_for_homogeneous_triggers` | + +----------------------------------------------------+ + | :py:func:`finish_sync_pulse_sender_synchronize` | + +----------------------------------------------------+ + | :py:func:`init_for_documentation` | + +----------------------------------------------------+ + | :py:func:`initiate` | + +----------------------------------------------------+ + | :py:func:`is_done` | + +----------------------------------------------------+ + | :py:func:`setup_for_sync_pulse_sender_synchronize` | + +----------------------------------------------------+ + | :py:func:`synchronize` | + +----------------------------------------------------+ + | :py:func:`synchronize_to_sync_pulse_sender` | + +----------------------------------------------------+ + | :py:func:`wait_until_done` | + +----------------------------------------------------+ + + +Properties +---------- + +exported_sync_pulse_output_terminal +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + .. py:currentmodule:: nitclk.Session + + .. py:attribute:: exported_sync_pulse_output_terminal + + Specifies the destination of the Sync Pulse. This property is most often used when synchronizing a multichassis system. + Values + Empty string. Empty string is a valid value, indicating that the signal is not exported. + PXI Devices - 'PXI_Trig0' through 'PXI_Trig7' and device-specific settings + PCI Devices - 'RTSI_0' through 'RTSI_7' and device-specific settings + Examples of Device-Specific Settings + - NI PXI-5122 supports 'PFI0' and 'PFI1' + - NI PXI-5421 supports 'PFI0', 'PFI1', 'PFI4', and 'PFI5' + - NI PXI-6551/6552 supports 'PFI0', 'PFI1', 'PFI2', and 'PFI3' + Default Value is empty string + + The following table lists the characteristics of this property. + + +----------------+------------+ + | Characteristic | Value | + +================+============+ + | Datatype | str | + +----------------+------------+ + | Permissions | read-write | + +----------------+------------+ + | Channel Based | No | + +----------------+------------+ + | Resettable | No | + +----------------+------------+ + + .. tip:: + This property corresponds to the following LabVIEW Property or C Attribute: + + - LabVIEW Property: **Export Sync Pulse Output Terminal** + - C Attribute: **NITCLK_ATTR_EXPORTED_SYNC_PULSE_OUTPUT_TERMINAL** + +exported_tclk_output_terminal +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + .. py:currentmodule:: nitclk.Session + + .. py:attribute:: exported_tclk_output_terminal + + Specifies the destination of the device's TClk signal. + Values + Empty string. Empty string is a valid value, indicating that the signal is not exported. + PXI Devices - 'PXI_Trig0' through 'PXI_Trig7' and device-specific settings + PCI Devices - 'RTSI_0' through 'RTSI_7' and device-specific settings + Examples of Device-Specific Settings + - NI PXI-5122 supports 'PFI0' and 'PFI1' + - NI PXI-5421 supports 'PFI0', 'PFI1', 'PFI4', and 'PFI5' + - NI PXI-6551/6552 supports 'PFI0', 'PFI1', 'PFI2', and 'PFI3' + Default Value is empty string + + The following table lists the characteristics of this property. + + +----------------+------------+ + | Characteristic | Value | + +================+============+ + | Datatype | str | + +----------------+------------+ + | Permissions | read-write | + +----------------+------------+ + | Channel Based | No | + +----------------+------------+ + | Resettable | No | + +----------------+------------+ + + .. tip:: + This property corresponds to the following LabVIEW Property or C Attribute: + + - LabVIEW Property: **Output Terminal** + - C Attribute: **NITCLK_ATTR_EXPORTED_TCLK_OUTPUT_TERMINAL** + +pause_trigger_master_session +~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + .. py:currentmodule:: nitclk.Session + + .. py:attribute:: pause_trigger_master_session + + Specifies the pause trigger master session. + For external triggers, the session that originally receives the trigger. For None (no trigger configured) or software triggers, the session that originally generates the trigger. + + The following table lists the characteristics of this property. + + +----------------+----------------------------------------------------------------------------+ + | Characteristic | Value | + +================+============================================================================+ + | Datatype | nimi-python Session class, nitclk.SessionReference, NI-TClk Session Number | + +----------------+----------------------------------------------------------------------------+ + | Permissions | read-write | + +----------------+----------------------------------------------------------------------------+ + | Channel Based | No | + +----------------+----------------------------------------------------------------------------+ + | Resettable | No | + +----------------+----------------------------------------------------------------------------+ + + .. tip:: + This property corresponds to the following LabVIEW Property or C Attribute: + + - LabVIEW Property: **Pause Trigger Master Session** + - C Attribute: **NITCLK_ATTR_PAUSE_TRIGGER_MASTER_SESSION** + +ref_trigger_master_session +~~~~~~~~~~~~~~~~~~~~~~~~~~ + + .. py:currentmodule:: nitclk.Session + + .. py:attribute:: ref_trigger_master_session + + Specifies the reference trigger master session. + For external triggers, the session that originally receives the trigger. For None (no trigger configured) or software triggers, the session that originally generates the trigger. + + The following table lists the characteristics of this property. + + +----------------+----------------------------------------------------------------------------+ + | Characteristic | Value | + +================+============================================================================+ + | Datatype | nimi-python Session class, nitclk.SessionReference, NI-TClk Session Number | + +----------------+----------------------------------------------------------------------------+ + | Permissions | read-write | + +----------------+----------------------------------------------------------------------------+ + | Channel Based | No | + +----------------+----------------------------------------------------------------------------+ + | Resettable | No | + +----------------+----------------------------------------------------------------------------+ + + .. tip:: + This property corresponds to the following LabVIEW Property or C Attribute: + + - LabVIEW Property: **Reference Trigger Master Session** + - C Attribute: **NITCLK_ATTR_REF_TRIGGER_MASTER_SESSION** + +sample_clock_delay +~~~~~~~~~~~~~~~~~~ + + .. py:currentmodule:: nitclk.Session + + .. py:attribute:: sample_clock_delay + + Specifies the sample clock delay. + Specifies the delay, in seconds, to apply to the session sample clock relative to the other synchronized sessions. During synchronization, NI-TClk aligns the sample clocks on the synchronized devices. If you want to delay the sample clocks, set this property before calling :py:meth:`nitclk.Session.synchronize`. + not supported for acquisition sessions. + Values - Between minus one and plus one period of the sample clock. + One sample clock period is equal to (1/sample clock rate). For example, for a session with sample rate of 100 MS/s, you can specify sample clock delays between -10.0 ns and +10.0 ns. + Default Value is 0 + + + + .. note:: Sample clock delay is supported for generation sessions only; it is + + The following table lists the characteristics of this property. + + +----------------+------------+ + | Characteristic | Value | + +================+============+ + | Datatype | float | + +----------------+------------+ + | Permissions | read-write | + +----------------+------------+ + | Channel Based | No | + +----------------+------------+ + | Resettable | No | + +----------------+------------+ + + .. tip:: + This property corresponds to the following LabVIEW Property or C Attribute: + + - LabVIEW Property: **Sample Clock Delay** + - C Attribute: **NITCLK_ATTR_SAMPLE_CLOCK_DELAY** + +script_trigger_master_session +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + .. py:currentmodule:: nitclk.Session + + .. py:attribute:: script_trigger_master_session + + Specifies the script trigger master session. + For external triggers, the session that originally receives the trigger. For None (no trigger configured) or software triggers, the session that originally generates the trigger. + + The following table lists the characteristics of this property. + + +----------------+----------------------------------------------------------------------------+ + | Characteristic | Value | + +================+============================================================================+ + | Datatype | nimi-python Session class, nitclk.SessionReference, NI-TClk Session Number | + +----------------+----------------------------------------------------------------------------+ + | Permissions | read-write | + +----------------+----------------------------------------------------------------------------+ + | Channel Based | No | + +----------------+----------------------------------------------------------------------------+ + | Resettable | No | + +----------------+----------------------------------------------------------------------------+ + + .. tip:: + This property corresponds to the following LabVIEW Property or C Attribute: + + - LabVIEW Property: **Script Trigger Master Session** + - C Attribute: **NITCLK_ATTR_SCRIPT_TRIGGER_MASTER_SESSION** + +sequencer_flag_master_session +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + .. py:currentmodule:: nitclk.Session + + .. py:attribute:: sequencer_flag_master_session + + Specifies the sequencer flag master session. + For external triggers, the session that originally receives the trigger. + For None (no trigger configured) or software triggers, the session that + originally generates the trigger. + + The following table lists the characteristics of this property. + + +----------------+----------------------------------------------------------------------------+ + | Characteristic | Value | + +================+============================================================================+ + | Datatype | nimi-python Session class, nitclk.SessionReference, NI-TClk Session Number | + +----------------+----------------------------------------------------------------------------+ + | Permissions | read-write | + +----------------+----------------------------------------------------------------------------+ + | Channel Based | No | + +----------------+----------------------------------------------------------------------------+ + | Resettable | No | + +----------------+----------------------------------------------------------------------------+ + + .. tip:: + This property corresponds to the following LabVIEW Property or C Attribute: + + - LabVIEW Property: **Sequencer Flag Master Session** + - C Attribute: **NITCLK_ATTR_SEQUENCER_FLAG_MASTER_SESSION** + +start_trigger_master_session +~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + .. py:currentmodule:: nitclk.Session + + .. py:attribute:: start_trigger_master_session + + Specifies the start trigger master session. + For external triggers, the session that originally receives the trigger. For None (no trigger configured) or software triggers, the session that originally generates the trigger. + + The following table lists the characteristics of this property. + + +----------------+----------------------------------------------------------------------------+ + | Characteristic | Value | + +================+============================================================================+ + | Datatype | nimi-python Session class, nitclk.SessionReference, NI-TClk Session Number | + +----------------+----------------------------------------------------------------------------+ + | Permissions | read-write | + +----------------+----------------------------------------------------------------------------+ + | Channel Based | No | + +----------------+----------------------------------------------------------------------------+ + | Resettable | No | + +----------------+----------------------------------------------------------------------------+ + + .. tip:: + This property corresponds to the following LabVIEW Property or C Attribute: + + - LabVIEW Property: **Start Trigger Master Session** + - C Attribute: **NITCLK_ATTR_START_TRIGGER_MASTER_SESSION** + +sync_pulse_clock_source +~~~~~~~~~~~~~~~~~~~~~~~ + + .. py:currentmodule:: nitclk.Session + + .. py:attribute:: sync_pulse_clock_source + + Specifies the Sync Pulse Clock source. This property is typically used to synchronize PCI devices when you want to control RTSI 7 yourself. Make sure that a 10 MHz clock is driven onto RTSI 7. + Values + PCI Devices - 'RTSI_7' and 'None' + PXI Devices - 'PXI_CLK10' and 'None' + Default Value - 'None' directs :py:meth:`nitclk.Session.synchronize` to create the necessary routes. For PCI, one of the synchronized devices drives a 10 MHz clock on RTSI 7 unless that line is already being driven. + + The following table lists the characteristics of this property. + + +----------------+------------+ + | Characteristic | Value | + +================+============+ + | Datatype | str | + +----------------+------------+ + | Permissions | read-write | + +----------------+------------+ + | Channel Based | No | + +----------------+------------+ + | Resettable | No | + +----------------+------------+ + + .. tip:: + This property corresponds to the following LabVIEW Property or C Attribute: + + - LabVIEW Property: **Sync Pulse Clock Source** + - C Attribute: **NITCLK_ATTR_SYNC_PULSE_CLOCK_SOURCE** + +sync_pulse_sender_sync_pulse_source +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + .. py:currentmodule:: nitclk.Session + + .. py:attribute:: sync_pulse_sender_sync_pulse_source + + Specifies the external sync pulse source for the Sync Pulse Sender. You can use this source to synchronize the Sync Pulse Sender with an external non-TClk source. + Values + Empty string. Empty string is a valid value, indicating that the signal is not exported. + PXI Devices - 'PXI_Trig0' through 'PXI_Trig7' and device-specific settings + PCI Devices - 'RTSI_0' through 'RTSI_7' and device-specific settings + Examples of Device-Specific Settings + - NI PXI-5122 supports 'PFI0' and 'PFI1' + - NI PXI-5421 supports 'PFI0', 'PFI1', 'PFI4', and 'PFI5' + - NI PXI-6551/6552 supports 'PFI0', 'PFI1', 'PFI2', and 'PFI3' + Default Value is empty string + + The following table lists the characteristics of this property. + + +----------------+------------+ + | Characteristic | Value | + +================+============+ + | Datatype | str | + +----------------+------------+ + | Permissions | read-write | + +----------------+------------+ + | Channel Based | No | + +----------------+------------+ + | Resettable | No | + +----------------+------------+ + + .. tip:: + This property corresponds to the following LabVIEW Property or C Attribute: + + - LabVIEW Property: **External Pulse Source** + - C Attribute: **NITCLK_ATTR_SYNC_PULSE_SENDER_SYNC_PULSE_SOURCE** + +sync_pulse_source +~~~~~~~~~~~~~~~~~ + + .. py:currentmodule:: nitclk.Session + + .. py:attribute:: sync_pulse_source + + Specifies the Sync Pulse source. This property is most often used when synchronizing a multichassis system. + Values + Empty string + PXI Devices - 'PXI_Trig0' through 'PXI_Trig7' and device-specific settings + PCI Devices - 'RTSI_0' through 'RTSI_7' and device-specific settings + Examples of Device-Specific Settings + - NI PXI-5122 supports 'PFI0' and 'PFI1' + - NI PXI-5421 supports 'PFI0', 'PFI1', 'PFI2', and 'PFI3' + - NI PXI-6551/6552 supports 'PFI0', 'PFI1', 'PFI2', and 'PFI3' + Default Value - Empty string. This default value directs :py:meth:`nitclk.Session.synchronize` to set this property when all the synchronized devices are in one PXI chassis. To synchronize a multichassis system, you must set this property before calling :py:meth:`nitclk.Session.synchronize`. + + The following table lists the characteristics of this property. + + +----------------+------------+ + | Characteristic | Value | + +================+============+ + | Datatype | str | + +----------------+------------+ + | Permissions | read-write | + +----------------+------------+ + | Channel Based | No | + +----------------+------------+ + | Resettable | No | + +----------------+------------+ + + .. tip:: + This property corresponds to the following LabVIEW Property or C Attribute: + + - LabVIEW Property: **Sync Pulse Source** + - C Attribute: **NITCLK_ATTR_SYNC_PULSE_SOURCE** + +tclk_actual_period +~~~~~~~~~~~~~~~~~~ + + .. py:currentmodule:: nitclk.Session + + .. py:attribute:: tclk_actual_period + + Indicates the computed TClk period that will be used during the acquisition. + + The following table lists the characteristics of this property. + + +----------------+-----------+ + | Characteristic | Value | + +================+===========+ + | Datatype | float | + +----------------+-----------+ + | Permissions | read only | + +----------------+-----------+ + | Channel Based | No | + +----------------+-----------+ + | Resettable | No | + +----------------+-----------+ + + .. tip:: + This property corresponds to the following LabVIEW Property or C Attribute: + + - LabVIEW Property: **Period** + - C Attribute: **NITCLK_ATTR_TCLK_ACTUAL_PERIOD** + + +Methods +------- + + +configure_for_homogeneous_triggers +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + .. py:currentmodule:: nitclk.Session + + .. py:method:: configure_for_homogeneous_triggers(sessions) + + Configures the properties commonly required for the TClk synchronization + of device sessions with homogeneous triggers in a single PXI chassis or + a single PC. Use :py:meth:`nitclk.Session.configure_for_homogeneous_triggers` to configure + the properties for the reference clocks, start triggers, reference + triggers, script triggers, and pause triggers. If + :py:meth:`nitclk.Session.configure_for_homogeneous_triggers` cannot perform all the steps + appropriate for the given sessions, it returns an error. If an error is + returned, use the instrument driver methods and properties for signal + routing, along with the following NI-TClk properties: + :py:data:`nitclk.Session.start_trigger_master_session` + :py:data:`nitclk.Session.ref_trigger_master_session` + :py:data:`nitclk.Session.script_trigger_master_session` + :py:data:`nitclk.Session.pause_trigger_master_session` + :py:meth:`nitclk.Session.configure_for_homogeneous_triggers` affects the following clocks and + triggers: - Reference clocks - Start triggers - Reference triggers - + Script triggers - Pause triggers Reference Clocks + :py:meth:`nitclk.Session.configure_for_homogeneous_triggers` configures the reference clocks + if they are needed. Specifically, if the internal sample clocks or + internal sample clock timebases are used, and the reference clock source + is not configured--or is set to None (no trigger + configured)--:py:meth:`nitclk.Session.configure_for_homogeneous_triggers` configures the + following: PXI--The reference clock source on all devices is set to be + the 10 MHz PXI backplane clock (PXI_CLK10). PCI--One of the devices + exports its 10 MHz onboard reference clock to RTSI 7. The reference + clock source on all devices is set to be RTSI 7. Note: If the reference + clock source is set to a value other than None, + :py:meth:`nitclk.Session.configure_for_homogeneous_triggers` cannot configure the reference + clock source. Start Triggers If the start trigger is set to None (no + trigger configured) for all sessions, the sessions are configured to + share the start trigger. The start trigger is shared by: - Implicitly + exporting the start trigger from one session - Configuring the other + sessions for digital edge start triggers with sources corresponding to + the exported start trigger - Setting + :py:data:`nitclk.Session.start_trigger_master_session` to the session that is + exporting the trigger for all sessions If the start triggers are None + for all except one session, :py:meth:`nitclk.Session.configure_for_homogeneous_triggers` + configures the sessions to share the start trigger from the one excepted + session. The start trigger is shared by: - Implicitly exporting start + trigger from the session with the start trigger that is not None - + Configuring the other sessions for digital-edge start triggers with + sources corresponding to the exported start trigger - Setting + :py:data:`nitclk.Session.start_trigger_master_session` to the session that is + exporting the trigger for all sessions If start triggers are configured + for all sessions, :py:meth:`nitclk.Session.configure_for_homogeneous_triggers` does not + affect the start triggers. Start triggers are considered to be + configured for all sessions if either of the following conditions is + true: - No session has a start trigger that is None - One session has a + start trigger that is None, and all other sessions have start triggers + other than None. The one session with the None trigger must have + :py:data:`nitclk.Session.start_trigger_master_session` set to itself, indicating + that the session itself is the start trigger master Reference Triggers + :py:meth:`nitclk.Session.configure_for_homogeneous_triggers` configures sessions that support + reference triggers to share the reference triggers if the reference + triggers are None (no trigger configured) for all except one session. + The reference triggers are shared by: - Implicitly exporting the + reference trigger from the session whose reference trigger is not None - + Configuring the other sessions that support the reference trigger for + digital-edge reference triggers with sources corresponding to the + exported reference trigger - Setting + :py:data:`nitclk.Session.ref_trigger_master_session` to the session that is + exporting the trigger for all sessions that support reference trigger If + the reference triggers are configured for all sessions that support + reference triggers, :py:meth:`nitclk.Session.configure_for_homogeneous_triggers` does not + affect the reference triggers. Reference triggers are considered to be + configured for all sessions if either one or the other of the following + conditions is true: - No session has a reference trigger that is None - + One session has a reference trigger that is None, and all other sessions + have reference triggers other than None. The one session with the None + trigger must have :py:data:`nitclk.Session.ref_trigger_master_session` set to + itself, indicating that the session itself is the reference trigger + master Reference Trigger Holdoffs Acquisition sessions may be configured + with the reference trigger. For acquisition sessions, when the reference + trigger is shared, :py:meth:`nitclk.Session.configure_for_homogeneous_triggers` configures + the holdoff properties (which are instrument driver specific) on the + reference trigger master session so that the session does not recognize + the reference trigger before the other sessions are ready. This + condition is only relevant when the sample clock rates, sample clock + timebase rates, sample counts, holdoffs, and/or any delays for the + acquisitions are different. When the sample clock rates, sample clock + timebase rates, and/or the sample counts are different in acquisition + sessions sharing the reference trigger, you should also set the holdoff + properties for the reference trigger master using the instrument driver. + Script Triggers :py:meth:`nitclk.Session.configure_for_homogeneous_triggers` configures + sessions that support script triggers to share them, if the script + triggers are None (no trigger configured) for all except one session. + The script triggers are shared in the following ways: - Implicitly + exporting the script trigger from the session whose script trigger is + not None - Configuring the other sessions that support the script + trigger for digital-edge script triggers with sources corresponding to + the exported script trigger - Setting + :py:data:`nitclk.Session.script_trigger_master_session` to the session that is + exporting the trigger for all sessions that support script triggers If + the script triggers are configured for all sessions that support script + triggers, :py:meth:`nitclk.Session.configure_for_homogeneous_triggers` does not affect script + triggers. Script triggers are considered to be configured for all + sessions if either one or the other of the following conditions are + true: - No session has a script trigger that is None - One session has a + script trigger that is None and all other sessions have script triggers + other than None. The one session with the None trigger must have + :py:data:`nitclk.Session.script_trigger_master_session` set to itself, indicating + that the session itself is the script trigger master Pause Triggers + :py:meth:`nitclk.Session.configure_for_homogeneous_triggers` configures generation sessions + that support pause triggers to share them, if the pause triggers are + None (no trigger configured) for all except one session. The pause + triggers are shared by: - Implicitly exporting the pause trigger from + the session whose script trigger is not None - Configuring the other + sessions that support the pause trigger for digital-edge pause triggers + with sources corresponding to the exported pause trigger - Setting + :py:data:`nitclk.Session.pause_trigger_master_session` to the session that is + exporting the trigger for all sessions that support script triggers If + the pause triggers are configured for all generation sessions that + support pause triggers, :py:meth:`nitclk.Session.configure_for_homogeneous_triggers` does not + affect pause triggers. Pause triggers are considered to be configured + for all sessions if either one or the other of the following conditions + is true: - No session has a pause trigger that is None - One session has + a pause trigger that is None and all other sessions have pause triggers + other than None. The one session with the None trigger must have + :py:data:`nitclk.Session.pause_trigger_master_session` set to itself, indicating + that the session itself is the pause trigger master Note: TClk + synchronization is not supported for pause triggers on acquisition + sessions. + + + + + + :param sessions: + + + sessions is an array of sessions that are being synchronized. + + + + + :type sessions: list of int + +finish_sync_pulse_sender_synchronize +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + .. py:currentmodule:: nitclk.Session + + .. py:method:: finish_sync_pulse_sender_synchronize(sessions, min_time) + + TBD + + + + + + :param sessions: + + + sessions is an array of sessions that are being synchronized. + + + + + :type sessions: list of int + :param min_time: + + + Minimal period of TClk, expressed in seconds. Supported values are + between 0.0 s and 0.050 s (50 ms). Minimal period for a single + chassis/PC is 200 ns. If the specified value is less than 200 ns, + NI-TClk automatically coerces minTime to 200 ns. For multichassis + synchronization, adjust this value to account for propagation delays + through the various devices and cables. + + + + + :type min_time: float + +init_for_documentation +~~~~~~~~~~~~~~~~~~~~~~ + + .. py:currentmodule:: nitclk.Session + + .. py:method:: init_for_documentation() + + TBD + + + + + +initiate +~~~~~~~~ + + .. py:currentmodule:: nitclk.Session + + .. py:method:: initiate(sessions) + + Initiates the acquisition or generation sessions specified, taking into + consideration any special requirements needed for synchronization. For + example, the session exporting the TClk-synchronized start trigger is + not initiated until after :py:meth:`nitclk.Session.initiate` initiates all the sessions + that import the TClk-synchronized start trigger. + + + + + + :param sessions: + + + sessions is an array of sessions that are being synchronized. + + + + + :type sessions: list of int + +is_done +~~~~~~~ + + .. py:currentmodule:: nitclk.Session + + .. py:method:: is_done(sessions) + + Monitors the progress of the acquisitions and/or generations + corresponding to sessions. + + + + + + :param sessions: + + + sessions is an array of sessions that are being synchronized. + + + + + :type sessions: list of int + + :rtype: bool + :return: + + + Indicates that the operation is done. The operation is done when each + session has completed without any errors or when any one of the sessions + reports an error. + + + + + +setup_for_sync_pulse_sender_synchronize +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + .. py:currentmodule:: nitclk.Session + + .. py:method:: setup_for_sync_pulse_sender_synchronize(sessions, min_time) + + TBD + + + + + + :param sessions: + + + sessions is an array of sessions that are being synchronized. + + + + + :type sessions: list of int + :param min_time: + + + Minimal period of TClk, expressed in seconds. Supported values are + between 0.0 s and 0.050 s (50 ms). Minimal period for a single + chassis/PC is 200 ns. If the specified value is less than 200 ns, + NI-TClk automatically coerces minTime to 200 ns. For multichassis + synchronization, adjust this value to account for propagation delays + through the various devices and cables. + + + + + :type min_time: float + +synchronize +~~~~~~~~~~~ + + .. py:currentmodule:: nitclk.Session + + .. py:method:: synchronize(sessions, min_tclk_period=datetime.timedelta(seconds=0.0)) + + Synchronizes the TClk signals on the given sessions. After + :py:meth:`nitclk.Session.synchronize` executes, TClk signals from all sessions are + synchronized. Note: Before using this NI-TClk method, verify that your + system is configured as specified in the PXI Trigger Lines and RTSI + Lines topic of the NI-TClk Synchronization Help. You can locate this + help file at Start>>Programs>>National Instruments>>NI-TClk. + + + + + + :param sessions: + + + sessions is an array of sessions that are being synchronized. + + + + + :type sessions: list of int + :param min_tclk_period: + + + Minimal period of TClk, expressed in seconds. Supported values are + between 0.0 s and 0.050 s (50 ms). Minimal period for a single + chassis/PC is 200 ns. If the specified value is less than 200 ns, + NI-TClk automatically coerces minTime to 200 ns. For multichassis + synchronization, adjust this value to account for propagation delays + through the various devices and cables. + + + + + :type min_tclk_period: float in seconds or datetime.timedelta + +synchronize_to_sync_pulse_sender +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + .. py:currentmodule:: nitclk.Session + + .. py:method:: synchronize_to_sync_pulse_sender(sessions, min_time) + + TBD + + + + + + :param sessions: + + + sessions is an array of sessions that are being synchronized. + + + + + :type sessions: list of int + :param min_time: + + + Minimal period of TClk, expressed in seconds. Supported values are + between 0.0 s and 0.050 s (50 ms). Minimal period for a single + chassis/PC is 200 ns. If the specified value is less than 200 ns, + NI-TClk automatically coerces minTime to 200 ns. For multichassis + synchronization, adjust this value to account for propagation delays + through the various devices and cables. + + + + + :type min_time: float + +wait_until_done +~~~~~~~~~~~~~~~ + + .. py:currentmodule:: nitclk.Session + + .. py:method:: wait_until_done(sessions, timeout) + + Call this method to pause execution of your program until the + acquisitions and/or generations corresponding to sessions are done or + until the method returns a timeout error. :py:meth:`nitclk.Session.wait_until_done` is a + blocking method that periodically checks the operation status. It + returns control to the calling program if the operation completes + successfully or an error occurs (including a timeout error). This + method is most useful for finite data operations that you expect to + complete within a certain time. + + + + + + :param sessions: + + + sessions is an array of sessions that are being synchronized. + + + + + :type sessions: list of int + :param timeout: + + + The amount of time in seconds that :py:meth:`nitclk.Session.wait_until_done` waits for the + sessions to complete. If timeout is exceeded, :py:meth:`nitclk.Session.wait_until_done` + returns an error. + + + + + :type timeout: float + + + +Properties +---------- + ++---------------------------------------------------------------+----------------------------------------------------------------------------+ +| Property | Datatype | ++===============================================================+============================================================================+ +| :py:attr:`nitclk.Session.exported_sync_pulse_output_terminal` | str | ++---------------------------------------------------------------+----------------------------------------------------------------------------+ +| :py:attr:`nitclk.Session.exported_tclk_output_terminal` | str | ++---------------------------------------------------------------+----------------------------------------------------------------------------+ +| :py:attr:`nitclk.Session.pause_trigger_master_session` | nimi-python Session class, nitclk.SessionReference, NI-TClk Session Number | ++---------------------------------------------------------------+----------------------------------------------------------------------------+ +| :py:attr:`nitclk.Session.ref_trigger_master_session` | nimi-python Session class, nitclk.SessionReference, NI-TClk Session Number | ++---------------------------------------------------------------+----------------------------------------------------------------------------+ +| :py:attr:`nitclk.Session.sample_clock_delay` | float | ++---------------------------------------------------------------+----------------------------------------------------------------------------+ +| :py:attr:`nitclk.Session.script_trigger_master_session` | nimi-python Session class, nitclk.SessionReference, NI-TClk Session Number | ++---------------------------------------------------------------+----------------------------------------------------------------------------+ +| :py:attr:`nitclk.Session.sequencer_flag_master_session` | nimi-python Session class, nitclk.SessionReference, NI-TClk Session Number | ++---------------------------------------------------------------+----------------------------------------------------------------------------+ +| :py:attr:`nitclk.Session.start_trigger_master_session` | nimi-python Session class, nitclk.SessionReference, NI-TClk Session Number | ++---------------------------------------------------------------+----------------------------------------------------------------------------+ +| :py:attr:`nitclk.Session.sync_pulse_clock_source` | str | ++---------------------------------------------------------------+----------------------------------------------------------------------------+ +| :py:attr:`nitclk.Session.sync_pulse_sender_sync_pulse_source` | str | ++---------------------------------------------------------------+----------------------------------------------------------------------------+ +| :py:attr:`nitclk.Session.sync_pulse_source` | str | ++---------------------------------------------------------------+----------------------------------------------------------------------------+ +| :py:attr:`nitclk.Session.tclk_actual_period` | float | ++---------------------------------------------------------------+----------------------------------------------------------------------------+ + +Methods +------- + ++-------------------------------------------------------------------+ +| Method name | ++===================================================================+ +| :py:func:`nitclk.Session.configure_for_homogeneous_triggers` | ++-------------------------------------------------------------------+ +| :py:func:`nitclk.Session.finish_sync_pulse_sender_synchronize` | ++-------------------------------------------------------------------+ +| :py:func:`nitclk.Session.init_for_documentation` | ++-------------------------------------------------------------------+ +| :py:func:`nitclk.Session.initiate` | ++-------------------------------------------------------------------+ +| :py:func:`nitclk.Session.is_done` | ++-------------------------------------------------------------------+ +| :py:func:`nitclk.Session.setup_for_sync_pulse_sender_synchronize` | ++-------------------------------------------------------------------+ +| :py:func:`nitclk.Session.synchronize` | ++-------------------------------------------------------------------+ +| :py:func:`nitclk.Session.synchronize_to_sync_pulse_sender` | ++-------------------------------------------------------------------+ +| :py:func:`nitclk.Session.wait_until_done` | ++-------------------------------------------------------------------+ + diff --git a/docs/nitclk/errors.rst b/docs/nitclk/errors.rst new file mode 100644 index 000000000..3ea9e8455 --- /dev/null +++ b/docs/nitclk/errors.rst @@ -0,0 +1,62 @@ +Exceptions and Warnings +======================= + +DriverError +----------- + + .. py:currentmodule:: nitclk + + .. exception:: DriverError + + An error originating from the NI-TClk driver + + +UnsupportedConfigurationError +----------------------------- + + .. py:currentmodule:: nitclk + + .. exception:: UnsupportedConfigurationError + + An error due to using this module in an usupported platform. + +DriverNotInstalledError +----------------------- + + .. py:currentmodule:: nitclk + + .. exception:: DriverNotInstalledError + + An error due to using this module without the driver runtime installed. + +InvalidRepeatedCapabilityError +------------------------------ + + .. py:currentmodule:: nitclk + + .. exception:: InvalidRepeatedCapabilityError + + An error due to an invalid character in a repeated capability + + +SelfTestError +------------- + + .. py:currentmodule:: nitclk + + .. exception:: SelfTestError + + An error due to a failed self-test + + +DriverWarning +------------- + + .. py:currentmodule:: nitclk + + .. exception:: DriverWarning + + A warning originating from the NI-TClk driver + + + diff --git a/docs/nitclk/installation.inc b/docs/nitclk/installation.inc new file mode 100644 index 000000000..1c705daad --- /dev/null +++ b/docs/nitclk/installation.inc @@ -0,0 +1,18 @@ + +.. _nitclk_installation-section: + +Installation +------------ + +As a prerequisite to using the nitclk module, you must install the NI-TClk runtime on your system. Visit `ni.com/downloads `_ to download the driver runtime for your devices. + +The nimi-python modules (i.e. for **NI-TClk**) can be installed with `pip `_:: + + $ python -m pip install nitclk~=0.1.0.dev0 + +Or **easy_install** from +`setuptools `_:: + + $ python -m easy_install nitclk + + diff --git a/docs/nitclk/status.inc b/docs/nitclk/status.inc new file mode 100644 index 000000000..e0c88c36f --- /dev/null +++ b/docs/nitclk/status.inc @@ -0,0 +1,41 @@ + +NI-TClk Python API Status +------------------------- + ++-------------------------------+-----------------------+ +| NI-TClk (nitclk) | | ++===============================+=======================+ +| Driver Version Tested Against | 18.0.0 | ++-------------------------------+-----------------------+ +| Driver API Version | 255.0.0d0 | ++-------------------------------+-----------------------+ +| PyPI Version | |nitclkLatestVersion| | ++-------------------------------+-----------------------+ +| Supported Python Version | |nitclkPythonVersion| | ++-------------------------------+-----------------------+ +| Open Issues | |nitclkOpenIssues| | ++-------------------------------+-----------------------+ +| Open Pull Requests | |nitclkOpenPRs| | ++-------------------------------+-----------------------+ + + +.. |nitclkLatestVersion| image:: http://img.shields.io/pypi/v/nitclk.svg + :alt: Latest NI-TClk Version + :target: http://pypi.python.org/pypi/nitclk + + +.. |nitclkPythonVersion| image:: http://img.shields.io/pypi/pyversions/nitclk.svg + :alt: NI-TClk supported Python versions + :target: http://pypi.python.org/pypi/nitclk + + +.. |nitclkOpenIssues| image:: https://img.shields.io/github/issues/ni/nimi-python/nitclk.svg + :alt: Open Issues + Pull Requests for NI-TClk + :target: https://github.com/ni/nimi-python/issues?q=is%3Aopen+is%3Aissue+label%3Anitclk + + +.. |nitclkOpenPRs| image:: https://img.shields.io/github/issues-pr/ni/nimi-python/nitclk.svg + :alt: Pull Requests for NI-TClk + :target: https://github.com/ni/nimi-python/pulls?q=is%3Aopen+is%3Aissue+label%3Anitclk + + diff --git a/docs/nitclk/toc.inc b/docs/nitclk/toc.inc new file mode 100644 index 000000000..f0f601180 --- /dev/null +++ b/docs/nitclk/toc.inc @@ -0,0 +1,10 @@ +API Reference +-------------- + +.. toctree:: + :maxdepth: 6 + + nitclk/class + nitclk/errors + nitclk/examples + diff --git a/generated/nitclk/_attributes.py b/generated/nitclk/_attributes.py new file mode 100644 index 000000000..c9bb6426a --- /dev/null +++ b/generated/nitclk/_attributes.py @@ -0,0 +1,112 @@ +# -*- coding: utf-8 -*- +# This file was generated +import nitclk._converters as _converters + +import datetime + + +class Attribute(object): + '''Base class for all typed attributes.''' + + def __init__(self, attribute_id): + self._attribute_id = attribute_id + + +class AttributeViInt32(Attribute): + + def __get__(self, session, session_type): + return session._get_attribute_vi_int32(self._attribute_id) + + def __set__(self, session, value): + session._set_attribute_vi_int32(self._attribute_id, value) + + +class AttributeViInt32TimeDeltaSeconds(Attribute): + + def __get__(self, session, session_type): + return datetime.timedelta(seconds=session._get_attribute_vi_int32(self._attribute_id)) + + def __set__(self, session, value): + session._set_attribute_vi_int32(self._attribute_id, _converters.convert_timedelta_to_seconds(value, int)) + + +class AttributeViInt32TimeDeltaMilliseconds(Attribute): + + def __get__(self, session, session_type): + return datetime.timedelta(milliseconds=session._get_attribute_vi_int32(self._attribute_id)) + + def __set__(self, session, value): + session._set_attribute_vi_int32(self._attribute_id, _converters.convert_timedelta_to_milliseconds(value, int)) + + +class AttributeViInt64(Attribute): + + def __get__(self, session, session_type): + return session._get_attribute_vi_int64(self._attribute_id) + + def __set__(self, session, value): + session._set_attribute_vi_int64(self._attribute_id, value) + + +class AttributeViReal64(Attribute): + + def __get__(self, session, session_type): + return session._get_attribute_vi_real64(self._attribute_id) + + def __set__(self, session, value): + session._set_attribute_vi_real64(self._attribute_id, value) + + +class AttributeViReal64TimeDeltaSeconds(Attribute): + + def __get__(self, session, session_type): + return datetime.timedelta(seconds=session._get_attribute_vi_real64(self._attribute_id)) + + def __set__(self, session, value): + session._set_attribute_vi_real64(self._attribute_id, _converters.convert_timedelta_to_seconds(value, float)) + + +class AttributeViReal64TimeDeltaMilliseconds(Attribute): + + def __get__(self, session, session_type): + return datetime.timedelta(milliseconds=session._get_attribute_vi_real64(self._attribute_id)) + + def __set__(self, session, value): + session._set_attribute_vi_real64(self._attribute_id, _converters.convert_timedelta_to_milliseconds(value, float)) + + +class AttributeViString(Attribute): + + def __get__(self, session, session_type): + return session._get_attribute_vi_string(self._attribute_id) + + def __set__(self, session, value): + session._set_attribute_vi_string(self._attribute_id, value) + + +class AttributeViBoolean(Attribute): + + def __get__(self, session, session_type): + return session._get_attribute_vi_boolean(self._attribute_id) + + def __set__(self, session, value): + session._set_attribute_vi_boolean(self._attribute_id, value) + + +class AttributeEnum(object): + + def __init__(self, underlying_attribute_meta_class, enum_meta_class, attribute_id): + self._underlying_attribute = underlying_attribute_meta_class(attribute_id) + self._attribute_type = enum_meta_class + self._attribute_id = attribute_id + + def __get__(self, session, session_type): + return self._attribute_type(self._underlying_attribute.__get__(session, session_type)) + + def __set__(self, session, value): + if type(value) is not self._attribute_type: + raise TypeError('must be ' + str(self._attribute_type.__name__) + ' not ' + str(type(value).__name__)) + return self._underlying_attribute.__set__(session, value.value) + + + diff --git a/generated/nitclk/_converters.py b/generated/nitclk/_converters.py new file mode 100644 index 000000000..4b1211879 --- /dev/null +++ b/generated/nitclk/_converters.py @@ -0,0 +1,503 @@ +# -*- coding: utf-8 -*- +# This file was generated +import nitclk._visatype as _visatype +import nitclk.errors as errors + +import datetime +import numbers +import six + +try: + from functools import singledispatch # Python 3.4+ +except ImportError: + from singledispatch import singledispatch # Python 2.7 + + +@singledispatch +def _convert_repeated_capabilities(arg, prefix): # noqa: F811 + '''Base version that should not be called + + Overall purpose is to convert the repeated capabilities to a list of strings with prefix from what ever form + + Supported types: + - str - List (comma delimited) + - str - Range (using '-' or ':') + - str - single item + - int + - tuple + - range + - slice + + Each instance should return a list of strings, without prefix + - '0' --> ['0'] + - 0 --> ['0'] + - '0, 1' --> ['0', '1'] + - 'ScriptTrigger0, ScriptTrigger1' --> ['0', '1'] + - '0-1' --> ['0', '1'] + - '0:1' --> ['0', '1'] + - '0-1,4' --> ['0', '1', '4'] + - range(0, 2) --> ['0', '1'] + - slice(0, 2) --> ['0', '1'] + - (0, 1, 4) --> ['0', '1', '4'] + - ('0-1', 4) --> ['0', '1', '4'] + - (slice(0, 1), '2', [4, '5-6'], '7-9', '11:14', '16, 17') --> + ['0', '2', '4', '5', '6', '7', '8', '9', '11', '12', '13', '14', '16', '17'] + ''' + raise errors.InvalidRepeatedCapabilityError('Invalid type', type(arg)) + + +@_convert_repeated_capabilities.register(numbers.Integral) # noqa: F811 +def _(repeated_capability, prefix): + '''Integer version''' + return [str(repeated_capability)] + + +# This parsing function duplicate the parsing in the driver, so if changes to the allowed format are made there, they will need to be replicated here. +@_convert_repeated_capabilities.register(six.text_type) # noqa: F811 +@_convert_repeated_capabilities.register(str) # noqa: F811 +def _(repeated_capability, prefix): + '''String version (this is the most complex) + + We need to deal with a range ('0-3' or '0:3'), a list ('0,1,2,3') and a single item + ''' + # First we deal with a list + rep_cap_list = repeated_capability.split(',') + if len(rep_cap_list) > 1: + # We have a list so call ourselves again to let the iterable instance handle it + return _convert_repeated_capabilities(rep_cap_list, prefix) + + # Now we deal with ranges + # We remove any prefix and change ':' to '-' + r = repeated_capability.strip().replace(prefix, '').replace(':', '-') + rc = r.split('-') + if len(rc) > 1: + if len(rc) > 2: + raise errors.InvalidRepeatedCapabilityError("Multiple '-' or ':'", repeated_capability) + start = int(rc[0]) + end = int(rc[1]) + if end < start: + rng = range(start, end - 1, -1) + else: + rng = range(start, end + 1) + return _convert_repeated_capabilities(rng, prefix) + + # If we made it here, it must be a simple item so we remove any prefix and return + return [repeated_capability.replace(prefix, '').strip()] + + +# We cannot use collections.abc.Iterable here because strings are also iterable and then this +# instance is what gets called instead of the string one. +@_convert_repeated_capabilities.register(list) # noqa: F811 +@_convert_repeated_capabilities.register(range) # noqa: F811 +@_convert_repeated_capabilities.register(tuple) # noqa: F811 +def _(repeated_capability, prefix): + '''Iterable version - can handle lists, ranges, and tuples''' + rep_cap_list = [] + for r in repeated_capability: + rep_cap_list += _convert_repeated_capabilities(r, prefix) + return rep_cap_list + + +@_convert_repeated_capabilities.register(slice) # noqa: F811 +def _(repeated_capability, prefix): + '''slice version''' + def ifnone(a, b): + return b if a is None else a + # Turn the slice into a list and call ourselves again to let the iterable instance handle it + rng = range(ifnone(repeated_capability.start, 0), repeated_capability.stop, ifnone(repeated_capability.step, 1)) + return _convert_repeated_capabilities(rng, prefix) + + +def convert_repeated_capabilities(repeated_capability, prefix=''): + '''Convert a repeated capabilities object to a comma delimited list + + Args: + repeated_capability (str, list, tuple, slice, None) - + prefix (str) - common prefix for all strings + + Returns: + rep_cal_list (list of str) - list of each repeated capability item with ranges expanded and prefix added + ''' + # We need to explicitly handle None here. Everything else we can pass on to the singledispatch functions + if repeated_capability is None: + return [] + return [prefix + r for r in _convert_repeated_capabilities(repeated_capability, prefix)] + + +def convert_repeated_capabilities_from_init(repeated_capability, encoding): + '''Convert a repeated capabilities object to a comma delimited list + + Parameter list is so it can be called from the code generated __init__(). We know it is for channels when called + this was so we use a prefix of '' + + Args: + repeated_capability (str, list, tuple, slice, None) - + encoding (str) - ignored for this converter + + Returns: + rep_cal (str) - comma delimited string of each repeated capability item with ranges expanded + ''' + return ','.join(convert_repeated_capabilities(repeated_capability, '')) + + +def _convert_timedelta(value, library_type, scaling): + try: + # We first assume it is a datetime.timedelta object + scaled_value = value.total_seconds() * scaling + except AttributeError: + # If that doesn't work, assume it is a value in seconds + # cast to float so scaled_value is always a float. This allows `timeout=10` to work as expected + scaled_value = float(value) * scaling + + # ctype integer types don't convert to int from float so we need to + if library_type in [_visatype.ViInt64, _visatype.ViInt32, _visatype.ViUInt32, _visatype.ViInt16, _visatype.ViUInt16, _visatype.ViInt8]: + scaled_value = int(scaled_value) + + return library_type(scaled_value) + + +def convert_timedelta_to_seconds(value, library_type): + return _convert_timedelta(value, library_type, 1) + + +def convert_timedelta_to_milliseconds(value, library_type): + return _convert_timedelta(value, library_type, 1000) + + +def convert_timedelta_to_microseconds(value, library_type): + return _convert_timedelta(value, library_type, 1000000) + + +def convert_month_to_timedelta(months): + return datetime.timedelta(days=(30.4167 * months)) + + +# This converter is not called from the normal codegen path for function. Instead it is +# call from init and is a special case. Also, it just returns a string rather than a ctype object +def convert_init_with_options_dictionary(values, encoding): + if type(values) is str: + init_with_options_string = values + else: + good_keys = { + 'rangecheck': 'RangeCheck', + 'queryinstrstatus': 'QueryInstrStatus', + 'cache': 'Cache', + 'simulate': 'Simulate', + 'recordcoercions': 'RecordCoercions', + 'interchangecheck': 'InterchangeCheck', + 'driversetup': 'DriverSetup', + 'range_check': 'RangeCheck', + 'query_instr_status': 'QueryInstrStatus', + 'record_coercions': 'RecordCoercions', + 'interchange_check': 'InterchangeCheck', + 'driver_setup': 'DriverSetup', + } + init_with_options = [] + for k in sorted(values.keys()): + value = None + if k.lower() in good_keys and not good_keys[k.lower()] == 'DriverSetup': + value = good_keys[k.lower()] + ('=1' if values[k] is True else '=0') + elif k.lower() in good_keys and good_keys[k.lower()] == 'DriverSetup': + if not isinstance(values[k], dict): + raise TypeError('DriverSetup must be a dictionary') + value = 'DriverSetup=' + (';'.join([key + ':' + values[k][key] for key in sorted(values[k])])) + else: + value = k + ('=1' if values[k] is True else '=0') + + init_with_options.append(value) + + init_with_options_string = ','.join(init_with_options) + + return init_with_options_string + + +# Let's run some tests +def test_convert_init_with_options_dictionary(): + assert convert_init_with_options_dictionary('', 'ascii') == '' + assert convert_init_with_options_dictionary('Simulate=1', 'ascii') == 'Simulate=1' + assert convert_init_with_options_dictionary({'Simulate': True, }, 'ascii') == 'Simulate=1' + assert convert_init_with_options_dictionary({'Simulate': False, }, 'ascii') == 'Simulate=0' + assert convert_init_with_options_dictionary({'Simulate': True, 'Cache': False}, 'ascii') == 'Cache=0,Simulate=1' + assert convert_init_with_options_dictionary({'DriverSetup': {'Model': '5162 (4CH)', 'Bitfile': 'CustomProcessing'}}, 'ascii') == 'DriverSetup=Bitfile:CustomProcessing;Model:5162 (4CH)' + assert convert_init_with_options_dictionary({'Simulate': True, 'DriverSetup': {'Model': '5162 (4CH)', 'Bitfile': 'CustomProcessing'}}, 'ascii') == 'DriverSetup=Bitfile:CustomProcessing;Model:5162 (4CH),Simulate=1' + assert convert_init_with_options_dictionary({'simulate': True, 'cache': False}, 'ascii') == 'Cache=0,Simulate=1' + assert convert_init_with_options_dictionary({'driver_setup': {'Model': '5162 (4CH)', 'Bitfile': 'CustomProcessing'}}, 'ascii') == 'DriverSetup=Bitfile:CustomProcessing;Model:5162 (4CH)' + assert convert_init_with_options_dictionary({'simulate': True, 'driver_setup': {'Model': '5162 (4CH)', 'Bitfile': 'CustomProcessing'}}, 'ascii') == 'DriverSetup=Bitfile:CustomProcessing;Model:5162 (4CH),Simulate=1' + + +# Tests - time +def test_convert_timedelta_to_seconds_double(): + test_result = convert_timedelta_to_seconds(datetime.timedelta(seconds=10), _visatype.ViReal64) + assert test_result.value == 10.0 + assert isinstance(test_result, _visatype.ViReal64) + test_result = convert_timedelta_to_seconds(datetime.timedelta(seconds=-1), _visatype.ViReal64) + assert test_result.value == -1 + assert isinstance(test_result, _visatype.ViReal64) + test_result = convert_timedelta_to_seconds(10.5, _visatype.ViReal64) + assert test_result.value == 10.5 + assert isinstance(test_result, _visatype.ViReal64) + test_result = convert_timedelta_to_seconds(-1, _visatype.ViReal64) + assert test_result.value == -1 + assert isinstance(test_result, _visatype.ViReal64) + + +def test_convert_timedelta_to_seconds_int(): + test_result = convert_timedelta_to_seconds(datetime.timedelta(seconds=10), _visatype.ViInt32) + assert test_result.value == 10 + assert isinstance(test_result, _visatype.ViInt32) + test_result = convert_timedelta_to_seconds(datetime.timedelta(seconds=-1), _visatype.ViInt32) + assert test_result.value == -1 + assert isinstance(test_result, _visatype.ViInt32) + test_result = convert_timedelta_to_seconds(10.5, _visatype.ViInt32) + assert test_result.value == 10 + assert isinstance(test_result, _visatype.ViInt32) + test_result = convert_timedelta_to_seconds(-1, _visatype.ViInt32) + assert test_result.value == -1 + assert isinstance(test_result, _visatype.ViInt32) + + +def test_convert_timedelta_to_milliseconds_double(): + test_result = convert_timedelta_to_milliseconds(datetime.timedelta(seconds=10), _visatype.ViReal64) + assert test_result.value == 10000.0 + assert isinstance(test_result, _visatype.ViReal64) + test_result = convert_timedelta_to_milliseconds(datetime.timedelta(seconds=-1), _visatype.ViReal64) + assert test_result.value == -1000.0 + assert isinstance(test_result, _visatype.ViReal64) + test_result = convert_timedelta_to_milliseconds(10.5, _visatype.ViReal64) + assert test_result.value == 10500.0 + assert isinstance(test_result, _visatype.ViReal64) + test_result = convert_timedelta_to_milliseconds(-1, _visatype.ViReal64) + assert test_result.value == -1000.0 + assert isinstance(test_result, _visatype.ViReal64) + + +def test_convert_timedelta_to_milliseconds_int(): + test_result = convert_timedelta_to_milliseconds(datetime.timedelta(seconds=10), _visatype.ViInt32) + assert test_result.value == 10000 + assert isinstance(test_result, _visatype.ViInt32) + test_result = convert_timedelta_to_milliseconds(datetime.timedelta(seconds=-1), _visatype.ViInt32) + assert test_result.value == -1000 + assert isinstance(test_result, _visatype.ViInt32) + test_result = convert_timedelta_to_milliseconds(10.5, _visatype.ViInt32) + assert test_result.value == 10500 + assert isinstance(test_result, _visatype.ViInt32) + test_result = convert_timedelta_to_milliseconds(-1, _visatype.ViInt32) + assert test_result.value == -1000 + assert isinstance(test_result, _visatype.ViInt32) + + +def test_convert_timedelta_to_microseconds_double(): + test_result = convert_timedelta_to_microseconds(datetime.timedelta(seconds=10), _visatype.ViReal64) + assert test_result.value == 10000000.0 + assert isinstance(test_result, _visatype.ViReal64) + test_result = convert_timedelta_to_microseconds(datetime.timedelta(seconds=-1), _visatype.ViReal64) + assert test_result.value == -1000000.0 + assert isinstance(test_result, _visatype.ViReal64) + test_result = convert_timedelta_to_microseconds(10.5, _visatype.ViReal64) + assert test_result.value == 10500000.0 + assert isinstance(test_result, _visatype.ViReal64) + test_result = convert_timedelta_to_microseconds(-1, _visatype.ViReal64) + assert test_result.value == -1000000.0 + assert isinstance(test_result, _visatype.ViReal64) + + +def test_convert_timedelta_to_microseconds_int(): + test_result = convert_timedelta_to_microseconds(datetime.timedelta(seconds=10), _visatype.ViInt32) + assert test_result.value == 10000000 + assert isinstance(test_result, _visatype.ViInt32) + test_result = convert_timedelta_to_microseconds(datetime.timedelta(seconds=-1), _visatype.ViInt32) + assert test_result.value == -1000000 + assert isinstance(test_result, _visatype.ViInt32) + test_result = convert_timedelta_to_microseconds(10.5, _visatype.ViInt32) + assert test_result.value == 10500000 + assert isinstance(test_result, _visatype.ViInt32) + test_result = convert_timedelta_to_microseconds(-1, _visatype.ViInt32) + assert test_result.value == -1000000 + assert isinstance(test_result, _visatype.ViInt32) + + +# Tests - repeated capabilities +def test_repeated_capabilies_string_channel(): + test_result_list = convert_repeated_capabilities('0') + assert test_result_list == ['0'] + test_result_list = convert_repeated_capabilities('r0') + assert test_result_list == ['r0'] + test_result_list = convert_repeated_capabilities('0,1') + assert test_result_list == ['0', '1'] + + +def test_repeated_capabilies_string_prefix(): + test_result_list = convert_repeated_capabilities('0', prefix='ScriptTrigger') + assert test_result_list == ['ScriptTrigger0'] + + +def test_repeated_capabilies_list_channel(): + test_result_list = convert_repeated_capabilities(['0']) + assert test_result_list == ['0'] + test_result_list = convert_repeated_capabilities(['r0']) + assert test_result_list == ['r0'] + test_result_list = convert_repeated_capabilities(['0', '1']) + assert test_result_list == ['0', '1'] + test_result_list = convert_repeated_capabilities([0, 1]) + assert test_result_list == ['0', '1'] + test_result_list = convert_repeated_capabilities([0, 1, '3']) + assert test_result_list == ['0', '1', '3'] + + +def test_repeated_capabilies_list_prefix(): + test_result_list = convert_repeated_capabilities(['ScriptTrigger0', 'ScriptTrigger1'], prefix='ScriptTrigger') + assert test_result_list == ['ScriptTrigger0', 'ScriptTrigger1'] + test_result_list = convert_repeated_capabilities(['0'], prefix='ScriptTrigger') + assert test_result_list == ['ScriptTrigger0'] + test_result_list = convert_repeated_capabilities(['0', '1'], prefix='ScriptTrigger') + assert test_result_list == ['ScriptTrigger0', 'ScriptTrigger1'] + test_result_list = convert_repeated_capabilities([0, 1], prefix='ScriptTrigger') + assert test_result_list == ['ScriptTrigger0', 'ScriptTrigger1'] + + +def test_repeated_capabilies_tuple_channel(): + test_result_list = convert_repeated_capabilities(('0')) + assert test_result_list == ['0'] + test_result_list = convert_repeated_capabilities(('0,1')) + assert test_result_list == ['0', '1'] + test_result_list = convert_repeated_capabilities(('0', '1')) + assert test_result_list == ['0', '1'] + test_result_list = convert_repeated_capabilities((0, 1)) + assert test_result_list == ['0', '1'] + test_result_list = convert_repeated_capabilities((0, 1, '3')) + assert test_result_list == ['0', '1', '3'] + + +def test_repeated_capabilies_tuple_prefix(): + test_result_list = convert_repeated_capabilities(('ScriptTrigger0,ScriptTrigger1'), prefix='ScriptTrigger') + assert test_result_list == ['ScriptTrigger0', 'ScriptTrigger1'] + test_result_list = convert_repeated_capabilities(('0'), prefix='ScriptTrigger') + assert test_result_list == ['ScriptTrigger0'] + test_result_list = convert_repeated_capabilities(('0', '1'), prefix='ScriptTrigger') + assert test_result_list == ['ScriptTrigger0', 'ScriptTrigger1'] + test_result_list = convert_repeated_capabilities((0, 1), prefix='ScriptTrigger') + assert test_result_list == ['ScriptTrigger0', 'ScriptTrigger1'] + + +def test_repeated_capabilies_unicode(): + test_result_list = convert_repeated_capabilities(u'ScriptTrigger0,ScriptTrigger1', prefix='ScriptTrigger') + assert test_result_list == ['ScriptTrigger0', 'ScriptTrigger1'] + test_result_list = convert_repeated_capabilities(u'ScriptTrigger0,ScriptTrigger1', prefix=u'ScriptTrigger') + assert test_result_list == ['ScriptTrigger0', 'ScriptTrigger1'] + test_result_list = convert_repeated_capabilities('ScriptTrigger0,ScriptTrigger1', prefix=u'ScriptTrigger') + assert test_result_list == ['ScriptTrigger0', 'ScriptTrigger1'] + + +def test_repeated_capabilies_raw(): + test_result_list = convert_repeated_capabilities(r'ScriptTrigger0,ScriptTrigger1', prefix='ScriptTrigger') + assert test_result_list == ['ScriptTrigger0', 'ScriptTrigger1'] + test_result_list = convert_repeated_capabilities(r'ScriptTrigger0,ScriptTrigger1', prefix=r'ScriptTrigger') + assert test_result_list == ['ScriptTrigger0', 'ScriptTrigger1'] + test_result_list = convert_repeated_capabilities('ScriptTrigger0,ScriptTrigger1', prefix=r'ScriptTrigger') + assert test_result_list == ['ScriptTrigger0', 'ScriptTrigger1'] + test_result_list = convert_repeated_capabilities(r'ScriptTrigger0,ScriptTrigger1', prefix=u'ScriptTrigger') + assert test_result_list == ['ScriptTrigger0', 'ScriptTrigger1'] + test_result_list = convert_repeated_capabilities(r'ScriptTrigger0,ScriptTrigger1', prefix=r'ScriptTrigger') + assert test_result_list == ['ScriptTrigger0', 'ScriptTrigger1'] + test_result_list = convert_repeated_capabilities(u'ScriptTrigger0,ScriptTrigger1', prefix=r'ScriptTrigger') + assert test_result_list == ['ScriptTrigger0', 'ScriptTrigger1'] + + +def test_repeated_capabilies_slice_channel(): + test_result_list = convert_repeated_capabilities(slice(0, 1)) + assert test_result_list == ['0'] + test_result_list = convert_repeated_capabilities(slice(0, 2)) + assert test_result_list == ['0', '1'] + test_result_list = convert_repeated_capabilities(slice(None, 2)) + assert test_result_list == ['0', '1'] + + +def test_repeated_capabilies_mixed_channel(): + test_result_list = convert_repeated_capabilities((slice(0, 1), '2', [4, '5-6'], '7-9', '11:14', '16, 17')) + assert test_result_list == ['0', '2', '4', '5', '6', '7', '8', '9', '11', '12', '13', '14', '16', '17'] + test_result_list = convert_repeated_capabilities([slice(0, 1), '2', [4, '5-6'], '7-9', '11:14', '16, 17']) + assert test_result_list == ['0', '2', '4', '5', '6', '7', '8', '9', '11', '12', '13', '14', '16', '17'] + + +def test_repeated_capabilies_mixed_prefix(): + test_result_list = convert_repeated_capabilities((slice(0, 1), '2', [4, '5-6'], '7-9', '11:14', '16, 17'), prefix='ScriptTrigger') + assert test_result_list == ['ScriptTrigger0', 'ScriptTrigger2', 'ScriptTrigger4', 'ScriptTrigger5', 'ScriptTrigger6', 'ScriptTrigger7', 'ScriptTrigger8', 'ScriptTrigger9', 'ScriptTrigger11', 'ScriptTrigger12', 'ScriptTrigger13', 'ScriptTrigger14', 'ScriptTrigger16', 'ScriptTrigger17'] + test_result_list = convert_repeated_capabilities([slice(0, 1), '2', [4, '5-6'], '7-9', '11:14', '16, 17'], prefix='ScriptTrigger') + assert test_result_list == ['ScriptTrigger0', 'ScriptTrigger2', 'ScriptTrigger4', 'ScriptTrigger5', 'ScriptTrigger6', 'ScriptTrigger7', 'ScriptTrigger8', 'ScriptTrigger9', 'ScriptTrigger11', 'ScriptTrigger12', 'ScriptTrigger13', 'ScriptTrigger14', 'ScriptTrigger16', 'ScriptTrigger17'] + + +def test_invalid_repeated_capabilies(): + try: + convert_repeated_capabilities('6-8-10') + assert False + except errors.InvalidRepeatedCapabilityError: + pass + try: + convert_repeated_capabilities(['5', '6-8-10']) + assert False + except errors.InvalidRepeatedCapabilityError: + pass + try: + convert_repeated_capabilities(('5', '6-8-10')) + assert False + except errors.InvalidRepeatedCapabilityError: + pass + try: + convert_repeated_capabilities('5,6-8-10') + assert False + except errors.InvalidRepeatedCapabilityError: + pass + try: + convert_repeated_capabilities(5.0) + assert False + except errors.InvalidRepeatedCapabilityError: + pass + try: + convert_repeated_capabilities([5.0, '0']) + assert False + except errors.InvalidRepeatedCapabilityError: + pass + try: + convert_repeated_capabilities((5.0, '0')) + assert False + except errors.InvalidRepeatedCapabilityError: + pass + + +def test_repeated_capabilies_slice_prefix(): + test_result_list = convert_repeated_capabilities(slice(0, 1), prefix='ScriptTrigger') + assert test_result_list == ['ScriptTrigger0'] + test_result_list = convert_repeated_capabilities(slice(0, 2), prefix='ScriptTrigger') + assert test_result_list == ['ScriptTrigger0', 'ScriptTrigger1'] + test_result_list = convert_repeated_capabilities(slice(None, 2), prefix='ScriptTrigger') + assert test_result_list == ['ScriptTrigger0', 'ScriptTrigger1'] + + +def test_repeated_capabilies_from_init(): + test_result = convert_repeated_capabilities_from_init((slice(0, 1), '2', [4, '5-6'], '7-9', '11:14', '16, 17'), '') + assert test_result == '0,2,4,5,6,7,8,9,11,12,13,14,16,17' + + +def test_string_to_list_channel(): + test_result = _convert_repeated_capabilities('r0', '') + assert test_result == ['r0'] + test_result = _convert_repeated_capabilities(['0-2'], '') + assert test_result == ['0', '1', '2'] + test_result = _convert_repeated_capabilities(['3:7'], '') + assert test_result == ['3', '4', '5', '6', '7'] + test_result = _convert_repeated_capabilities(['2-0'], '') + assert test_result == ['2', '1', '0'] + test_result = _convert_repeated_capabilities(['2:0'], '') + assert test_result == ['2', '1', '0'] + + +def test_string_to_list_prefix(): + test_result = _convert_repeated_capabilities(['ScriptTrigger3-ScriptTrigger7'], 'ScriptTrigger') + assert test_result == ['3', '4', '5', '6', '7'] + test_result = _convert_repeated_capabilities(['ScriptTrigger3:ScriptTrigger7'], 'ScriptTrigger') + assert test_result == ['3', '4', '5', '6', '7'] + test_result = _convert_repeated_capabilities(['ScriptTrigger2-ScriptTrigger0'], 'ScriptTrigger') + assert test_result == ['2', '1', '0'] + test_result = _convert_repeated_capabilities(['ScriptTrigger2:ScriptTrigger0'], 'ScriptTrigger') + assert test_result == ['2', '1', '0'] + diff --git a/generated/nitclk/_library.py b/generated/nitclk/_library.py new file mode 100644 index 000000000..de9d04070 --- /dev/null +++ b/generated/nitclk/_library.py @@ -0,0 +1,173 @@ +# -*- coding: utf-8 -*- +# This file was generated + +import ctypes +import threading + +from nitclk._visatype import * # noqa: F403,H303 + + +class Library(object): + '''Library + + Wrapper around driver library. + Class will setup the correct ctypes information for every function on first call. + ''' + + def __init__(self, ctypes_library): + self._func_lock = threading.Lock() + self._library = ctypes_library + # We cache the cfunc object from the ctypes.CDLL object + self.niTClk_ConfigureForHomogeneousTriggers_cfunc = None + self.niTClk_FinishSyncPulseSenderSynchronize_cfunc = None + self.niTClk_GetAttributeViBoolean_cfunc = None + self.niTClk_GetAttributeViReal64_cfunc = None + self.niTClk_GetAttributeViSession_cfunc = None + self.niTClk_GetAttributeViString_cfunc = None + self.niTClk_GetExtendedErrorInfo_cfunc = None + self.niTClk_Initiate_cfunc = None + self.niTClk_IsDone_cfunc = None + self.niTClk_SetAttributeViBoolean_cfunc = None + self.niTClk_SetAttributeViReal64_cfunc = None + self.niTClk_SetAttributeViSession_cfunc = None + self.niTClk_SetAttributeViString_cfunc = None + self.niTClk_SetupForSyncPulseSenderSynchronize_cfunc = None + self.niTClk_Synchronize_cfunc = None + self.niTClk_SynchronizeToSyncPulseSender_cfunc = None + self.niTClk_WaitUntilDone_cfunc = None + + def niTClk_ConfigureForHomogeneousTriggers(self, session_count, sessions): # noqa: N802 + with self._func_lock: + if self.niTClk_ConfigureForHomogeneousTriggers_cfunc is None: + self.niTClk_ConfigureForHomogeneousTriggers_cfunc = self._library.niTClk_ConfigureForHomogeneousTriggers + self.niTClk_ConfigureForHomogeneousTriggers_cfunc.argtypes = [ViUInt32, ctypes.POINTER(ViSession)] # noqa: F405 + self.niTClk_ConfigureForHomogeneousTriggers_cfunc.restype = ViStatus # noqa: F405 + return self.niTClk_ConfigureForHomogeneousTriggers_cfunc(session_count, sessions) + + def niTClk_FinishSyncPulseSenderSynchronize(self, session_count, sessions, min_time): # noqa: N802 + with self._func_lock: + if self.niTClk_FinishSyncPulseSenderSynchronize_cfunc is None: + self.niTClk_FinishSyncPulseSenderSynchronize_cfunc = self._library.niTClk_FinishSyncPulseSenderSynchronize + self.niTClk_FinishSyncPulseSenderSynchronize_cfunc.argtypes = [ViUInt32, ctypes.POINTER(ViSession), ViReal64] # noqa: F405 + self.niTClk_FinishSyncPulseSenderSynchronize_cfunc.restype = ViStatus # noqa: F405 + return self.niTClk_FinishSyncPulseSenderSynchronize_cfunc(session_count, sessions, min_time) + + def niTClk_GetAttributeViBoolean(self, session, channel_name, attribute_id, value): # noqa: N802 + with self._func_lock: + if self.niTClk_GetAttributeViBoolean_cfunc is None: + self.niTClk_GetAttributeViBoolean_cfunc = self._library.niTClk_GetAttributeViBoolean + self.niTClk_GetAttributeViBoolean_cfunc.argtypes = [ViSession, ctypes.POINTER(ViChar), ViAttr, ctypes.POINTER(ViBoolean)] # noqa: F405 + self.niTClk_GetAttributeViBoolean_cfunc.restype = ViStatus # noqa: F405 + return self.niTClk_GetAttributeViBoolean_cfunc(session, channel_name, attribute_id, value) + + def niTClk_GetAttributeViReal64(self, session, channel_name, attribute_id, value): # noqa: N802 + with self._func_lock: + if self.niTClk_GetAttributeViReal64_cfunc is None: + self.niTClk_GetAttributeViReal64_cfunc = self._library.niTClk_GetAttributeViReal64 + self.niTClk_GetAttributeViReal64_cfunc.argtypes = [ViSession, ctypes.POINTER(ViChar), ViAttr, ctypes.POINTER(ViReal64)] # noqa: F405 + self.niTClk_GetAttributeViReal64_cfunc.restype = ViStatus # noqa: F405 + return self.niTClk_GetAttributeViReal64_cfunc(session, channel_name, attribute_id, value) + + def niTClk_GetAttributeViSession(self, session, channel_name, attribute_id, value): # noqa: N802 + with self._func_lock: + if self.niTClk_GetAttributeViSession_cfunc is None: + self.niTClk_GetAttributeViSession_cfunc = self._library.niTClk_GetAttributeViSession + self.niTClk_GetAttributeViSession_cfunc.argtypes = [ViSession, ctypes.POINTER(ViChar), ViAttr, ctypes.POINTER(ViSession)] # noqa: F405 + self.niTClk_GetAttributeViSession_cfunc.restype = ViStatus # noqa: F405 + return self.niTClk_GetAttributeViSession_cfunc(session, channel_name, attribute_id, value) + + def niTClk_GetAttributeViString(self, session, channel_name, attribute_id, buf_size, value): # noqa: N802 + with self._func_lock: + if self.niTClk_GetAttributeViString_cfunc is None: + self.niTClk_GetAttributeViString_cfunc = self._library.niTClk_GetAttributeViString + self.niTClk_GetAttributeViString_cfunc.argtypes = [ViSession, ctypes.POINTER(ViChar), ViAttr, ViInt32, ctypes.POINTER(ViChar)] # noqa: F405 + self.niTClk_GetAttributeViString_cfunc.restype = ViStatus # noqa: F405 + return self.niTClk_GetAttributeViString_cfunc(session, channel_name, attribute_id, buf_size, value) + + def niTClk_GetExtendedErrorInfo(self, error_string, error_string_size): # noqa: N802 + with self._func_lock: + if self.niTClk_GetExtendedErrorInfo_cfunc is None: + self.niTClk_GetExtendedErrorInfo_cfunc = self._library.niTClk_GetExtendedErrorInfo + self.niTClk_GetExtendedErrorInfo_cfunc.argtypes = [ctypes.POINTER(ViChar), ViUInt32] # noqa: F405 + self.niTClk_GetExtendedErrorInfo_cfunc.restype = ViStatus # noqa: F405 + return self.niTClk_GetExtendedErrorInfo_cfunc(error_string, error_string_size) + + def niTClk_Initiate(self, session_count, sessions): # noqa: N802 + with self._func_lock: + if self.niTClk_Initiate_cfunc is None: + self.niTClk_Initiate_cfunc = self._library.niTClk_Initiate + self.niTClk_Initiate_cfunc.argtypes = [ViUInt32, ctypes.POINTER(ViSession)] # noqa: F405 + self.niTClk_Initiate_cfunc.restype = ViStatus # noqa: F405 + return self.niTClk_Initiate_cfunc(session_count, sessions) + + def niTClk_IsDone(self, session_count, sessions, done): # noqa: N802 + with self._func_lock: + if self.niTClk_IsDone_cfunc is None: + self.niTClk_IsDone_cfunc = self._library.niTClk_IsDone + self.niTClk_IsDone_cfunc.argtypes = [ViUInt32, ctypes.POINTER(ViSession), ctypes.POINTER(ViBoolean)] # noqa: F405 + self.niTClk_IsDone_cfunc.restype = ViStatus # noqa: F405 + return self.niTClk_IsDone_cfunc(session_count, sessions, done) + + def niTClk_SetAttributeViBoolean(self, session, channel_name, attribute_id, value): # noqa: N802 + with self._func_lock: + if self.niTClk_SetAttributeViBoolean_cfunc is None: + self.niTClk_SetAttributeViBoolean_cfunc = self._library.niTClk_SetAttributeViBoolean + self.niTClk_SetAttributeViBoolean_cfunc.argtypes = [ViSession, ctypes.POINTER(ViChar), ViAttr, ViBoolean] # noqa: F405 + self.niTClk_SetAttributeViBoolean_cfunc.restype = ViStatus # noqa: F405 + return self.niTClk_SetAttributeViBoolean_cfunc(session, channel_name, attribute_id, value) + + def niTClk_SetAttributeViReal64(self, session, channel_name, attribute_id, value): # noqa: N802 + with self._func_lock: + if self.niTClk_SetAttributeViReal64_cfunc is None: + self.niTClk_SetAttributeViReal64_cfunc = self._library.niTClk_SetAttributeViReal64 + self.niTClk_SetAttributeViReal64_cfunc.argtypes = [ViSession, ctypes.POINTER(ViChar), ViAttr, ViReal64] # noqa: F405 + self.niTClk_SetAttributeViReal64_cfunc.restype = ViStatus # noqa: F405 + return self.niTClk_SetAttributeViReal64_cfunc(session, channel_name, attribute_id, value) + + def niTClk_SetAttributeViSession(self, session, channel_name, attribute_id, value): # noqa: N802 + with self._func_lock: + if self.niTClk_SetAttributeViSession_cfunc is None: + self.niTClk_SetAttributeViSession_cfunc = self._library.niTClk_SetAttributeViSession + self.niTClk_SetAttributeViSession_cfunc.argtypes = [ViSession, ctypes.POINTER(ViChar), ViAttr, ViSession] # noqa: F405 + self.niTClk_SetAttributeViSession_cfunc.restype = ViStatus # noqa: F405 + return self.niTClk_SetAttributeViSession_cfunc(session, channel_name, attribute_id, value) + + def niTClk_SetAttributeViString(self, session, channel_name, attribute_id, value): # noqa: N802 + with self._func_lock: + if self.niTClk_SetAttributeViString_cfunc is None: + self.niTClk_SetAttributeViString_cfunc = self._library.niTClk_SetAttributeViString + self.niTClk_SetAttributeViString_cfunc.argtypes = [ViSession, ctypes.POINTER(ViChar), ViAttr, ctypes.POINTER(ViChar)] # noqa: F405 + self.niTClk_SetAttributeViString_cfunc.restype = ViStatus # noqa: F405 + return self.niTClk_SetAttributeViString_cfunc(session, channel_name, attribute_id, value) + + def niTClk_SetupForSyncPulseSenderSynchronize(self, session_count, sessions, min_time): # noqa: N802 + with self._func_lock: + if self.niTClk_SetupForSyncPulseSenderSynchronize_cfunc is None: + self.niTClk_SetupForSyncPulseSenderSynchronize_cfunc = self._library.niTClk_SetupForSyncPulseSenderSynchronize + self.niTClk_SetupForSyncPulseSenderSynchronize_cfunc.argtypes = [ViUInt32, ctypes.POINTER(ViSession), ViReal64] # noqa: F405 + self.niTClk_SetupForSyncPulseSenderSynchronize_cfunc.restype = ViStatus # noqa: F405 + return self.niTClk_SetupForSyncPulseSenderSynchronize_cfunc(session_count, sessions, min_time) + + def niTClk_Synchronize(self, session_count, sessions, min_tclk_period): # noqa: N802 + with self._func_lock: + if self.niTClk_Synchronize_cfunc is None: + self.niTClk_Synchronize_cfunc = self._library.niTClk_Synchronize + self.niTClk_Synchronize_cfunc.argtypes = [ViUInt32, ctypes.POINTER(ViSession), ViReal64] # noqa: F405 + self.niTClk_Synchronize_cfunc.restype = ViStatus # noqa: F405 + return self.niTClk_Synchronize_cfunc(session_count, sessions, min_tclk_period) + + def niTClk_SynchronizeToSyncPulseSender(self, session_count, sessions, min_time): # noqa: N802 + with self._func_lock: + if self.niTClk_SynchronizeToSyncPulseSender_cfunc is None: + self.niTClk_SynchronizeToSyncPulseSender_cfunc = self._library.niTClk_SynchronizeToSyncPulseSender + self.niTClk_SynchronizeToSyncPulseSender_cfunc.argtypes = [ViUInt32, ctypes.POINTER(ViSession), ViReal64] # noqa: F405 + self.niTClk_SynchronizeToSyncPulseSender_cfunc.restype = ViStatus # noqa: F405 + return self.niTClk_SynchronizeToSyncPulseSender_cfunc(session_count, sessions, min_time) + + def niTClk_WaitUntilDone(self, session_count, sessions, timeout): # noqa: N802 + with self._func_lock: + if self.niTClk_WaitUntilDone_cfunc is None: + self.niTClk_WaitUntilDone_cfunc = self._library.niTClk_WaitUntilDone + self.niTClk_WaitUntilDone_cfunc.argtypes = [ViUInt32, ctypes.POINTER(ViSession), ViReal64] # noqa: F405 + self.niTClk_WaitUntilDone_cfunc.restype = ViStatus # noqa: F405 + return self.niTClk_WaitUntilDone_cfunc(session_count, sessions, timeout) diff --git a/generated/nitclk/_library_singleton.py b/generated/nitclk/_library_singleton.py new file mode 100644 index 000000000..f8c685dca --- /dev/null +++ b/generated/nitclk/_library_singleton.py @@ -0,0 +1,54 @@ +# -*- coding: utf-8 -*- +# This file was generated + +import platform + +import ctypes +import nitclk._library as _library +import nitclk.errors as errors +import threading + + +_instance = None +_instance_lock = threading.Lock() +_library_info = {'Linux': {'64bit': {'name': 'libnitclk.so', 'type': 'cdll'}}, + 'Windows': {'32bit': {'name': 'nitclk.dll', 'type': 'windll'}, + '64bit': {'name': 'nitclk_64.dll', 'type': 'cdll'}}} + + +def _get_library_name(): + try: + return _library_info[platform.system()][platform.architecture()[0]]['name'] + except KeyError: + raise errors.UnsupportedConfigurationError + + +def _get_library_type(): + try: + return _library_info[platform.system()][platform.architecture()[0]]['type'] + except KeyError: + raise errors.UnsupportedConfigurationError + + +def get(): + '''get + + Returns the library.Library singleton for nitclk. + ''' + global _instance + global _instance_lock + + with _instance_lock: + if _instance is None: + try: + library_type = _get_library_type() + if library_type == 'windll': + ctypes_library = ctypes.WinDLL(_get_library_name()) + else: + assert library_type == 'cdll' + ctypes_library = ctypes.CDLL(_get_library_name()) + except OSError: + raise errors.DriverNotInstalledError() + _instance = _library.Library(ctypes_library) + return _instance + diff --git a/generated/nitclk/_visatype.py b/generated/nitclk/_visatype.py new file mode 100644 index 000000000..fc07e5728 --- /dev/null +++ b/generated/nitclk/_visatype.py @@ -0,0 +1,28 @@ +# -*- coding: utf-8 -*- +import ctypes + + +'''Definitions of the VISA types used by the C API of the driver runtime. +These are aliased directly to ctypes types so can be used directly to call into the library. +''' + + +ViChar = ctypes.c_char +ViInt8 = ctypes.c_int8 +ViInt16 = ctypes.c_int16 +ViUInt16 = ctypes.c_uint16 +ViInt32 = ctypes.c_int32 +ViUInt32 = ctypes.c_uint32 +ViInt64 = ctypes.c_int64 +ViString = ctypes.c_char_p +ViReal32 = ctypes.c_float +ViReal64 = ctypes.c_double + +# Types that are based on other visatypes +ViBoolean = ViUInt16 +ViStatus = ViInt32 +ViSession = ViUInt32 +ViAttr = ViUInt32 +ViConstString = ViString +ViRsrc = ViString + diff --git a/generated/nitclk/errors.py b/generated/nitclk/errors.py new file mode 100644 index 000000000..5fe1108f7 --- /dev/null +++ b/generated/nitclk/errors.py @@ -0,0 +1,100 @@ +# -*- coding: utf-8 -*- +# This file was generated + + +import platform +import warnings + + +def _is_success(code): + return (code == 0) + + +def _is_error(code): + return (code < 0) + + +def _is_warning(code): + return (code > 0) + + +class Error(Exception): + '''Base error class for NI-TClk''' + + def __init__(self, message): + super(Error, self).__init__(message) + + +class DriverError(Error): + '''An error originating from the NI-TClk driver''' + + def __init__(self, code, description): + assert (_is_error(code)), "Should not raise Error if code is not fatal." + self.code = code + self.description = description + super(DriverError, self).__init__(str(self.code) + ": " + self.description) + + +class DriverWarning(Warning): + '''A warning originating from the NI-TClk driver''' + + def __init__(self, code, description): + assert (_is_warning(code)), "Should not create Warning if code is not positive." + super(DriverWarning, self).__init__('Warning {0} occurred.\n\n{1}'.format(code, description)) + + +class UnsupportedConfigurationError(Error): + '''An error due to using this module in an usupported platform.''' + + def __init__(self): + super(UnsupportedConfigurationError, self).__init__('System configuration is unsupported: ' + platform.architecture()[0] + ' ' + platform.system()) + + +class DriverNotInstalledError(Error): + '''An error due to using this module without the driver runtime installed.''' + + def __init__(self): + super(DriverNotInstalledError, self).__init__('The NI-TClk runtime could not be loaded. Make sure it is installed and its bitness matches that of your Python interpreter. Please visit http://www.ni.com/downloads/drivers/ to download and install it.') + + +class InvalidRepeatedCapabilityError(Error): + '''An error due to an invalid character in a repeated capability''' + + def __init__(self, invalid_character, invalid_string): + super(InvalidRepeatedCapabilityError, self).__init__('An invalid character ({0}) was found in repeated capability string ({1})'.format(invalid_character, invalid_string)) + + +class SelfTestError(Error): + '''An error due to a failed self-test''' + + def __init__(self, code, msg): + self.code = code + self.message = msg + super(SelfTestError, self).__init__('Self-test failed with code {0}: {1}'.format(code, msg)) + + +def handle_error(session, code, ignore_warnings, is_error_handling): + '''handle_error + + Helper function for handling errors returned by nitclk.Library. + It calls back into the session to get the corresponding error description + and raises if necessary. + ''' + + if _is_success(code) or (_is_warning(code) and ignore_warnings): + return + + if is_error_handling: + # The caller is in the midst of error handling and an error occurred. + # Don't try to get the description or we'll start recursing until the stack overflows. + description = '' + else: + description = session._get_error_description(code) + + if _is_error(code): + raise DriverError(code, description) + + assert _is_warning(code) + warnings.warn(DriverWarning(code, description)) + + diff --git a/generated/nitclk/setup.py b/generated/nitclk/setup.py new file mode 100644 index 000000000..f8d5dd683 --- /dev/null +++ b/generated/nitclk/setup.py @@ -0,0 +1,74 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- +# This file was generated + + +from setuptools.command.test import test as test_command +from setuptools import setup + + +class PyTest(test_command): + def finalize_options(self): + test_command.finalize_options(self) + self.test_args = [] + self.test_suite = True + + def run_tests(self): + import pytest + pytest.main(self.test_args) + + +pypi_name = 'nitclk' + + +def read_contents(file_to_read): + with open(file_to_read, 'r') as f: + return f.read() + + +setup( + name=pypi_name, + zip_safe=True, + version='0.1.0.dev0', + description='NI-TClk Python API', + long_description=read_contents('README.rst'), + long_description_content_type='text/x-rst', + author='National Instruments', + author_email="opensource@ni.com", + url="https://github.com/ni/nimi-python", + maintainer="National Instruments", + maintainer_email="opensource@ni.com", + keywords=['nitclk'], + license='MIT', + include_package_data=True, + packages=['nitclk'], + install_requires=[ + 'enum34;python_version<"3.4"', + 'singledispatch;python_version<"3.4"', + 'six', + ], + setup_requires=['pytest-runner', ], + tests_require=['pytest'], + test_suite='tests', + classifiers=[ + "Development Status :: 4 - Beta", + "Intended Audience :: Developers", + "Intended Audience :: Manufacturing", + "Intended Audience :: Science/Research", + "License :: OSI Approved :: MIT License", + "Operating System :: Microsoft :: Windows", + "Operating System :: POSIX", + "Programming Language :: Python :: 2", + "Programming Language :: Python :: 2.7", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.4", + "Programming Language :: Python :: 3.5", + "Programming Language :: Python :: 3.6", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: Implementation :: CPython", + "Programming Language :: Python :: Implementation :: PyPy", + "Topic :: System :: Hardware :: Hardware Drivers" + ], + cmdclass={'test': PyTest}, + package_data={pypi_name: ['VERSION']}, +) diff --git a/generated/nitclk/unit_tests/_matchers.py b/generated/nitclk/unit_tests/_matchers.py new file mode 100644 index 000000000..088232cea --- /dev/null +++ b/generated/nitclk/unit_tests/_matchers.py @@ -0,0 +1,302 @@ +# -*- coding: utf-8 -*- +# This file was generated +'''Matcher classes used by unit tests in order to set mock expectations. +These work well with our visatype definitions. +''' + +import ctypes +import nitclk._visatype as _visatype +import pprint + +pp = pprint.PrettyPrinter(indent=4) + + +# Base classes + + +class _ScalarMatcher(object): + def __init__(self, expected_type, expected_value): + self.expected_type = expected_type + self.expected_value = expected_value + + def __eq__(self, other): + if not isinstance(other, self.expected_type): + print("{0}: Unexpected type. Expected: {1}. Received: {2}".format(self.__class__.__name__, self.expected_type, type(other))) + return False + if other.value != self.expected_value: + print("{0}: Unexpected value. Expected: {1}. Received: {2}".format(self.__class__.__name__, self.expected_value, other.value)) + return False + return True + + def __repr__(self): + return '{0}({1}, {2})'.format(self.__class__.__name__, pp.pformat(self.expected_type), pp.pformat(self.expected_value)) + + +class _PointerMatcher(object): + def __init__(self, expected_type): + self.expected_type = expected_type + + def __eq__(self, other): + if not isinstance(other, ctypes.POINTER(self.expected_type)): + print("Unexpected type. Expected: {0}. Received: {1}".format(ctypes.POINTER(self.expected_type), type(other))) + return False + return True + + def __repr__(self): + return '{0}({1})'.format(self.__class__.__name__, pp.pformat(self.expected_type)) + + +class _BufferMatcher(object): + def __init__(self, expected_element_type, expected_size_or_value): + if isinstance(expected_size_or_value, int): + # Were given the size of the buffer + self.expected_value = None + self.expected_size = expected_size_or_value + else: + # Were given a list or something that behaves like a list + self.expected_value = expected_size_or_value + self.expected_size = len(expected_size_or_value) + self.expected_type = expected_element_type * self.expected_size + # Store params for __repr__ + self._expected_element_type = expected_element_type + self._expected_size_or_value = expected_size_or_value + + def __eq__(self, other): + if not isinstance(other, self.expected_type): + # We try to "dereference" this in case it is a pointer and then do the check again. Only then saying they don't match + try: + other = other.contents + except AttributeError: + pass + + # Because of object lifetimes, we may need to mock the other instance and provide lists instead of the actual array + if not isinstance(other, self.expected_type) and not isinstance(other, list): + print("Unexpected type. Expected: {0} or {1}. Received: {2}".format(self.expected_type, list, type(other))) + return False + if self.expected_size != len(other): + print("Unexpected length. Expected: {0}. Received: {1}".format(self.expected_size, len(other))) + return False + if self.expected_value is not None: + # Can't compare the objects directly because they're different types (one is list, another is ctypes array). + # Go element by element, which allows for reporting the first index where different values were found. + for i in range(0, len(self.expected_value)): + if self.expected_value[i] != other[i]: + print("Unexpected value at index {0}. Expected: {1}. Received: {2}".format(i, self.expected_value[i], other[i])) + return False + return True + + def __repr__(self): + return '{0}({1}, {2})'.format(self.__class__.__name__, pp.pformat(self._expected_element_type), pp.pformat(self._expected_size_or_value)) + + def __str__(self): + ret_str = self.__repr__() + '\n' + ret_str += ' expected_type = ' + str(self.expected_type) + '\n' + ret_str += ' expected_value = ' + str(self.expected_value) + '\n' + ret_str += ' expected_size = ' + str(self.expected_size) + '\n' + return ret_str + + +# Strings + + +class ViStringMatcher(object): + def __init__(self, expected_string_value): + self.expected_string_value = expected_string_value + + def __eq__(self, other): + if not isinstance(other, ctypes.Array): + # We try to "dereference" this in case it is a pointer and then do the check again. Only then saying they don't match + try: + other = other.contents + except AttributeError: + pass + + if not isinstance(other, ctypes.Array): + print("Unexpected type. Expected: {0}. Received: {1}".format(self.expected_type, type(other))) + return False + if len(other) < len(self.expected_string_value) + 1: # +1 for NULL terminating character + print("Unexpected length in C string. Expected at least: {0}. Received {1}".format(len(other), len(self.expected_string_value) + 1)) + return False + if not isinstance(other[0], bytes): + print("Unexpected type. Not a string. Received: {0}".format(type(other[0]))) + return False + if other.value.decode("ascii") != self.expected_string_value: + print("Unexpected value. Expected {0}. Received: {1}".format(self.expected_string_value, other.value.decode)) + return False + return True + + def __repr__(self): + return '{0}({1})'.format(self.__class__.__name__, pp.pformat(self.expected_string_value)) + + +# Custom Type + + +def _compare_ctype_structs(expected, actual): + # From https://stackoverflow.com/questions/20986330/print-all-fields-of-ctypes-structure-with-introspection + for field in expected._fields_: + field_name = field[0] + expected_val = getattr(expected, field_name) + actual_val = getattr(actual, field_name) + if expected_val != actual_val: + print("Unexpected value field {0}. Expected: {1}. Received: {2}".format(field_name, expected_val, actual_val)) + return False + return True + + +class CustomTypeMatcher(object): + def __init__(self, expected_type, expected_value): + self.expected_type = expected_type + self.expected_value = expected_value + + def __eq__(self, actual): + if not isinstance(actual, self.expected_type): + print("Unexpected type. Expected: {0}. Received: {1}".format(self.expected_type, type(actual))) + return False + return _compare_ctype_structs(self.expected_value, actual) + + def __repr__(self): + return '{0}({1}, {2})'.format(self.__class__.__name__, pp.pformat(self.expected_type), pp.pformat(self.expected_value)) + + +class CustomTypeBufferMatcher(object): + def __init__(self, expected_element_type, expected_value): + self.expected_value = expected_value + self.expected_size = len(expected_value) + self.expected_type = expected_element_type * self.expected_size + self.expected_element_type = expected_element_type + + def __eq__(self, actual): + if not isinstance(actual, self.expected_type): + print("Unexpected array type. Expected: {0}. Received: {1}".format(self.expected_type, type(actual))) + return False + if self.expected_size != len(actual): + print("Unexpected length. Expected: {0}. Received: {1}".format(self.expected_size, len(actual))) + return False + if self.expected_value is not None: + # Can't compare the objects directly because they're different types (one is list, another is ctypes array). + # Go element by element, which allows for reporting the first index where different values were found. + for a, e in zip(actual, self.expected_value): + if not isinstance(a, self.expected_element_type): + print("Unexpected type. Expected: {0}. Received: {1}".format(self.expected_element_type, type(a))) + return False + if not _compare_ctype_structs(e, a): + return False + return True + + def __repr__(self): + expected_val_repr = '[' + ', '.join([x.__repr__() for x in self.expected_value]) + ']' + return '{0}({1}, {2})'.format(self.__class__.__name__, pp.pformat(self.expected_element_type), expected_val_repr) + + def __str__(self): + ret_str = self.__repr__() + '\n' + ret_str += ' expected_type = ' + str(self.expected_type) + '\n' + ret_str += ' expected_size = ' + str(self.expected_size) + '\n' + return ret_str + + +# Scalars + + +class ViBooleanMatcher(_ScalarMatcher): + def __init__(self, expected_value): + _ScalarMatcher.__init__(self, _visatype.ViBoolean, 1 if expected_value is True else 0) + + +class ViSessionMatcher(_ScalarMatcher): + def __init__(self, expected_value): + _ScalarMatcher.__init__(self, _visatype.ViSession, expected_value) + + +class ViInt16Matcher(_ScalarMatcher): + def __init__(self, expected_value): + _ScalarMatcher.__init__(self, _visatype.ViInt16, expected_value) + + +class ViInt32Matcher(_ScalarMatcher): + def __init__(self, expected_value): + _ScalarMatcher.__init__(self, _visatype.ViInt32, expected_value) + + +class ViAttrMatcher(_ScalarMatcher): + def __init__(self, expected_value): + _ScalarMatcher.__init__(self, _visatype.ViAttr, expected_value) + + +class ViInt64Matcher(_ScalarMatcher): + def __init__(self, expected_value): + _ScalarMatcher.__init__(self, _visatype.ViInt64, expected_value) + + +class ViReal64Matcher(_ScalarMatcher): + def __init__(self, expected_value): + _ScalarMatcher.__init__(self, _visatype.ViReal64, expected_value) + + +# Pointers + + +class ViBooleanPointerMatcher(_PointerMatcher): + def __init__(self): + _PointerMatcher.__init__(self, _visatype.ViBoolean) + + +class ViSessionPointerMatcher(_PointerMatcher): + def __init__(self): + _PointerMatcher.__init__(self, _visatype.ViSession) + + +class ViInt16PointerMatcher(_PointerMatcher): + def __init__(self): + _PointerMatcher.__init__(self, _visatype.ViInt16) + + +class ViInt32PointerMatcher(_PointerMatcher): + def __init__(self): + _PointerMatcher.__init__(self, _visatype.ViInt32) + + +class ViInt64PointerMatcher(_PointerMatcher): + def __init__(self): + _PointerMatcher.__init__(self, _visatype.ViInt64) + + +class ViReal64PointerMatcher(_PointerMatcher): + def __init__(self): + _PointerMatcher.__init__(self, _visatype.ViReal64) + + +# Buffers + + +class ViBooleanBufferMatcher(_BufferMatcher): + def __init__(self, expected_size_or_value): + _BufferMatcher.__init__(self, _visatype.ViBoolean, expected_size_or_value) + + +class ViCharBufferMatcher(_BufferMatcher): + def __init__(self, expected_size_or_value): + _BufferMatcher.__init__(self, _visatype.ViChar, expected_size_or_value) + + +class ViInt16BufferMatcher(_BufferMatcher): + def __init__(self, expected_size_or_value): + _BufferMatcher.__init__(self, _visatype.ViInt16, expected_size_or_value) + + +class ViInt32BufferMatcher(_BufferMatcher): + def __init__(self, expected_size_or_value): + _BufferMatcher.__init__(self, _visatype.ViInt32, expected_size_or_value) + + +class ViInt64BufferMatcher(_BufferMatcher): + def __init__(self, expected_size_or_value): + _BufferMatcher.__init__(self, _visatype.ViInt64, expected_size_or_value) + + +class ViReal64BufferMatcher(_BufferMatcher): + def __init__(self, expected_size_or_value): + _BufferMatcher.__init__(self, _visatype.ViReal64, expected_size_or_value) + + + diff --git a/generated/nitclk/unit_tests/_mock_helper.py b/generated/nitclk/unit_tests/_mock_helper.py new file mode 100644 index 000000000..b3149e8d8 --- /dev/null +++ b/generated/nitclk/unit_tests/_mock_helper.py @@ -0,0 +1,210 @@ +# -*- coding: utf-8 -*- +# This file was generated +import sys # noqa: F401 - Not all mock_helpers will need this + + +class MockFunctionCallError(Exception): + def __init__(self, function, param=None): + self.function = function + self.param = param + msg = "{0} called without setting side_effect".format(self.function) + if param is not None: + msg += " or setting the {0} parameter return value".format(self.param) + super(Exception, self).__init__(msg) + + +class SideEffectsHelper(object): + def __init__(self): + self._defaults = {} + self._defaults['ConfigureForHomogeneousTriggers'] = {} + self._defaults['ConfigureForHomogeneousTriggers']['return'] = 0 + self._defaults['FinishSyncPulseSenderSynchronize'] = {} + self._defaults['FinishSyncPulseSenderSynchronize']['return'] = 0 + self._defaults['GetAttributeViBoolean'] = {} + self._defaults['GetAttributeViBoolean']['return'] = 0 + self._defaults['GetAttributeViBoolean']['value'] = None + self._defaults['GetAttributeViReal64'] = {} + self._defaults['GetAttributeViReal64']['return'] = 0 + self._defaults['GetAttributeViReal64']['value'] = None + self._defaults['GetAttributeViSession'] = {} + self._defaults['GetAttributeViSession']['return'] = 0 + self._defaults['GetAttributeViSession']['value'] = None + self._defaults['GetAttributeViString'] = {} + self._defaults['GetAttributeViString']['return'] = 0 + self._defaults['GetExtendedErrorInfo'] = {} + self._defaults['GetExtendedErrorInfo']['return'] = 0 + self._defaults['GetExtendedErrorInfo']['errorString'] = None + self._defaults['Initiate'] = {} + self._defaults['Initiate']['return'] = 0 + self._defaults['IsDone'] = {} + self._defaults['IsDone']['return'] = 0 + self._defaults['IsDone']['done'] = None + self._defaults['SetAttributeViBoolean'] = {} + self._defaults['SetAttributeViBoolean']['return'] = 0 + self._defaults['SetAttributeViReal64'] = {} + self._defaults['SetAttributeViReal64']['return'] = 0 + self._defaults['SetAttributeViSession'] = {} + self._defaults['SetAttributeViSession']['return'] = 0 + self._defaults['SetAttributeViString'] = {} + self._defaults['SetAttributeViString']['return'] = 0 + self._defaults['SetupForSyncPulseSenderSynchronize'] = {} + self._defaults['SetupForSyncPulseSenderSynchronize']['return'] = 0 + self._defaults['Synchronize'] = {} + self._defaults['Synchronize']['return'] = 0 + self._defaults['SynchronizeToSyncPulseSender'] = {} + self._defaults['SynchronizeToSyncPulseSender']['return'] = 0 + self._defaults['WaitUntilDone'] = {} + self._defaults['WaitUntilDone']['return'] = 0 + + def __getitem__(self, func): + return self._defaults[func] + + def __setitem__(self, func, val): + self._defaults[func] = val + + def niTClk_ConfigureForHomogeneousTriggers(self, session_count, sessions): # noqa: N802 + if self._defaults['ConfigureForHomogeneousTriggers']['return'] != 0: + return self._defaults['ConfigureForHomogeneousTriggers']['return'] + return self._defaults['ConfigureForHomogeneousTriggers']['return'] + + def niTClk_FinishSyncPulseSenderSynchronize(self, session_count, sessions, min_time): # noqa: N802 + if self._defaults['FinishSyncPulseSenderSynchronize']['return'] != 0: + return self._defaults['FinishSyncPulseSenderSynchronize']['return'] + return self._defaults['FinishSyncPulseSenderSynchronize']['return'] + + def niTClk_GetAttributeViBoolean(self, session, channel_name, attribute_id, value): # noqa: N802 + if self._defaults['GetAttributeViBoolean']['return'] != 0: + return self._defaults['GetAttributeViBoolean']['return'] + # value + if self._defaults['GetAttributeViBoolean']['value'] is None: + raise MockFunctionCallError("niTClk_GetAttributeViBoolean", param='value') + if value is not None: + value.contents.value = self._defaults['GetAttributeViBoolean']['value'] + return self._defaults['GetAttributeViBoolean']['return'] + + def niTClk_GetAttributeViReal64(self, session, channel_name, attribute_id, value): # noqa: N802 + if self._defaults['GetAttributeViReal64']['return'] != 0: + return self._defaults['GetAttributeViReal64']['return'] + # value + if self._defaults['GetAttributeViReal64']['value'] is None: + raise MockFunctionCallError("niTClk_GetAttributeViReal64", param='value') + if value is not None: + value.contents.value = self._defaults['GetAttributeViReal64']['value'] + return self._defaults['GetAttributeViReal64']['return'] + + def niTClk_GetAttributeViSession(self, session, channel_name, attribute_id, value): # noqa: N802 + if self._defaults['GetAttributeViSession']['return'] != 0: + return self._defaults['GetAttributeViSession']['return'] + # value + if self._defaults['GetAttributeViSession']['value'] is None: + raise MockFunctionCallError("niTClk_GetAttributeViSession", param='value') + if value is not None: + value.contents.value = self._defaults['GetAttributeViSession']['value'] + return self._defaults['GetAttributeViSession']['return'] + + def niTClk_GetAttributeViString(self, session, channel_name, attribute_id, buf_size, value): # noqa: N802 + if self._defaults['GetAttributeViString']['return'] != 0: + return self._defaults['GetAttributeViString']['return'] + return self._defaults['GetAttributeViString']['return'] + + def niTClk_GetExtendedErrorInfo(self, error_string, error_string_size): # noqa: N802 + if self._defaults['GetExtendedErrorInfo']['return'] != 0: + return self._defaults['GetExtendedErrorInfo']['return'] + if self._defaults['GetExtendedErrorInfo']['errorString'] is None: + raise MockFunctionCallError("niTClk_GetExtendedErrorInfo", param='errorString') + if error_string_size.value == 0: + return len(self._defaults['GetExtendedErrorInfo']['errorString']) + error_string.value = self._defaults['GetExtendedErrorInfo']['errorString'].encode('ascii') + return self._defaults['GetExtendedErrorInfo']['return'] + + def niTClk_Initiate(self, session_count, sessions): # noqa: N802 + if self._defaults['Initiate']['return'] != 0: + return self._defaults['Initiate']['return'] + return self._defaults['Initiate']['return'] + + def niTClk_IsDone(self, session_count, sessions, done): # noqa: N802 + if self._defaults['IsDone']['return'] != 0: + return self._defaults['IsDone']['return'] + # done + if self._defaults['IsDone']['done'] is None: + raise MockFunctionCallError("niTClk_IsDone", param='done') + if done is not None: + done.contents.value = self._defaults['IsDone']['done'] + return self._defaults['IsDone']['return'] + + def niTClk_SetAttributeViBoolean(self, session, channel_name, attribute_id, value): # noqa: N802 + if self._defaults['SetAttributeViBoolean']['return'] != 0: + return self._defaults['SetAttributeViBoolean']['return'] + return self._defaults['SetAttributeViBoolean']['return'] + + def niTClk_SetAttributeViReal64(self, session, channel_name, attribute_id, value): # noqa: N802 + if self._defaults['SetAttributeViReal64']['return'] != 0: + return self._defaults['SetAttributeViReal64']['return'] + return self._defaults['SetAttributeViReal64']['return'] + + def niTClk_SetAttributeViSession(self, session, channel_name, attribute_id, value): # noqa: N802 + if self._defaults['SetAttributeViSession']['return'] != 0: + return self._defaults['SetAttributeViSession']['return'] + return self._defaults['SetAttributeViSession']['return'] + + def niTClk_SetAttributeViString(self, session, channel_name, attribute_id, value): # noqa: N802 + if self._defaults['SetAttributeViString']['return'] != 0: + return self._defaults['SetAttributeViString']['return'] + return self._defaults['SetAttributeViString']['return'] + + def niTClk_SetupForSyncPulseSenderSynchronize(self, session_count, sessions, min_time): # noqa: N802 + if self._defaults['SetupForSyncPulseSenderSynchronize']['return'] != 0: + return self._defaults['SetupForSyncPulseSenderSynchronize']['return'] + return self._defaults['SetupForSyncPulseSenderSynchronize']['return'] + + def niTClk_Synchronize(self, session_count, sessions, min_tclk_period): # noqa: N802 + if self._defaults['Synchronize']['return'] != 0: + return self._defaults['Synchronize']['return'] + return self._defaults['Synchronize']['return'] + + def niTClk_SynchronizeToSyncPulseSender(self, session_count, sessions, min_time): # noqa: N802 + if self._defaults['SynchronizeToSyncPulseSender']['return'] != 0: + return self._defaults['SynchronizeToSyncPulseSender']['return'] + return self._defaults['SynchronizeToSyncPulseSender']['return'] + + def niTClk_WaitUntilDone(self, session_count, sessions, timeout): # noqa: N802 + if self._defaults['WaitUntilDone']['return'] != 0: + return self._defaults['WaitUntilDone']['return'] + return self._defaults['WaitUntilDone']['return'] + + # Helper function to setup Mock object with default side effects and return values + def set_side_effects_and_return_values(self, mock_library): + mock_library.niTClk_ConfigureForHomogeneousTriggers.side_effect = MockFunctionCallError("niTClk_ConfigureForHomogeneousTriggers") + mock_library.niTClk_ConfigureForHomogeneousTriggers.return_value = 0 + mock_library.niTClk_FinishSyncPulseSenderSynchronize.side_effect = MockFunctionCallError("niTClk_FinishSyncPulseSenderSynchronize") + mock_library.niTClk_FinishSyncPulseSenderSynchronize.return_value = 0 + mock_library.niTClk_GetAttributeViBoolean.side_effect = MockFunctionCallError("niTClk_GetAttributeViBoolean") + mock_library.niTClk_GetAttributeViBoolean.return_value = 0 + mock_library.niTClk_GetAttributeViReal64.side_effect = MockFunctionCallError("niTClk_GetAttributeViReal64") + mock_library.niTClk_GetAttributeViReal64.return_value = 0 + mock_library.niTClk_GetAttributeViSession.side_effect = MockFunctionCallError("niTClk_GetAttributeViSession") + mock_library.niTClk_GetAttributeViSession.return_value = 0 + mock_library.niTClk_GetAttributeViString.side_effect = MockFunctionCallError("niTClk_GetAttributeViString") + mock_library.niTClk_GetAttributeViString.return_value = 0 + mock_library.niTClk_GetExtendedErrorInfo.side_effect = MockFunctionCallError("niTClk_GetExtendedErrorInfo") + mock_library.niTClk_GetExtendedErrorInfo.return_value = 0 + mock_library.niTClk_Initiate.side_effect = MockFunctionCallError("niTClk_Initiate") + mock_library.niTClk_Initiate.return_value = 0 + mock_library.niTClk_IsDone.side_effect = MockFunctionCallError("niTClk_IsDone") + mock_library.niTClk_IsDone.return_value = 0 + mock_library.niTClk_SetAttributeViBoolean.side_effect = MockFunctionCallError("niTClk_SetAttributeViBoolean") + mock_library.niTClk_SetAttributeViBoolean.return_value = 0 + mock_library.niTClk_SetAttributeViReal64.side_effect = MockFunctionCallError("niTClk_SetAttributeViReal64") + mock_library.niTClk_SetAttributeViReal64.return_value = 0 + mock_library.niTClk_SetAttributeViSession.side_effect = MockFunctionCallError("niTClk_SetAttributeViSession") + mock_library.niTClk_SetAttributeViSession.return_value = 0 + mock_library.niTClk_SetAttributeViString.side_effect = MockFunctionCallError("niTClk_SetAttributeViString") + mock_library.niTClk_SetAttributeViString.return_value = 0 + mock_library.niTClk_SetupForSyncPulseSenderSynchronize.side_effect = MockFunctionCallError("niTClk_SetupForSyncPulseSenderSynchronize") + mock_library.niTClk_SetupForSyncPulseSenderSynchronize.return_value = 0 + mock_library.niTClk_Synchronize.side_effect = MockFunctionCallError("niTClk_Synchronize") + mock_library.niTClk_Synchronize.return_value = 0 + mock_library.niTClk_SynchronizeToSyncPulseSender.side_effect = MockFunctionCallError("niTClk_SynchronizeToSyncPulseSender") + mock_library.niTClk_SynchronizeToSyncPulseSender.return_value = 0 + mock_library.niTClk_WaitUntilDone.side_effect = MockFunctionCallError("niTClk_WaitUntilDone") + mock_library.niTClk_WaitUntilDone.return_value = 0 From c31a6b4a8d10ff95032e04f089c0025d3be51c4a Mon Sep 17 00:00:00 2001 From: Mark Silva Date: Tue, 3 Sep 2019 13:38:00 -0500 Subject: [PATCH 23/56] Update generated files --- README.rst | 41 +++ docs/conf.py | 2 +- docs/nidmm/class.rst | 38 +-- docs/nifgen/class.rst | 448 +++++++++++++++------------------ generated/nidcpower/session.py | 104 ++++---- generated/nidmm/session.py | 38 +-- generated/nifgen/session.py | 18 +- generated/nitclk/__init__.py | 95 +++++++ 8 files changed, 435 insertions(+), 349 deletions(-) create mode 100644 generated/nitclk/__init__.py diff --git a/README.rst b/README.rst index cc46632b6..c6b93d418 100644 --- a/README.rst +++ b/README.rst @@ -391,6 +391,47 @@ NI-SWITCH Python API Status :target: https://github.com/ni/nimi-python/pulls?q=is%3Aopen+is%3Aissue+label%3Aniswitch + +NI-TClk Python API Status +------------------------- + ++-------------------------------+-----------------------+ +| NI-TClk (nitclk) | | ++===============================+=======================+ +| Driver Version Tested Against | 18.0.0 | ++-------------------------------+-----------------------+ +| Driver API Version | 255.0.0d0 | ++-------------------------------+-----------------------+ +| PyPI Version | |nitclkLatestVersion| | ++-------------------------------+-----------------------+ +| Supported Python Version | |nitclkPythonVersion| | ++-------------------------------+-----------------------+ +| Open Issues | |nitclkOpenIssues| | ++-------------------------------+-----------------------+ +| Open Pull Requests | |nitclkOpenPRs| | ++-------------------------------+-----------------------+ + + +.. |nitclkLatestVersion| image:: http://img.shields.io/pypi/v/nitclk.svg + :alt: Latest NI-TClk Version + :target: http://pypi.python.org/pypi/nitclk + + +.. |nitclkPythonVersion| image:: http://img.shields.io/pypi/pyversions/nitclk.svg + :alt: NI-TClk supported Python versions + :target: http://pypi.python.org/pypi/nitclk + + +.. |nitclkOpenIssues| image:: https://img.shields.io/github/issues/ni/nimi-python/nitclk.svg + :alt: Open Issues + Pull Requests for NI-TClk + :target: https://github.com/ni/nimi-python/issues?q=is%3Aopen+is%3Aissue+label%3Anitclk + + +.. |nitclkOpenPRs| image:: https://img.shields.io/github/issues-pr/ni/nimi-python/nitclk.svg + :alt: Pull Requests for NI-TClk + :target: https://github.com/ni/nimi-python/pulls?q=is%3Aopen+is%3Aissue+label%3Anitclk + + .. _installation-section: Installation diff --git a/docs/conf.py b/docs/conf.py index b2e6e31e8..34d368c9d 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -63,7 +63,7 @@ # built documents. # # The full version, including alpha/beta/rc tags. -release = '0.1.1.dev0' +release = '1.1.3.dev0' # The short X.Y version. version = release[:3] diff --git a/docs/nidmm/class.rst b/docs/nidmm/class.rst index 0b69e8ddc..a084d39c1 100644 --- a/docs/nidmm/class.rst +++ b/docs/nidmm/class.rst @@ -2764,25 +2764,25 @@ configure_rtd_type NI-DMM uses this value to set the RTD Type property. The default is :py:data:`~nidmm.RTDType.PT3851`. - +----------------------------------+-----------------------------------------------+----------+---------+-------------------------+-------------------------------------------------------------------------------+-------------------------------+ - | Enum | Standards | Material | TCR (α) | Typical R\ :sub:`0` (Ω) | Notes | | - +==================================+===============================================+==========+=========+=========================+===============================================================================+===============================+ - | Callendar-Van Dusen Coefficient | | | | | | | - +----------------------------------+-----------------------------------------------+----------+---------+-------------------------+-------------------------------------------------------------------------------+-------------------------------+ - | :py:data:`~nidmm.RTDType.PT3851` | IEC-751 DIN 43760 BS 1904 ASTM-E1137 EN-60751 | Platinum | .003851 | 100 Ω 1000 Ω | A = 3.9083 × 10\ :sup:`–3` B = –5.775×10:sup:`–7` C = –4.183×10:sup:`–12` | Most common RTDs | - +----------------------------------+-----------------------------------------------+----------+---------+-------------------------+-------------------------------------------------------------------------------+-------------------------------+ - | :py:data:`~nidmm.RTDType.PT3750` | Low-cost vendor compliant RTD\* | Platinum | .003750 | 1000 Ω | A = 3.81 × 10\ :sup:`–3` B = –6.02×10:sup:`–7` C = –6.0×10:sup:`–12` | Low-cost RTD | - +----------------------------------+-----------------------------------------------+----------+---------+-------------------------+-------------------------------------------------------------------------------+-------------------------------+ - | :py:data:`~nidmm.RTDType.PT3916` | JISC 1604 | Platinum | .003916 | 100 Ω | A = 3.9739 × 10\ :sup:`–3` B = –5.870×10:sup:`–7` C = –4.4 ×10\ :sup:`–12` | Used in primarily in Japan | - +----------------------------------+-----------------------------------------------+----------+---------+-------------------------+-------------------------------------------------------------------------------+-------------------------------+ - | :py:data:`~nidmm.RTDType.PT3920` | US Industrial Standard D-100 American | Platinum | .003920 | 100 Ω | A = 3.9787 × 10\ :sup:`–3` B = –5.8686×10:sup:`–7` C = –4.167 ×10\ :sup:`–12` | Low-cost RTD | - +----------------------------------+-----------------------------------------------+----------+---------+-------------------------+-------------------------------------------------------------------------------+-------------------------------+ - | :py:data:`~nidmm.RTDType.PT3911` | US Industrial Standard American | Platinum | .003911 | 100 Ω | A = 3.9692 × 10\ :sup:`–3` B = –5.8495×10:sup:`–7` C = –4.233 ×10\ :sup:`–12` | Low-cost RTD | - +----------------------------------+-----------------------------------------------+----------+---------+-------------------------+-------------------------------------------------------------------------------+-------------------------------+ - | :py:data:`~nidmm.RTDType.PT3928` | ITS-90 | Platinum | .003928 | 100 Ω | A = 3.9888 × 10\ :sup:`–3` B = –5.915×10:sup:`–7` C = –3.85 ×10\ :sup:`–12` | The definition of temperature | - +----------------------------------+-----------------------------------------------+----------+---------+-------------------------+-------------------------------------------------------------------------------+-------------------------------+ - | \*No standard. Check the TCR. | | | | | | | - +----------------------------------+-----------------------------------------------+----------+---------+-------------------------+-------------------------------------------------------------------------------+-------------------------------+ + +----------------------------------+-----------------------------------------------+----------+----------+--------------------------+--------------------------------------------------------------------------------------------+-------------------------------+ + | Enum | Standards | Material | TCR (α) | Typical R\ :sub:`0` (Ω) | Notes | | + +==================================+===============================================+==========+==========+==========================+============================================================================================+===============================+ + | Callendar-Van Dusen Coefficient | | | | | | | + +----------------------------------+-----------------------------------------------+----------+----------+--------------------------+--------------------------------------------------------------------------------------------+-------------------------------+ + | :py:data:`~nidmm.RTDType.PT3851` | IEC-751 DIN 43760 BS 1904 ASTM-E1137 EN-60751 | Platinum | .003851 | 100 Ω 1000 Ω | A = 3.9083 × 10\ :sup:`–3` B = –5.775×10:sup:`–7` C = –4.183×10:sup:`–12` | Most common RTDs | + +----------------------------------+-----------------------------------------------+----------+----------+--------------------------+--------------------------------------------------------------------------------------------+-------------------------------+ + | :py:data:`~nidmm.RTDType.PT3750` | Low-cost vendor compliant RTD\* | Platinum | .003750 | 1000 Ω | A = 3.81 × 10\ :sup:`–3` B = –6.02×10:sup:`–7` C = –6.0×10:sup:`–12` | Low-cost RTD | + +----------------------------------+-----------------------------------------------+----------+----------+--------------------------+--------------------------------------------------------------------------------------------+-------------------------------+ + | :py:data:`~nidmm.RTDType.PT3916` | JISC 1604 | Platinum | .003916 | 100 Ω | A = 3.9739 × 10\ :sup:`–3` B = –5.870×10:sup:`–7` C = –4.4 ×10\ :sup:`–12` | Used in primarily in Japan | + +----------------------------------+-----------------------------------------------+----------+----------+--------------------------+--------------------------------------------------------------------------------------------+-------------------------------+ + | :py:data:`~nidmm.RTDType.PT3920` | US Industrial Standard D-100 American | Platinum | .003920 | 100 Ω | A = 3.9787 × 10\ :sup:`–3` B = –5.8686×10:sup:`–7` C = –4.167 ×10\ :sup:`–12` | Low-cost RTD | + +----------------------------------+-----------------------------------------------+----------+----------+--------------------------+--------------------------------------------------------------------------------------------+-------------------------------+ + | :py:data:`~nidmm.RTDType.PT3911` | US Industrial Standard American | Platinum | .003911 | 100 Ω | A = 3.9692 × 10\ :sup:`–3` B = –5.8495×10:sup:`–7` C = –4.233 ×10\ :sup:`–12` | Low-cost RTD | + +----------------------------------+-----------------------------------------------+----------+----------+--------------------------+--------------------------------------------------------------------------------------------+-------------------------------+ + | :py:data:`~nidmm.RTDType.PT3928` | ITS-90 | Platinum | .003928 | 100 Ω | A = 3.9888 × 10\ :sup:`–3` B = –5.915×10:sup:`–7` C = –3.85 ×10\ :sup:`–12` | The definition of temperature | + +----------------------------------+-----------------------------------------------+----------+----------+--------------------------+--------------------------------------------------------------------------------------------+-------------------------------+ + | \*No standard. Check the TCR. | | | | | | | + +----------------------------------+-----------------------------------------------+----------+----------+--------------------------+--------------------------------------------------------------------------------------------+-------------------------------+ :type rtd_type: :py:data:`nidmm.RTDType` diff --git a/docs/nifgen/class.rst b/docs/nifgen/class.rst index 81533b3fc..19aa6420e 100644 --- a/docs/nifgen/class.rst +++ b/docs/nifgen/class.rst @@ -381,103 +381,101 @@ nifgen.Session **Public methods** - +-----------------------------------------------------+ - | Method name | - +=====================================================+ - | :py:func:`abort` | - +-----------------------------------------------------+ - | :py:func:`allocate_named_waveform` | - +-----------------------------------------------------+ - | :py:func:`allocate_waveform` | - +-----------------------------------------------------+ - | :py:func:`clear_arb_memory` | - +-----------------------------------------------------+ - | :py:func:`clear_arb_sequence` | - +-----------------------------------------------------+ - | :py:func:`clear_freq_list` | - +-----------------------------------------------------+ - | :py:func:`clear_user_standard_waveform` | - +-----------------------------------------------------+ - | :py:func:`commit` | - +-----------------------------------------------------+ - | :py:func:`configure_arb_sequence` | - +-----------------------------------------------------+ - | :py:func:`configure_arb_waveform` | - +-----------------------------------------------------+ - | :py:func:`configure_custom_fir_filter_coefficients` | - +-----------------------------------------------------+ - | :py:func:`configure_freq_list` | - +-----------------------------------------------------+ - | :py:func:`configure_standard_waveform` | - +-----------------------------------------------------+ - | :py:func:`create_advanced_arb_sequence` | - +-----------------------------------------------------+ - | :py:func:`create_arb_sequence` | - +-----------------------------------------------------+ - | :py:func:`create_freq_list` | - +-----------------------------------------------------+ - | :py:func:`create_waveform_from_file_f64` | - +-----------------------------------------------------+ - | :py:func:`create_waveform_from_file_i16` | - +-----------------------------------------------------+ - | :py:func:`create_waveform_numpy` | - +-----------------------------------------------------+ - | :py:func:`define_user_standard_waveform` | - +-----------------------------------------------------+ - | :py:func:`delete_script` | - +-----------------------------------------------------+ - | :py:func:`delete_waveform` | - +-----------------------------------------------------+ - | :py:func:`disable` | - +-----------------------------------------------------+ - | :py:func:`get_ext_cal_last_date_and_time` | - +-----------------------------------------------------+ - | :py:func:`get_ext_cal_last_temp` | - +-----------------------------------------------------+ - | :py:func:`get_ext_cal_recommended_interval` | - +-----------------------------------------------------+ - | :py:func:`get_hardware_state` | - +-----------------------------------------------------+ - | :py:func:`get_self_cal_last_date_and_time` | - +-----------------------------------------------------+ - | :py:func:`get_self_cal_last_temp` | - +-----------------------------------------------------+ - | :py:func:`get_self_cal_supported` | - +-----------------------------------------------------+ - | :py:func:`is_done` | - +-----------------------------------------------------+ - | :py:func:`lock` | - +-----------------------------------------------------+ - | :py:func:`query_arb_seq_capabilities` | - +-----------------------------------------------------+ - | :py:func:`query_arb_wfm_capabilities` | - +-----------------------------------------------------+ - | :py:func:`query_freq_list_capabilities` | - +-----------------------------------------------------+ - | :py:func:`read_current_temperature` | - +-----------------------------------------------------+ - | :py:func:`reset` | - +-----------------------------------------------------+ - | :py:func:`reset_device` | - +-----------------------------------------------------+ - | :py:func:`reset_with_defaults` | - +-----------------------------------------------------+ - | :py:func:`self_cal` | - +-----------------------------------------------------+ - | :py:func:`self_test` | - +-----------------------------------------------------+ - | :py:func:`send_software_edge_trigger` | - +-----------------------------------------------------+ - | :py:func:`set_next_write_position` | - +-----------------------------------------------------+ - | :py:func:`unlock` | - +-----------------------------------------------------+ - | :py:func:`wait_until_done` | - +-----------------------------------------------------+ - | :py:func:`write_script` | - +-----------------------------------------------------+ - | :py:func:`write_waveform` | - +-----------------------------------------------------+ + +---------------------------------------------+ + | Method name | + +=============================================+ + | :py:func:`abort` | + +---------------------------------------------+ + | :py:func:`allocate_named_waveform` | + +---------------------------------------------+ + | :py:func:`allocate_waveform` | + +---------------------------------------------+ + | :py:func:`clear_arb_memory` | + +---------------------------------------------+ + | :py:func:`clear_arb_sequence` | + +---------------------------------------------+ + | :py:func:`clear_freq_list` | + +---------------------------------------------+ + | :py:func:`clear_user_standard_waveform` | + +---------------------------------------------+ + | :py:func:`commit` | + +---------------------------------------------+ + | :py:func:`configure_arb_sequence` | + +---------------------------------------------+ + | :py:func:`configure_arb_waveform` | + +---------------------------------------------+ + | :py:func:`configure_freq_list` | + +---------------------------------------------+ + | :py:func:`configure_standard_waveform` | + +---------------------------------------------+ + | :py:func:`create_advanced_arb_sequence` | + +---------------------------------------------+ + | :py:func:`create_arb_sequence` | + +---------------------------------------------+ + | :py:func:`create_freq_list` | + +---------------------------------------------+ + | :py:func:`create_waveform_from_file_f64` | + +---------------------------------------------+ + | :py:func:`create_waveform_from_file_i16` | + +---------------------------------------------+ + | :py:func:`create_waveform_numpy` | + +---------------------------------------------+ + | :py:func:`define_user_standard_waveform` | + +---------------------------------------------+ + | :py:func:`delete_script` | + +---------------------------------------------+ + | :py:func:`delete_waveform` | + +---------------------------------------------+ + | :py:func:`disable` | + +---------------------------------------------+ + | :py:func:`get_ext_cal_last_date_and_time` | + +---------------------------------------------+ + | :py:func:`get_ext_cal_last_temp` | + +---------------------------------------------+ + | :py:func:`get_ext_cal_recommended_interval` | + +---------------------------------------------+ + | :py:func:`get_hardware_state` | + +---------------------------------------------+ + | :py:func:`get_self_cal_last_date_and_time` | + +---------------------------------------------+ + | :py:func:`get_self_cal_last_temp` | + +---------------------------------------------+ + | :py:func:`get_self_cal_supported` | + +---------------------------------------------+ + | :py:func:`is_done` | + +---------------------------------------------+ + | :py:func:`lock` | + +---------------------------------------------+ + | :py:func:`query_arb_seq_capabilities` | + +---------------------------------------------+ + | :py:func:`query_arb_wfm_capabilities` | + +---------------------------------------------+ + | :py:func:`query_freq_list_capabilities` | + +---------------------------------------------+ + | :py:func:`read_current_temperature` | + +---------------------------------------------+ + | :py:func:`reset` | + +---------------------------------------------+ + | :py:func:`reset_device` | + +---------------------------------------------+ + | :py:func:`reset_with_defaults` | + +---------------------------------------------+ + | :py:func:`self_cal` | + +---------------------------------------------+ + | :py:func:`self_test` | + +---------------------------------------------+ + | :py:func:`send_software_edge_trigger` | + +---------------------------------------------+ + | :py:func:`set_next_write_position` | + +---------------------------------------------+ + | :py:func:`unlock` | + +---------------------------------------------+ + | :py:func:`wait_until_done` | + +---------------------------------------------+ + | :py:func:`write_script` | + +---------------------------------------------+ + | :py:func:`write_waveform` | + +---------------------------------------------+ Properties @@ -4661,52 +4659,6 @@ configure_arb_waveform :type offset: float -configure_custom_fir_filter_coefficients -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - .. py:currentmodule:: nifgen.Session - - .. py:method:: configure_custom_fir_filter_coefficients(coefficients_array) - - Sets the FIR filter coefficients used by the onboard signal processing - block. The values are coerced to the closest settings achievable by the - signal generator. - - Refer to the *FIR Filter* topic for your device in the *NI Signal - Generators Help* for more information about FIR filter coefficients. - This method is supported only for the NI 5441. - - - - .. note:: The signal generator must not be in the Generating state when you call - this method. - - - .. tip:: This method requires repeated capabilities (channels). If called directly on the - nifgen.Session object, then the method will use all repeated capabilities in the session. - You can specify a subset of repeated capabilities using the Python index notation on an - nifgen.Session repeated capabilities container, and calling this method on the result.: - - .. code:: python - - session.channels[0,1].configure_custom_fir_filter_coefficients(coefficients_array) - - - :param coefficients_array: - - - Specifies the array of data the onboard signal processor uses for the - FIR filter coefficients. For the NI 5441, provide a symmetric array of - 95 coefficients to this parameter. The array must have at least as many - elements as the value that you specify in the **numberOfCoefficients** - parameter in this method. - The coefficients should range between –1.00 and +1.00. - - - - - :type coefficients_array: list of float - configure_freq_list ~~~~~~~~~~~~~~~~~~~ @@ -5349,11 +5301,11 @@ create_waveform_from_file_f64 | | ****Default Value**:** :py:data:`~nifgen.ByteOrder.LITTLE` - +-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+ + +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ | :py:data:`~nifgen.ByteOrder.LITTLE` | Little Endian Data—The least significant bit is stored at the lowest address, followed by the other bits, in order of increasing significance. | - +-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+ + +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ | :py:data:`~nifgen.ByteOrder.BIG` | Big Endian Data—The most significant bit is stored at the lowest address, followed by the other bits, in order of decreasing significance. | - +-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+ + +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ .. note:: Data written by most applications in Windows (including LabWindows™/CVI™) is in Little Endian format. Data written to a file @@ -5425,11 +5377,11 @@ create_waveform_from_file_i16 | | ****Default Value**:** :py:data:`~nifgen.ByteOrder.LITTLE` - +-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+ + +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ | :py:data:`~nifgen.ByteOrder.LITTLE` | Little Endian Data—The least significant bit is stored at the lowest address, followed by the other bits, in order of increasing significance. | - +-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+ + +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ | :py:data:`~nifgen.ByteOrder.BIG` | Big Endian Data—The most significant bit is stored at the lowest address, followed by the other bits, in order of decreasing significance. | - +-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+ + +-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ .. note:: Data written by most applications in Windows (including LabWindows™/CVI™) is in Little Endian format. Data written to a file @@ -5809,11 +5761,11 @@ get_self_cal_supported ****Defined Values**** - +-------+------------------------------------+ + +-------+--------------------------------------+ | True | Self–calibration is supported. | - +-------+------------------------------------+ + +-------+--------------------------------------+ | False | Self–calibration is not supported. | - +-------+------------------------------------+ + +-------+--------------------------------------+ @@ -6698,101 +6650,99 @@ Properties Methods ------- -+--------------------------------------------------------------------+ -| Method name | -+====================================================================+ -| :py:func:`nifgen.Session.abort` | -+--------------------------------------------------------------------+ -| :py:func:`nifgen.Session.allocate_named_waveform` | -+--------------------------------------------------------------------+ -| :py:func:`nifgen.Session.allocate_waveform` | -+--------------------------------------------------------------------+ -| :py:func:`nifgen.Session.clear_arb_memory` | -+--------------------------------------------------------------------+ -| :py:func:`nifgen.Session.clear_arb_sequence` | -+--------------------------------------------------------------------+ -| :py:func:`nifgen.Session.clear_freq_list` | -+--------------------------------------------------------------------+ -| :py:func:`nifgen.Session.clear_user_standard_waveform` | -+--------------------------------------------------------------------+ -| :py:func:`nifgen.Session.commit` | -+--------------------------------------------------------------------+ -| :py:func:`nifgen.Session.configure_arb_sequence` | -+--------------------------------------------------------------------+ -| :py:func:`nifgen.Session.configure_arb_waveform` | -+--------------------------------------------------------------------+ -| :py:func:`nifgen.Session.configure_custom_fir_filter_coefficients` | -+--------------------------------------------------------------------+ -| :py:func:`nifgen.Session.configure_freq_list` | -+--------------------------------------------------------------------+ -| :py:func:`nifgen.Session.configure_standard_waveform` | -+--------------------------------------------------------------------+ -| :py:func:`nifgen.Session.create_advanced_arb_sequence` | -+--------------------------------------------------------------------+ -| :py:func:`nifgen.Session.create_arb_sequence` | -+--------------------------------------------------------------------+ -| :py:func:`nifgen.Session.create_freq_list` | -+--------------------------------------------------------------------+ -| :py:func:`nifgen.Session.create_waveform_from_file_f64` | -+--------------------------------------------------------------------+ -| :py:func:`nifgen.Session.create_waveform_from_file_i16` | -+--------------------------------------------------------------------+ -| :py:func:`nifgen.Session.create_waveform_numpy` | -+--------------------------------------------------------------------+ -| :py:func:`nifgen.Session.define_user_standard_waveform` | -+--------------------------------------------------------------------+ -| :py:func:`nifgen.Session.delete_script` | -+--------------------------------------------------------------------+ -| :py:func:`nifgen.Session.delete_waveform` | -+--------------------------------------------------------------------+ -| :py:func:`nifgen.Session.disable` | -+--------------------------------------------------------------------+ -| :py:func:`nifgen.Session.get_ext_cal_last_date_and_time` | -+--------------------------------------------------------------------+ -| :py:func:`nifgen.Session.get_ext_cal_last_temp` | -+--------------------------------------------------------------------+ -| :py:func:`nifgen.Session.get_ext_cal_recommended_interval` | -+--------------------------------------------------------------------+ -| :py:func:`nifgen.Session.get_hardware_state` | -+--------------------------------------------------------------------+ -| :py:func:`nifgen.Session.get_self_cal_last_date_and_time` | -+--------------------------------------------------------------------+ -| :py:func:`nifgen.Session.get_self_cal_last_temp` | -+--------------------------------------------------------------------+ -| :py:func:`nifgen.Session.get_self_cal_supported` | -+--------------------------------------------------------------------+ -| :py:func:`nifgen.Session.is_done` | -+--------------------------------------------------------------------+ -| :py:func:`nifgen.Session.lock` | -+--------------------------------------------------------------------+ -| :py:func:`nifgen.Session.query_arb_seq_capabilities` | -+--------------------------------------------------------------------+ -| :py:func:`nifgen.Session.query_arb_wfm_capabilities` | -+--------------------------------------------------------------------+ -| :py:func:`nifgen.Session.query_freq_list_capabilities` | -+--------------------------------------------------------------------+ -| :py:func:`nifgen.Session.read_current_temperature` | -+--------------------------------------------------------------------+ -| :py:func:`nifgen.Session.reset` | -+--------------------------------------------------------------------+ -| :py:func:`nifgen.Session.reset_device` | -+--------------------------------------------------------------------+ -| :py:func:`nifgen.Session.reset_with_defaults` | -+--------------------------------------------------------------------+ -| :py:func:`nifgen.Session.self_cal` | -+--------------------------------------------------------------------+ -| :py:func:`nifgen.Session.self_test` | -+--------------------------------------------------------------------+ -| :py:func:`nifgen.Session.send_software_edge_trigger` | -+--------------------------------------------------------------------+ -| :py:func:`nifgen.Session.set_next_write_position` | -+--------------------------------------------------------------------+ -| :py:func:`nifgen.Session.unlock` | -+--------------------------------------------------------------------+ -| :py:func:`nifgen.Session.wait_until_done` | -+--------------------------------------------------------------------+ -| :py:func:`nifgen.Session.write_script` | -+--------------------------------------------------------------------+ -| :py:func:`nifgen.Session.write_waveform` | -+--------------------------------------------------------------------+ ++------------------------------------------------------------+ +| Method name | ++============================================================+ +| :py:func:`nifgen.Session.abort` | ++------------------------------------------------------------+ +| :py:func:`nifgen.Session.allocate_named_waveform` | ++------------------------------------------------------------+ +| :py:func:`nifgen.Session.allocate_waveform` | ++------------------------------------------------------------+ +| :py:func:`nifgen.Session.clear_arb_memory` | ++------------------------------------------------------------+ +| :py:func:`nifgen.Session.clear_arb_sequence` | ++------------------------------------------------------------+ +| :py:func:`nifgen.Session.clear_freq_list` | ++------------------------------------------------------------+ +| :py:func:`nifgen.Session.clear_user_standard_waveform` | ++------------------------------------------------------------+ +| :py:func:`nifgen.Session.commit` | ++------------------------------------------------------------+ +| :py:func:`nifgen.Session.configure_arb_sequence` | ++------------------------------------------------------------+ +| :py:func:`nifgen.Session.configure_arb_waveform` | ++------------------------------------------------------------+ +| :py:func:`nifgen.Session.configure_freq_list` | ++------------------------------------------------------------+ +| :py:func:`nifgen.Session.configure_standard_waveform` | ++------------------------------------------------------------+ +| :py:func:`nifgen.Session.create_advanced_arb_sequence` | ++------------------------------------------------------------+ +| :py:func:`nifgen.Session.create_arb_sequence` | ++------------------------------------------------------------+ +| :py:func:`nifgen.Session.create_freq_list` | ++------------------------------------------------------------+ +| :py:func:`nifgen.Session.create_waveform_from_file_f64` | ++------------------------------------------------------------+ +| :py:func:`nifgen.Session.create_waveform_from_file_i16` | ++------------------------------------------------------------+ +| :py:func:`nifgen.Session.create_waveform_numpy` | ++------------------------------------------------------------+ +| :py:func:`nifgen.Session.define_user_standard_waveform` | ++------------------------------------------------------------+ +| :py:func:`nifgen.Session.delete_script` | ++------------------------------------------------------------+ +| :py:func:`nifgen.Session.delete_waveform` | ++------------------------------------------------------------+ +| :py:func:`nifgen.Session.disable` | ++------------------------------------------------------------+ +| :py:func:`nifgen.Session.get_ext_cal_last_date_and_time` | ++------------------------------------------------------------+ +| :py:func:`nifgen.Session.get_ext_cal_last_temp` | ++------------------------------------------------------------+ +| :py:func:`nifgen.Session.get_ext_cal_recommended_interval` | ++------------------------------------------------------------+ +| :py:func:`nifgen.Session.get_hardware_state` | ++------------------------------------------------------------+ +| :py:func:`nifgen.Session.get_self_cal_last_date_and_time` | ++------------------------------------------------------------+ +| :py:func:`nifgen.Session.get_self_cal_last_temp` | ++------------------------------------------------------------+ +| :py:func:`nifgen.Session.get_self_cal_supported` | ++------------------------------------------------------------+ +| :py:func:`nifgen.Session.is_done` | ++------------------------------------------------------------+ +| :py:func:`nifgen.Session.lock` | ++------------------------------------------------------------+ +| :py:func:`nifgen.Session.query_arb_seq_capabilities` | ++------------------------------------------------------------+ +| :py:func:`nifgen.Session.query_arb_wfm_capabilities` | ++------------------------------------------------------------+ +| :py:func:`nifgen.Session.query_freq_list_capabilities` | ++------------------------------------------------------------+ +| :py:func:`nifgen.Session.read_current_temperature` | ++------------------------------------------------------------+ +| :py:func:`nifgen.Session.reset` | ++------------------------------------------------------------+ +| :py:func:`nifgen.Session.reset_device` | ++------------------------------------------------------------+ +| :py:func:`nifgen.Session.reset_with_defaults` | ++------------------------------------------------------------+ +| :py:func:`nifgen.Session.self_cal` | ++------------------------------------------------------------+ +| :py:func:`nifgen.Session.self_test` | ++------------------------------------------------------------+ +| :py:func:`nifgen.Session.send_software_edge_trigger` | ++------------------------------------------------------------+ +| :py:func:`nifgen.Session.set_next_write_position` | ++------------------------------------------------------------+ +| :py:func:`nifgen.Session.unlock` | ++------------------------------------------------------------+ +| :py:func:`nifgen.Session.wait_until_done` | ++------------------------------------------------------------+ +| :py:func:`nifgen.Session.write_script` | ++------------------------------------------------------------+ +| :py:func:`nifgen.Session.write_waveform` | ++------------------------------------------------------------+ diff --git a/generated/nidcpower/session.py b/generated/nidcpower/session.py index 21591026c..48985f34d 100644 --- a/generated/nidcpower/session.py +++ b/generated/nidcpower/session.py @@ -3842,109 +3842,109 @@ def _create_advanced_sequence(self, sequence_name, attribute_ids, set_as_active_ +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ | Property | PXIe-4135 | PXIe-4136 | PXIe-4137 | PXIe-4138 | PXIe-4139 | PXIe-4140/4142/4144 | PXIe-4141/4143/4145 | PXIe-4162/4163 | +================================+===========+===========+===========+===========+===========+=====================+=====================+================+ - | dc_noise_rejection | ✓ | ✕ | ✓ | ✕ | ✓ | ✕ | ✕ | ✓ | + | dc_noise_rejection | ✓ | ✕ | ✓ | ✕ | ✓ | ✕ | ✕ | ✓ | +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ - | aperture_time | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | + | aperture_time | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ - | measure_record_length | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | + | measure_record_length | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ - | sense | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | + | sense | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ - | ovp_enabled | ✓ | ✓ | ✓ | ✕ | ✕ | ✕ | ✕ | ✕ | + | ovp_enabled | ✓ | ✓ | ✓ | ✕ | ✕ | ✕ | ✕ | ✕ | +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ - | ovp_limit | ✓ | ✓ | ✓ | ✕ | ✕ | ✕ | ✕ | ✕ | + | ovp_limit | ✓ | ✓ | ✓ | ✕ | ✕ | ✕ | ✕ | ✕ | +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ - | pulse_bias_delay | ✓ | ✓ | ✓ | ✓ | ✓ | ✕ | ✕ | ✕ | + | pulse_bias_delay | ✓ | ✓ | ✓ | ✓ | ✓ | ✕ | ✕ | ✕ | +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ - | pulse_off_time | ✓ | ✓ | ✓ | ✓ | ✓ | ✕ | ✕ | ✕ | + | pulse_off_time | ✓ | ✓ | ✓ | ✓ | ✓ | ✕ | ✕ | ✕ | +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ - | pulse_on_time | ✓ | ✓ | ✓ | ✓ | ✓ | ✕ | ✕ | ✕ | + | pulse_on_time | ✓ | ✓ | ✓ | ✓ | ✓ | ✕ | ✕ | ✕ | +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ - | source_delay | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | + | source_delay | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ - | current_compensation_frequency | ✓ | ✕ | ✓ | ✕ | ✓ | ✕ | ✓ | ✓ | + | current_compensation_frequency | ✓ | ✕ | ✓ | ✕ | ✓ | ✕ | ✓ | ✓ | +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ - | current_gain_bandwidth | ✓ | ✕ | ✓ | ✕ | ✓ | ✕ | ✓ | ✓ | + | current_gain_bandwidth | ✓ | ✕ | ✓ | ✕ | ✓ | ✕ | ✓ | ✓ | +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ - | current_pole_zero_ratio | ✓ | ✕ | ✓ | ✕ | ✓ | ✕ | ✓ | ✓ | + | current_pole_zero_ratio | ✓ | ✕ | ✓ | ✕ | ✓ | ✕ | ✓ | ✓ | +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ - | voltage_compensation_frequency | ✓ | ✕ | ✓ | ✕ | ✓ | ✕ | ✓ | ✓ | + | voltage_compensation_frequency | ✓ | ✕ | ✓ | ✕ | ✓ | ✕ | ✓ | ✓ | +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ - | voltage_gain_bandwidth | ✓ | ✕ | ✓ | ✕ | ✓ | ✕ | ✓ | ✓ | + | voltage_gain_bandwidth | ✓ | ✕ | ✓ | ✕ | ✓ | ✕ | ✓ | ✓ | +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ - | voltage_pole_zero_ratio | ✓ | ✕ | ✓ | ✕ | ✓ | ✕ | ✓ | ✓ | + | voltage_pole_zero_ratio | ✓ | ✕ | ✓ | ✕ | ✓ | ✕ | ✓ | ✓ | +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ - | current_level | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | + | current_level | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ - | current_level_range | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | + | current_level_range | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ - | voltage_limit | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | + | voltage_limit | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ - | voltage_limit_high | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✕ | + | voltage_limit_high | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✕ | +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ - | voltage_limit_low | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✕ | + | voltage_limit_low | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✕ | +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ - | voltage_limit_range | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | + | voltage_limit_range | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ - | current_limit | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | + | current_limit | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ - | current_limit_high | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✕ | + | current_limit_high | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✕ | +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ - | current_limit_low | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✕ | + | current_limit_low | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✕ | +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ - | current_limit_range | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | + | current_limit_range | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ - | voltage_level | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | + | voltage_level | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ - | voltage_level_range | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | + | voltage_level_range | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ - | output_enabled | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | + | output_enabled | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ - | output_function | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | + | output_function | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ - | output_resistance | ✓ | ✕ | ✓ | ✕ | ✓ | ✕ | ✓ | ✕ | + | output_resistance | ✓ | ✕ | ✓ | ✕ | ✓ | ✕ | ✓ | ✕ | +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ - | pulse_bias_current_level | ✓ | ✓ | ✓ | ✓ | ✓ | ✕ | ✕ | ✕ | + | pulse_bias_current_level | ✓ | ✓ | ✓ | ✓ | ✓ | ✕ | ✕ | ✕ | +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ - | pulse_bias_voltage_limit | ✓ | ✓ | ✓ | ✓ | ✓ | ✕ | ✕ | ✕ | + | pulse_bias_voltage_limit | ✓ | ✓ | ✓ | ✓ | ✓ | ✕ | ✕ | ✕ | +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ - | pulse_bias_voltage_limit_high | ✓ | ✓ | ✓ | ✓ | ✓ | ✕ | ✕ | ✕ | + | pulse_bias_voltage_limit_high | ✓ | ✓ | ✓ | ✓ | ✓ | ✕ | ✕ | ✕ | +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ - | pulse_bias_voltage_limit_low | ✓ | ✓ | ✓ | ✓ | ✓ | ✕ | ✕ | ✕ | + | pulse_bias_voltage_limit_low | ✓ | ✓ | ✓ | ✓ | ✓ | ✕ | ✕ | ✕ | +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ - | pulse_current_level | ✓ | ✓ | ✓ | ✓ | ✓ | ✕ | ✕ | ✕ | + | pulse_current_level | ✓ | ✓ | ✓ | ✓ | ✓ | ✕ | ✕ | ✕ | +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ - | pulse_current_level_range | ✓ | ✓ | ✓ | ✓ | ✓ | ✕ | ✕ | ✕ | + | pulse_current_level_range | ✓ | ✓ | ✓ | ✓ | ✓ | ✕ | ✕ | ✕ | +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ - | pulse_voltage_limit | ✓ | ✓ | ✓ | ✓ | ✓ | ✕ | ✕ | ✕ | + | pulse_voltage_limit | ✓ | ✓ | ✓ | ✓ | ✓ | ✕ | ✕ | ✕ | +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ - | pulse_voltage_limit_high | ✓ | ✓ | ✓ | ✓ | ✓ | ✕ | ✕ | ✕ | + | pulse_voltage_limit_high | ✓ | ✓ | ✓ | ✓ | ✓ | ✕ | ✕ | ✕ | +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ - | pulse_voltage_limit_low | ✓ | ✓ | ✓ | ✓ | ✓ | ✕ | ✕ | ✕ | + | pulse_voltage_limit_low | ✓ | ✓ | ✓ | ✓ | ✓ | ✕ | ✕ | ✕ | +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ - | pulse_voltage_limit_range | ✓ | ✓ | ✓ | ✓ | ✓ | ✕ | ✕ | ✕ | + | pulse_voltage_limit_range | ✓ | ✓ | ✓ | ✓ | ✓ | ✕ | ✕ | ✕ | +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ - | pulse_bias_current_limit | ✓ | ✓ | ✓ | ✓ | ✓ | ✕ | ✕ | ✕ | + | pulse_bias_current_limit | ✓ | ✓ | ✓ | ✓ | ✓ | ✕ | ✕ | ✕ | +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ - | pulse_bias_current_limit_high | ✓ | ✓ | ✓ | ✓ | ✓ | ✕ | ✕ | ✕ | + | pulse_bias_current_limit_high | ✓ | ✓ | ✓ | ✓ | ✓ | ✕ | ✕ | ✕ | +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ - | pulse_bias_current_limit_low | ✓ | ✓ | ✓ | ✓ | ✓ | ✕ | ✕ | ✕ | + | pulse_bias_current_limit_low | ✓ | ✓ | ✓ | ✓ | ✓ | ✕ | ✕ | ✕ | +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ - | pulse_bias_voltage_level | ✓ | ✓ | ✓ | ✓ | ✓ | ✕ | ✕ | ✕ | + | pulse_bias_voltage_level | ✓ | ✓ | ✓ | ✓ | ✓ | ✕ | ✕ | ✕ | +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ - | pulse_current_limit | ✓ | ✓ | ✓ | ✓ | ✓ | ✕ | ✕ | ✕ | + | pulse_current_limit | ✓ | ✓ | ✓ | ✓ | ✓ | ✕ | ✕ | ✕ | +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ - | pulse_current_limit_high | ✓ | ✓ | ✓ | ✓ | ✓ | ✕ | ✕ | ✕ | + | pulse_current_limit_high | ✓ | ✓ | ✓ | ✓ | ✓ | ✕ | ✕ | ✕ | +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ - | pulse_current_limit_low | ✓ | ✓ | ✓ | ✓ | ✓ | ✕ | ✕ | ✕ | + | pulse_current_limit_low | ✓ | ✓ | ✓ | ✓ | ✓ | ✕ | ✕ | ✕ | +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ - | pulse_current_limit_range | ✓ | ✓ | ✓ | ✓ | ✓ | ✕ | ✕ | ✕ | + | pulse_current_limit_range | ✓ | ✓ | ✓ | ✓ | ✓ | ✕ | ✕ | ✕ | +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ - | pulse_voltage_level | ✓ | ✓ | ✓ | ✓ | ✓ | ✕ | ✕ | ✕ | + | pulse_voltage_level | ✓ | ✓ | ✓ | ✓ | ✓ | ✕ | ✕ | ✕ | +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ - | pulse_voltage_level_range | ✓ | ✓ | ✓ | ✓ | ✓ | ✕ | ✕ | ✕ | + | pulse_voltage_level_range | ✓ | ✓ | ✓ | ✓ | ✓ | ✕ | ✕ | ✕ | +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ - | transient_response | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | + | transient_response | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | +--------------------------------+-----------+-----------+-----------+-----------+-----------+---------------------+---------------------+----------------+ set_as_active_sequence (bool): Specifies that this current sequence is active. diff --git a/generated/nidmm/session.py b/generated/nidmm/session.py index be1b31aad..fe056ffec 100644 --- a/generated/nidmm/session.py +++ b/generated/nidmm/session.py @@ -1427,25 +1427,25 @@ def configure_rtd_type(self, rtd_type, rtd_resistance): NI-DMM uses this value to set the RTD Type property. The default is RTDType.PT3851. - +---------------------------------+-----------------------------------------------+----------+---------+-------------------------+-------------------------------------------------------------------------------+-------------------------------+ - | Enum | Standards | Material | TCR (α) | Typical R\ :sub:`0` (Ω) | Notes | | - +=================================+===============================================+==========+=========+=========================+===============================================================================+===============================+ - | Callendar-Van Dusen Coefficient | | | | | | | - +---------------------------------+-----------------------------------------------+----------+---------+-------------------------+-------------------------------------------------------------------------------+-------------------------------+ - | RTDType.PT3851 | IEC-751 DIN 43760 BS 1904 ASTM-E1137 EN-60751 | Platinum | .003851 | 100 Ω 1000 Ω | A = 3.9083 × 10\ :sup:`–3` B = –5.775×10:sup:`–7` C = –4.183×10:sup:`–12` | Most common RTDs | - +---------------------------------+-----------------------------------------------+----------+---------+-------------------------+-------------------------------------------------------------------------------+-------------------------------+ - | RTDType.PT3750 | Low-cost vendor compliant RTD\* | Platinum | .003750 | 1000 Ω | A = 3.81 × 10\ :sup:`–3` B = –6.02×10:sup:`–7` C = –6.0×10:sup:`–12` | Low-cost RTD | - +---------------------------------+-----------------------------------------------+----------+---------+-------------------------+-------------------------------------------------------------------------------+-------------------------------+ - | RTDType.PT3916 | JISC 1604 | Platinum | .003916 | 100 Ω | A = 3.9739 × 10\ :sup:`–3` B = –5.870×10:sup:`–7` C = –4.4 ×10\ :sup:`–12` | Used in primarily in Japan | - +---------------------------------+-----------------------------------------------+----------+---------+-------------------------+-------------------------------------------------------------------------------+-------------------------------+ - | RTDType.PT3920 | US Industrial Standard D-100 American | Platinum | .003920 | 100 Ω | A = 3.9787 × 10\ :sup:`–3` B = –5.8686×10:sup:`–7` C = –4.167 ×10\ :sup:`–12` | Low-cost RTD | - +---------------------------------+-----------------------------------------------+----------+---------+-------------------------+-------------------------------------------------------------------------------+-------------------------------+ - | RTDType.PT3911 | US Industrial Standard American | Platinum | .003911 | 100 Ω | A = 3.9692 × 10\ :sup:`–3` B = –5.8495×10:sup:`–7` C = –4.233 ×10\ :sup:`–12` | Low-cost RTD | - +---------------------------------+-----------------------------------------------+----------+---------+-------------------------+-------------------------------------------------------------------------------+-------------------------------+ - | RTDType.PT3928 | ITS-90 | Platinum | .003928 | 100 Ω | A = 3.9888 × 10\ :sup:`–3` B = –5.915×10:sup:`–7` C = –3.85 ×10\ :sup:`–12` | The definition of temperature | - +---------------------------------+-----------------------------------------------+----------+---------+-------------------------+-------------------------------------------------------------------------------+-------------------------------+ - | \*No standard. Check the TCR. | | | | | | | - +---------------------------------+-----------------------------------------------+----------+---------+-------------------------+-------------------------------------------------------------------------------+-------------------------------+ + +---------------------------------+-----------------------------------------------+----------+----------+--------------------------+--------------------------------------------------------------------------------------------+-------------------------------+ + | Enum | Standards | Material | TCR (α) | Typical R\ :sub:`0` (Ω) | Notes | | + +=================================+===============================================+==========+==========+==========================+============================================================================================+===============================+ + | Callendar-Van Dusen Coefficient | | | | | | | + +---------------------------------+-----------------------------------------------+----------+----------+--------------------------+--------------------------------------------------------------------------------------------+-------------------------------+ + | RTDType.PT3851 | IEC-751 DIN 43760 BS 1904 ASTM-E1137 EN-60751 | Platinum | .003851 | 100 Ω 1000 Ω | A = 3.9083 × 10\ :sup:`–3` B = –5.775×10:sup:`–7` C = –4.183×10:sup:`–12` | Most common RTDs | + +---------------------------------+-----------------------------------------------+----------+----------+--------------------------+--------------------------------------------------------------------------------------------+-------------------------------+ + | RTDType.PT3750 | Low-cost vendor compliant RTD\* | Platinum | .003750 | 1000 Ω | A = 3.81 × 10\ :sup:`–3` B = –6.02×10:sup:`–7` C = –6.0×10:sup:`–12` | Low-cost RTD | + +---------------------------------+-----------------------------------------------+----------+----------+--------------------------+--------------------------------------------------------------------------------------------+-------------------------------+ + | RTDType.PT3916 | JISC 1604 | Platinum | .003916 | 100 Ω | A = 3.9739 × 10\ :sup:`–3` B = –5.870×10:sup:`–7` C = –4.4 ×10\ :sup:`–12` | Used in primarily in Japan | + +---------------------------------+-----------------------------------------------+----------+----------+--------------------------+--------------------------------------------------------------------------------------------+-------------------------------+ + | RTDType.PT3920 | US Industrial Standard D-100 American | Platinum | .003920 | 100 Ω | A = 3.9787 × 10\ :sup:`–3` B = –5.8686×10:sup:`–7` C = –4.167 ×10\ :sup:`–12` | Low-cost RTD | + +---------------------------------+-----------------------------------------------+----------+----------+--------------------------+--------------------------------------------------------------------------------------------+-------------------------------+ + | RTDType.PT3911 | US Industrial Standard American | Platinum | .003911 | 100 Ω | A = 3.9692 × 10\ :sup:`–3` B = –5.8495×10:sup:`–7` C = –4.233 ×10\ :sup:`–12` | Low-cost RTD | + +---------------------------------+-----------------------------------------------+----------+----------+--------------------------+--------------------------------------------------------------------------------------------+-------------------------------+ + | RTDType.PT3928 | ITS-90 | Platinum | .003928 | 100 Ω | A = 3.9888 × 10\ :sup:`–3` B = –5.915×10:sup:`–7` C = –3.85 ×10\ :sup:`–12` | The definition of temperature | + +---------------------------------+-----------------------------------------------+----------+----------+--------------------------+--------------------------------------------------------------------------------------------+-------------------------------+ + | \*No standard. Check the TCR. | | | | | | | + +---------------------------------+-----------------------------------------------+----------+----------+--------------------------+--------------------------------------------------------------------------------------------+-------------------------------+ rtd_resistance (float): Specifies the RTD resistance in ohms at 0 °C. NI-DMM uses this value to set the RTD Resistance property. The default is 100 (Ω). diff --git a/generated/nifgen/session.py b/generated/nifgen/session.py index a31d4f61b..ad936ae01 100644 --- a/generated/nifgen/session.py +++ b/generated/nifgen/session.py @@ -1606,11 +1606,11 @@ def create_waveform_from_file_f64(self, file_name, byte_order): | | ****Default Value**:** ByteOrder.LITTLE - +------------------+------------------------------------------------------------------------------------------------------------------------------------------------+ + +------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ | ByteOrder.LITTLE | Little Endian Data—The least significant bit is stored at the lowest address, followed by the other bits, in order of increasing significance. | - +------------------+------------------------------------------------------------------------------------------------------------------------------------------------+ + +------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ | ByteOrder.BIG | Big Endian Data—The most significant bit is stored at the lowest address, followed by the other bits, in order of decreasing significance. | - +------------------+------------------------------------------------------------------------------------------------------------------------------------------------+ + +------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ Note: Data written by most applications in Windows (including @@ -1670,11 +1670,11 @@ def create_waveform_from_file_i16(self, file_name, byte_order): | | ****Default Value**:** ByteOrder.LITTLE - +------------------+------------------------------------------------------------------------------------------------------------------------------------------------+ + +------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ | ByteOrder.LITTLE | Little Endian Data—The least significant bit is stored at the lowest address, followed by the other bits, in order of increasing significance. | - +------------------+------------------------------------------------------------------------------------------------------------------------------------------------+ + +------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ | ByteOrder.BIG | Big Endian Data—The most significant bit is stored at the lowest address, followed by the other bits, in order of decreasing significance. | - +------------------+------------------------------------------------------------------------------------------------------------------------------------------------+ + +------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ Note: Data written by most applications in Windows (including @@ -3795,11 +3795,11 @@ def get_self_cal_supported(self): ****Defined Values**** - +-------+------------------------------------+ + +-------+--------------------------------------+ | True | Self–calibration is supported. | - +-------+------------------------------------+ + +-------+--------------------------------------+ | False | Self–calibration is not supported. | - +-------+------------------------------------+ + +-------+--------------------------------------+ ''' vi_ctype = _visatype.ViSession(self._vi) # case S110 diff --git a/generated/nitclk/__init__.py b/generated/nitclk/__init__.py new file mode 100644 index 000000000..e89737a14 --- /dev/null +++ b/generated/nitclk/__init__.py @@ -0,0 +1,95 @@ +# -*- coding: utf-8 -*- +# This file was generated + + +__version__ = '0.1.0.dev0' + +from nitclk.errors import DriverWarning # noqa: F401 +from nitclk.errors import Error # noqa: F401 +from nitclk.session import Session # noqa: F401 + + +def get_diagnostic_information(): + '''Get diagnostic information about the system state that is suitable for printing or logging + + returns: dict + + note: Python bitness may be incorrect when running in a virtual environment + ''' + import os + import pkg_resources + import platform + import struct + import sys + + def is_python_64bit(): + return (struct.calcsize("P") == 8) + + def is_os_64bit(): + return platform.machine().endswith('64') + + def is_venv(): + return 'VIRTUAL_ENV' in os.environ + + info = {} + info['os'] = {} + info['python'] = {} + info['driver'] = {} + info['module'] = {} + if platform.system() == 'Windows': + try: + import winreg as winreg + except ImportError: + import _winreg as winreg + + os_name = 'Windows' + try: + driver_version_key = winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, r"SOFTWARE\National Instruments\NI-TClk\CurrentVersion") + driver_version = winreg.QueryValueEx(driver_version_key, "Version")[0] + except WindowsError: + driver_version = 'Unknown' + elif platform.system() == 'Linux': + os_name = 'Linux' + driver_version = 'Unknown' + else: + raise SystemError('Unsupported platform: {}'.format(platform.system())) + + installed_packages = pkg_resources.working_set + installed_packages_list = [{'name': i.key, 'version': i.version, } for i in installed_packages] + + info['os']['name'] = os_name + info['os']['version'] = platform.version() + info['os']['bits'] = '64' if is_os_64bit() else '32' + info['driver']['name'] = "NI-TClk" + info['driver']['version'] = driver_version + info['module']['name'] = 'nitclk' + info['module']['version'] = "0.1.0.dev0" + info['python']['version'] = sys.version + info['python']['bits'] = '64' if is_python_64bit() else '32' + info['python']['is_venv'] = is_venv() + info['python']['packages'] = installed_packages_list + + return info + + +def print_diagnostic_information(): + '''Print diagnostic information in a format suitable for issue report + + note: Python bitness may be incorrect when running in a virtual environment + ''' + info = get_diagnostic_information() + + row_format = ' {:<10} {}' + for type in ['OS', 'Driver', 'Module', 'Python']: + typename = type.lower() + print(type + ':') + for item in info[typename]: + if item != 'packages': + print(row_format.format(item.title() + ':', info[typename][item])) + print(' Installed Packages:') + for p in info['python']['packages']: + print((' ' * 8) + p['name'] + '==' + p['version']) + + return info + + From 7baef6a8c76ead17a2554ae7c2a1d8b45efd7119 Mon Sep 17 00:00:00 2001 From: Mark Silva Date: Tue, 3 Sep 2019 14:00:14 -0500 Subject: [PATCH 24/56] Can't skip README.rst --- docs/_static/nitclk_usage.inc | 11 +++++++++++ src/nitclk/nitclk.mak | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 docs/_static/nitclk_usage.inc diff --git a/docs/_static/nitclk_usage.inc b/docs/_static/nitclk_usage.inc new file mode 100644 index 000000000..120e4a9f7 --- /dev/null +++ b/docs/_static/nitclk_usage.inc @@ -0,0 +1,11 @@ +Usage +------ + +The following is a basic example of using the **nitclk** module + +.. code-block:: python + + import nitclk + +Additional examples for NI-TClk are located in src/nitclk/examples/ directory. + diff --git a/src/nitclk/nitclk.mak b/src/nitclk/nitclk.mak index 28c8b2fa6..25e6e7a4e 100644 --- a/src/nitclk/nitclk.mak +++ b/src/nitclk/nitclk.mak @@ -10,7 +10,7 @@ MODULE_FILES_TO_COPY := $(DEFAULT_PY_FILES_TO_COPY) # Eventually we will get back to this as we add/update more files # RST_FILES_TO_GENERATE := $(filter-out enums.rst,$(DEFAULT_RST_FILES_TO_GENERATE)) -RST_FILES_TO_GENERATE := $(filter-out README.rst examples.rst enums.rst,$(DEFAULT_RST_FILES_TO_GENERATE)) +RST_FILES_TO_GENERATE := $(filter-out examples.rst enums.rst,$(DEFAULT_RST_FILES_TO_GENERATE)) include $(BUILD_HELPER_DIR)/rules.mak From f05da6485506eab4ebe6a4c09771095df5757cdc Mon Sep 17 00:00:00 2001 From: Mark Silva Date: Tue, 3 Sep 2019 14:06:43 -0500 Subject: [PATCH 25/56] Update templates --- build/templates/__init__.py.mako | 18 +++++++++++++++++ build/templates/_attributes.py.mako | 15 +++++++++++++++ build/templates/_converters.py.mako | 30 +++++++++++++++++++++++++++++ 3 files changed, 63 insertions(+) diff --git a/build/templates/__init__.py.mako b/build/templates/__init__.py.mako index 05382e06d..f7cd0d909 100644 --- a/build/templates/__init__.py.mako +++ b/build/templates/__init__.py.mako @@ -1,7 +1,10 @@ ${template_parameters['encoding_tag']} # This file was generated <% +import build.helper as helper + enums = template_parameters['metadata'].enums +functions = helper.filter_codegen_functions(template_parameters['metadata'].functions) config = template_parameters['metadata'].config module_name = config['module_name'] registry_name = config['driver_registry'] if 'driver_registry' in config else config['driver_name'] @@ -14,7 +17,22 @@ from ${module_name}.enums import * # noqa: F403,F401,H303 % endif from ${module_name}.errors import DriverWarning # noqa: F401 from ${module_name}.errors import Error # noqa: F401 +<% +# nitclk is different. It does not have a session class that we open a session on +# Instead it is a bunch of stateless function calls. So if we are NOT building for +# nitclk, we import the Session class like before. If it is nitclk then we will +# import each function and the SessionReference class +%>\ +% if config['module_name'] != 'nitclk': from ${module_name}.session import Session # noqa: F401 +% else: +from ${module_name}.session import SessionReference # noqa: F401 + +# Function imports +% for func_name in sorted([functions[k]['python_name'] for k in functions if not functions[k]['render_in_session_base']]): +from ${module_name}.session import ${func_name} # noqa: F401 +% endfor +% endif <% # Blank lines are to make each import separate so that they do not need to be sorted # Otherwise flake8 test fails diff --git a/build/templates/_attributes.py.mako b/build/templates/_attributes.py.mako index 857629439..9f084dcfa 100644 --- a/build/templates/_attributes.py.mako +++ b/build/templates/_attributes.py.mako @@ -2,6 +2,7 @@ ${template_parameters['encoding_tag']} # This file was generated <% module_name = template_parameters['metadata'].config['module_name'] + config = template_parameters['metadata'].config %>\ import ${module_name}._converters as _converters @@ -112,4 +113,18 @@ class AttributeEnum(object): return self._underlying_attribute.__set__(session, value.value) +% if config['module_name'] == 'nitclk': +# nitclk specific attribute type +class AttributeViInt32SessionReference(Attribute): + + def __get__(self, session, session_type): + # Import here to avoid a circular dependency when initial import happens + from ${module_name}.session import SessionReference + return SessionReference(session._get_attribute_vi_int32(self._attribute_id)) + + def __set__(self, session, value): + session._set_attribute_vi_int32(self._attribute_id, _converters.convert_to_nitclk_session_num(value)) + + +% endif diff --git a/build/templates/_converters.py.mako b/build/templates/_converters.py.mako index 3d4f860ec..01150443c 100644 --- a/build/templates/_converters.py.mako +++ b/build/templates/_converters.py.mako @@ -215,6 +215,36 @@ def convert_init_with_options_dictionary(values, encoding): return init_with_options_string +% if config['module_name'] == 'nitclk': +# nitclk specific converters +def convert_to_nitclk_session_num(item): + '''Convert from supported objects to NI-TClk Session Num + + Supported objects are: + - class with .tclk object of type nitclk.SessionReference + - nitclk.SessionReference + - NI-TClk Session Num + ''' + try: + return item.tclk.get_session_number() + except KeyError: + pass + + try: + return item.get_session_number() + except KeyError: + pass + + # If we haven't gotten a SessionReference, we assume the item is the actual nitclk session num and return it + return item + + +def convert_to_nitclk_session_num_list(item_list): + '''Converts a list of items to nitclk session nums''' + return [convert_to_nitclk_session_num(i) for i in item_list] + + +% endif # Let's run some tests def test_convert_init_with_options_dictionary(): assert convert_init_with_options_dictionary('', 'ascii') == '' From 31d1509d6ff7fbabaa6e44a3a7607be3f04bd548 Mon Sep 17 00:00:00 2001 From: Mark Silva Date: Tue, 3 Sep 2019 14:47:36 -0500 Subject: [PATCH 26/56] Add new cases for buffers with a converter --- build/helper/codegen_helper.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/build/helper/codegen_helper.py b/build/helper/codegen_helper.py index 3cae46391..52133f611 100644 --- a/build/helper/codegen_helper.py +++ b/build/helper/codegen_helper.py @@ -348,6 +348,8 @@ def _get_ctype_variable_definition_snippet_for_buffers(parameter, parameters, iv B600. Output buffer with mechanism passed-in: get_ctypes_pointer_for_buffer(value-array.array('d', [0] * buffer_size, library_type=ViInt32) B610. Output buffer with mechanism ivi-dance-with-a-twist, QUERY_SIZE: None B620. Output buffer with mechanism ivi-dance-with-a-twist, GET_DATA: get_ctypes_pointer_for_buffer(value=array.array('d', [0] * buffer_size_ctype.value, library_type=ViInt32) + B630. Input buffer of simple types with converter (array): get_ctypes_pointer_for_buffer(value=convert(array.array('d', list)), library_type=visatype.ViReal64) + B640. Input buffer of simple types with converter (list): get_ctypes_pointer_for_buffer(value=convert(array.array('d', list)), library_type=visatype.ViReal64) Return Value (list): each item in the list will be one line needed for the declaration of that parameter @@ -360,6 +362,19 @@ def _get_ctype_variable_definition_snippet_for_buffers(parameter, parameters, iv if parameter['numpy'] is True and use_numpy_array is True: definition = 'get_ctypes_pointer_for_buffer(value={0}) # case B510'.format(parameter['python_name']) + elif parameter['direction'] == 'in' and 'python_api_converter_name' in parameter: + if custom_type is not None: + assert False, 'Custom type {} is not supported with converters'.format(custom_type) + else: + if parameter['use_array']: + # If the incoming type is array.array, we can just use that, otherwise we need to create an array.array that is initialized with the passed in value, which must be iterable + array_declaration = '{0}_array = get_ctypes_and_array(value=_converters.{2}({0}), array_type="{1}") # case B630'.format(parameter['python_name'], get_array_type_for_api_type(parameter['ctypes_type'], parameter['python_api_converter_name'])) + definitions.append(array_declaration) + definition = 'get_ctypes_pointer_for_buffer(value={0}_array, library_type={1}.{2}) # case B630'.format(parameter['python_name'], module_name, parameter['ctypes_type']) + elif parameter['use_list']: + definition = 'get_ctypes_pointer_for_buffer(value=_converters.{3}({0}), library_type={1}.{2}) # case B640'.format(parameter['python_name'], module_name, parameter['ctypes_type'], parameter['python_api_converter_name']) + else: + assert False, "Expected either 'use_array' or 'use_list' to be True. Both False." elif parameter['direction'] == 'in': if custom_type is not None: definition = 'get_ctypes_pointer_for_buffer([{0}.{1}(c) for c in {2}], library_type={0}.{1}) # case B540'.format(module_name, parameter['ctypes_type'], parameter['python_name'], parameter['python_name']) From 95c96da3cf560e454f85a93ac14d7482a28c672d Mon Sep 17 00:00:00 2001 From: Mark Silva Date: Tue, 3 Sep 2019 14:48:15 -0500 Subject: [PATCH 27/56] Need to handle ' []' to normalize everything --- build/helper/metadata_add_all.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/helper/metadata_add_all.py b/build/helper/metadata_add_all.py index 0adb1f3d4..99db8174e 100644 --- a/build/helper/metadata_add_all.py +++ b/build/helper/metadata_add_all.py @@ -292,7 +292,7 @@ def _add_is_session_handle(parameter): def _fix_type(parameter): '''Replace any spaces in the parameter type with an underscore.''' - parameter['type'] = parameter['type'].replace('[ ]', '[]').replace(' ', '_') + parameter['type'] = parameter['type'].replace('[ ]', '[]').replace(' []', '[]').replace(' ', '_') def _add_use_in_python_api(p, parameters): From 0ac90faa3d2af2df8ef15d6964627fa9cd6f77b0 Mon Sep 17 00:00:00 2001 From: Mark Silva Date: Tue, 3 Sep 2019 14:48:49 -0500 Subject: [PATCH 28/56] Get the session handle name from config instead of hardcoding 'vi' --- build/helper/metadata_add_all.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/helper/metadata_add_all.py b/build/helper/metadata_add_all.py index 99db8174e..e1d61961d 100644 --- a/build/helper/metadata_add_all.py +++ b/build/helper/metadata_add_all.py @@ -314,7 +314,7 @@ def _setup_init_function(functions, config): # Change the init_function information for generating the docstring # We are assuming the last parameter is vi out for p in init_function['parameters']: - if p['name'] == 'vi': + if p['name'] == config['session_handle_parameter_name']: p['documentation']['description'] = session_return_text p['type_in_documentation'] = config['module_name'] + '.Session' p['python_name'] = 'session' From 7ab39753857863fba84945b897a34ace286db2bc Mon Sep 17 00:00:00 2001 From: Mark Silva Date: Tue, 3 Sep 2019 17:00:50 -0500 Subject: [PATCH 29/56] Temp commit --- build/helper/codegen_helper.py | 51 ++++++++++++++++++++++++++-------- 1 file changed, 40 insertions(+), 11 deletions(-) diff --git a/build/helper/codegen_helper.py b/build/helper/codegen_helper.py index 52133f611..108adadf6 100644 --- a/build/helper/codegen_helper.py +++ b/build/helper/codegen_helper.py @@ -348,8 +348,7 @@ def _get_ctype_variable_definition_snippet_for_buffers(parameter, parameters, iv B600. Output buffer with mechanism passed-in: get_ctypes_pointer_for_buffer(value-array.array('d', [0] * buffer_size, library_type=ViInt32) B610. Output buffer with mechanism ivi-dance-with-a-twist, QUERY_SIZE: None B620. Output buffer with mechanism ivi-dance-with-a-twist, GET_DATA: get_ctypes_pointer_for_buffer(value=array.array('d', [0] * buffer_size_ctype.value, library_type=ViInt32) - B630. Input buffer of simple types with converter (array): get_ctypes_pointer_for_buffer(value=convert(array.array('d', list)), library_type=visatype.ViReal64) - B640. Input buffer of simple types with converter (list): get_ctypes_pointer_for_buffer(value=convert(array.array('d', list)), library_type=visatype.ViReal64) + B630. Input buffer of simple types with converter: get_ctypes_pointer_for_buffer(value=convert(array.array('d', list)), library_type=visatype.ViReal64) Return Value (list): each item in the list will be one line needed for the declaration of that parameter @@ -372,7 +371,7 @@ def _get_ctype_variable_definition_snippet_for_buffers(parameter, parameters, iv definitions.append(array_declaration) definition = 'get_ctypes_pointer_for_buffer(value={0}_array, library_type={1}.{2}) # case B630'.format(parameter['python_name'], module_name, parameter['ctypes_type']) elif parameter['use_list']: - definition = 'get_ctypes_pointer_for_buffer(value=_converters.{3}({0}), library_type={1}.{2}) # case B640'.format(parameter['python_name'], module_name, parameter['ctypes_type'], parameter['python_api_converter_name']) + definition = 'get_ctypes_pointer_for_buffer(value=_converters.{3}({0}), library_type={1}.{2}) # case B630'.format(parameter['python_name'], module_name, parameter['ctypes_type'], parameter['python_api_converter_name']) else: assert False, "Expected either 'use_array' or 'use_list' to be True. Both False." elif parameter['direction'] == 'in': @@ -1154,6 +1153,31 @@ def get_dictionary_snippet(d, indent=4): 'use_list': True, 'use_in_python_api': True, }, + { # 28 + 'ctypes_type': 'ViReal64', + 'ctypes_type_library_call': 'ctypes.POINTER(ViReal64)', + 'ctypes_variable_name': 'input_array_2_ctype', + 'default_value': None, + 'direction': 'in', + 'documentation': {'description': 'Input array of floats'}, + 'enum': None, + 'is_buffer': True, + 'is_string': False, + 'use_array': False, + 'use_list': True, + 'is_repeated_capability': False, + 'is_session_handle': False, + 'library_method_call_snippet': 'input_array_2_ctype', + 'name': 'inputArray2', + 'numpy': False, + 'python_name': 'input_array_2', + 'python_name_with_default': 'input_array_2=None', + 'python_name_with_doc_default': 'input_array_2=None', + 'python_type': 'float', + 'size': {'mechanism': 'len', 'value': 'inputArraySize2'}, + 'type': 'ViReal64', + 'use_in_python_api': True, + }, ] @@ -1202,6 +1226,11 @@ def test_get_buffer_parameters_for_size_parameter(): assert params[0] == parameters_for_testing[5] +def test_get_ctype_variable_declaration_snippet_case_c010(): + snippet = get_ctype_variable_declaration_snippet(parameters_for_testing[15], parameters_for_testing, IviDanceStep.NOT_APPLICABLE, config_for_testing, use_numpy_array=False) + assert snippet == ["channel_list_ctype = ctypes.create_string_buffer(self._repeated_capability.encode(self._encoding)) # case C010"] + + def test_get_ctype_variable_declaration_snippet_case_c050(): snippet = get_ctype_variable_declaration_snippet(parameters_for_testing[13], parameters_for_testing, IviDanceStep.QUERY_SIZE, config_for_testing, use_numpy_array=False) assert snippet == ["a_string_ctype = None # case C050"] @@ -1258,8 +1287,8 @@ def test_get_ctype_variable_declaration_snippet_case_s150(): def test_get_ctype_variable_declaration_snippet_case_s160(): - snippet = get_ctype_variable_declaration_snippet(parameters_for_testing[11], parameters_for_testing, IviDanceStep.NOT_APPLICABLE, config_for_testing, use_numpy_array=False) - assert snippet == ["input_array_size_ctype = _visatype.ViInt32(0 if input_array is None else len(input_array)) # case S160"] + actual = get_ctype_variable_declaration_snippet(parameters_for_testing[11], parameters_for_testing, IviDanceStep.NOT_APPLICABLE, config_for_testing, use_numpy_array=False) + assert actual == ["input_array_size_ctype = _visatype.ViInt32(0 if input_array is None else len(input_array)) # case S160"] def test_get_ctype_variable_declaration_snippet_case_s170(): @@ -1297,11 +1326,6 @@ def test_get_ctype_variable_declaration_snippet_case_b510(): assert snippet == ["output_ctype = get_ctypes_pointer_for_buffer(value=output) # case B510"] -def test_get_ctype_variable_declaration_snippet_case_b520(): - snippet = get_ctype_variable_declaration_snippet(parameters_for_testing[15], parameters_for_testing, IviDanceStep.NOT_APPLICABLE, config_for_testing, use_numpy_array=False) - assert snippet == ["channel_list_ctype = ctypes.create_string_buffer(self._repeated_capability.encode(self._encoding)) # case C010"] - - def test_get_ctype_variable_declaration_snippet_case_b530(): snippet = get_ctype_variable_declaration_snippet(parameters_for_testing[16], parameters_for_testing, IviDanceStep.NOT_APPLICABLE, config_for_testing, use_numpy_array=False) assert snippet == ["a_string_ctype = ctypes.create_string_buffer(a_string.encode(self._encoding)) # case C020"] @@ -1312,7 +1336,7 @@ def test_get_ctype_variable_declaration_snippet_case_b540(): assert snippet == ["array_in_ctype = get_ctypes_pointer_for_buffer([custom_struct.custom_struct(c) for c in array_in], library_type=custom_struct.custom_struct) # case B540"] -def test_get_ctype_variable_declaration_snippet_case_b550(): +def test_get_ctype_variable_declaration_snippet_case_b550_array(): actual = get_ctype_variable_declaration_snippet(parameters_for_testing[10], parameters_for_testing, IviDanceStep.NOT_APPLICABLE, config_for_testing, use_numpy_array=False) expected = [ 'input_array_array = get_ctypes_and_array(value=input_array, array_type="d") # case B550', @@ -1323,6 +1347,11 @@ def test_get_ctype_variable_declaration_snippet_case_b550(): assert actual[i] == expected[i] +def test_get_ctype_variable_declaration_snippet_case_b550_list(): + snippet = get_ctype_variable_declaration_snippet(parameters_for_testing[28], parameters_for_testing, IviDanceStep.NOT_APPLICABLE, config_for_testing, use_numpy_array=False) + assert snippet == ["input_array_2_ctype = get_ctypes_pointer_for_buffer(value=input_array_2, library_type=_visatype.ViReal64) # case B550"] + + def test_get_ctype_variable_declaration_snippet_case_b560(): actual = get_ctype_variable_declaration_snippet(parameters_for_testing[3], parameters_for_testing, IviDanceStep.NOT_APPLICABLE, config_for_testing, use_numpy_array=False) expected = [ From 76c608e28dad82af62ef3b6fadef22886f5fc845 Mon Sep 17 00:00:00 2001 From: Mark Silva Date: Wed, 4 Sep 2019 10:33:22 -0500 Subject: [PATCH 30/56] Fix syntax error --- build/helper/codegen_helper.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/helper/codegen_helper.py b/build/helper/codegen_helper.py index 108adadf6..0c334eba8 100644 --- a/build/helper/codegen_helper.py +++ b/build/helper/codegen_helper.py @@ -367,7 +367,7 @@ def _get_ctype_variable_definition_snippet_for_buffers(parameter, parameters, iv else: if parameter['use_array']: # If the incoming type is array.array, we can just use that, otherwise we need to create an array.array that is initialized with the passed in value, which must be iterable - array_declaration = '{0}_array = get_ctypes_and_array(value=_converters.{2}({0}), array_type="{1}") # case B630'.format(parameter['python_name'], get_array_type_for_api_type(parameter['ctypes_type'], parameter['python_api_converter_name'])) + array_declaration = '{0}_array = get_ctypes_and_array(value=_converters.{2}({0}), array_type="{1}") # case B630'.format(parameter['python_name'], get_array_type_for_api_type(parameter['ctypes_type']), parameter['python_api_converter_name']) definitions.append(array_declaration) definition = 'get_ctypes_pointer_for_buffer(value={0}_array, library_type={1}.{2}) # case B630'.format(parameter['python_name'], module_name, parameter['ctypes_type']) elif parameter['use_list']: From 0d71be0b0f98b2b1fca3b1b5294aba96e63b553c Mon Sep 17 00:00:00 2001 From: Mark Silva Date: Wed, 4 Sep 2019 10:33:37 -0500 Subject: [PATCH 31/56] Test new cases --- build/helper/codegen_helper.py | 136 +++++++++++++++++++++++++++++++++ 1 file changed, 136 insertions(+) diff --git a/build/helper/codegen_helper.py b/build/helper/codegen_helper.py index 0c334eba8..fb0e3e645 100644 --- a/build/helper/codegen_helper.py +++ b/build/helper/codegen_helper.py @@ -1178,6 +1178,110 @@ def get_dictionary_snippet(d, indent=4): 'type': 'ViReal64', 'use_in_python_api': True, }, + { # 29 + 'ctypes_type': 'ViReal64', + 'ctypes_type_library_call': 'ctypes.POINTER(ViReal64)', + 'ctypes_variable_name': 'input_array_2_ctype', + 'default_value': None, + 'direction': 'in', + 'documentation': {'description': 'Input array of floats'}, + 'enum': None, + 'is_buffer': True, + 'is_string': False, + 'use_array': False, + 'use_list': True, + 'is_repeated_capability': False, + 'is_session_handle': False, + 'library_method_call_snippet': 'input_array_2_ctype', + 'name': 'inputArray2', + 'numpy': False, + 'python_api_converter_name': 'convert_to_nitclk_session_num_list', + 'python_name': 'input_array_2', + 'python_name_with_default': 'input_array_2=None', + 'python_name_with_doc_default': 'input_array_2=None', + 'python_type': 'float', + 'size': {'mechanism': 'len', 'value': 'inputArraySize2'}, + 'type': 'ViReal64', + 'use_in_python_api': True, + }, + { # 30 + 'ctypes_type': 'ViReal64', + 'ctypes_type_library_call': 'ctypes.POINTER(ViReal64)', + 'ctypes_variable_name': 'input_array_3_ctype', + 'default_value': None, + 'direction': 'in', + 'documentation': {'description': 'Input array of floats'}, + 'enum': None, + 'is_buffer': True, + 'is_string': False, + 'use_array': True, + 'use_list': False, + 'is_repeated_capability': False, + 'is_session_handle': False, + 'library_method_call_snippet': 'input_array_3_ctype', + 'name': 'inputArray3', + 'numpy': False, + 'python_api_converter_name': 'convert_to_nitclk_session_num_list', + 'python_name': 'input_array_3', + 'python_name_with_default': 'input_array_3=None', + 'python_name_with_doc_default': 'input_array_3=None', + 'python_type': 'float', + 'size': {'mechanism': 'len', 'value': 'inputArraySize3'}, + 'type': 'ViReal64', + 'use_in_python_api': True, + }, + { # 31 + 'ctypes_type': 'custom_struct', + 'ctypes_type_library_call': 'ctypes.POINTER(custom_struct)', + 'ctypes_variable_name': 'input_array_4_ctype', + 'default_value': None, + 'direction': 'in', + 'documentation': {'description': 'Input array of floats'}, + 'enum': None, + 'is_buffer': True, + 'is_string': False, + 'use_array': False, + 'use_list': True, + 'is_repeated_capability': False, + 'is_session_handle': False, + 'library_method_call_snippet': 'input_array_3_ctype', + 'name': 'inputArray4', + 'numpy': False, + 'python_api_converter_name': 'convert_to_nitclk_session_num_list', + 'python_name': 'input_array_4', + 'python_name_with_default': 'input_array_4=None', + 'python_name_with_doc_default': 'input_array_4=None', + 'python_type': 'float', + 'size': {'mechanism': 'len', 'value': 'inputArraySize4'}, + 'type': 'ViReal64', + 'use_in_python_api': True, + }, + { # 32 + 'ctypes_type': 'custom_struct', + 'ctypes_type_library_call': 'ctypes.POINTER(custom_struct)', + 'ctypes_variable_name': 'input_array_4_ctype', + 'default_value': None, + 'direction': 'in', + 'documentation': {'description': 'Input array of floats'}, + 'enum': None, + 'is_buffer': True, + 'is_string': False, + 'use_array': False, + 'use_list': False, + 'is_repeated_capability': False, + 'is_session_handle': False, + 'library_method_call_snippet': 'input_array_3_ctype', + 'name': 'inputArray4', + 'numpy': False, + 'python_api_converter_name': 'convert_to_nitclk_session_num_list', + 'python_name': 'input_array_4', + 'python_name_with_default': 'input_array_4=None', + 'python_name_with_doc_default': 'input_array_4=None', + 'python_type': 'float', + 'size': {'mechanism': 'len', 'value': 'inputArraySize4'}, + 'type': 'ViReal64', + 'use_in_python_api': True, + }, ] @@ -1453,6 +1557,38 @@ def test_get_ctype_variable_declaration_snippet_case_b620_list(): assert actual[i] == expected[i] +def test_get_ctype_variable_declaration_snippet_case_b630_array(): + actual = get_ctype_variable_declaration_snippet(parameters_for_testing[30], parameters_for_testing, IviDanceStep.NOT_APPLICABLE, config_for_testing, use_numpy_array=False) + expected = [ + 'input_array_3_array = get_ctypes_and_array(value=_converters.convert_to_nitclk_session_num_list(input_array_3), array_type="d") # case B630', + 'input_array_3_ctype = get_ctypes_pointer_for_buffer(value=input_array_3_array, library_type=_visatype.ViReal64) # case B630', + ] + assert len(actual) == len(expected) + for i in range(max(len(actual), len(expected))): + assert actual[i] == expected[i] + + +def test_get_ctype_variable_declaration_snippet_case_b630_list(): + snippet = get_ctype_variable_declaration_snippet(parameters_for_testing[29], parameters_for_testing, IviDanceStep.NOT_APPLICABLE, config_for_testing, use_numpy_array=False) + assert snippet == ["input_array_2_ctype = get_ctypes_pointer_for_buffer(value=_converters.convert_to_nitclk_session_num_list(input_array_2), library_type=_visatype.ViReal64) # case B630"] + + +def test_get_ctype_variable_declaration_snippet_case_b630_custom_type(): + try: + get_ctype_variable_declaration_snippet(parameters_for_testing[31], parameters_for_testing, IviDanceStep.NOT_APPLICABLE, config_for_testing, use_numpy_array=False) + assert False + except AssertionError: + pass + + +def test_get_ctype_variable_declaration_snippet_case_b630_not_array_or_list(): + try: + get_ctype_variable_declaration_snippet(parameters_for_testing[32], parameters_for_testing, IviDanceStep.NOT_APPLICABLE, config_for_testing, use_numpy_array=False) + assert False + except AssertionError: + pass + + def test_get_ctype_variable_declaration_snippet_bad_ivi_dance_step(): try: get_ctype_variable_declaration_snippet(parameters_for_testing[12], parameters_for_testing, IviDanceStep.NOT_APPLICABLE, config_for_testing, use_numpy_array=False) From c6e0a7c8d75b3a0c0088ee9debc38d3bd08d17a3 Mon Sep 17 00:00:00 2001 From: Mark Silva Date: Wed, 4 Sep 2019 13:34:19 -0500 Subject: [PATCH 32/56] Force change --- docs/nifgen/class.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/nifgen/class.rst b/docs/nifgen/class.rst index 19aa6420e..ef50380cf 100644 --- a/docs/nifgen/class.rst +++ b/docs/nifgen/class.rst @@ -381,6 +381,7 @@ nifgen.Session **Public methods** + +---------------------------------------------+ | Method name | +=============================================+ From a40e9c56890e5deb19bb04a248976abe655d2a4b Mon Sep 17 00:00:00 2001 From: Mark Silva Date: Wed, 4 Sep 2019 13:39:40 -0500 Subject: [PATCH 33/56] Update generated files --- docs/nifgen/class.rst | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/nifgen/class.rst b/docs/nifgen/class.rst index ef50380cf..19aa6420e 100644 --- a/docs/nifgen/class.rst +++ b/docs/nifgen/class.rst @@ -381,7 +381,6 @@ nifgen.Session **Public methods** - +---------------------------------------------+ | Method name | +=============================================+ From f8eda3f81995a20577813cf7473c62730d029b7e Mon Sep 17 00:00:00 2001 From: Mark Silva Date: Wed, 4 Sep 2019 13:46:53 -0500 Subject: [PATCH 34/56] Update generated files --- docs/nifgen/class.rst | 5 +++++ docs/nitclk/class.rst | 6 ++++++ generated/nidigital/session.py | 2 +- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/docs/nifgen/class.rst b/docs/nifgen/class.rst index 9347b00d6..26a39a915 100644 --- a/docs/nifgen/class.rst +++ b/docs/nifgen/class.rst @@ -442,6 +442,8 @@ nifgen.Session +---------------------------------------------+ | :py:func:`get_self_cal_supported` | +---------------------------------------------+ + | :py:func:`initiate` | + +---------------------------------------------+ | :py:func:`is_done` | +---------------------------------------------+ | :py:func:`lock` | @@ -6729,6 +6731,8 @@ Methods +------------------------------------------------------------+ | :py:func:`nifgen.Session.get_self_cal_supported` | +------------------------------------------------------------+ +| :py:func:`nifgen.Session.initiate` | ++------------------------------------------------------------+ | :py:func:`nifgen.Session.is_done` | +------------------------------------------------------------+ | :py:func:`nifgen.Session.lock` | @@ -6763,3 +6767,4 @@ Methods +------------------------------------------------------------+ | :py:func:`nifgen.Session.write_waveform` | +------------------------------------------------------------+ + diff --git a/docs/nitclk/class.rst b/docs/nitclk/class.rst index 4dc89edde..34e50d40e 100644 --- a/docs/nitclk/class.rst +++ b/docs/nitclk/class.rst @@ -57,6 +57,8 @@ nitclk.Session +----------------------------------------------------+ | :py:func:`initiate` | +----------------------------------------------------+ + | :py:func:`initiate` | + +----------------------------------------------------+ | :py:func:`is_done` | +----------------------------------------------------+ | :py:func:`setup_for_sync_pulse_sender_synchronize` | @@ -689,6 +691,8 @@ initiate + .. note:: This method will return a Python context manager that will initiate on entering and abort on exit. + :param sessions: @@ -941,6 +945,8 @@ Methods +-------------------------------------------------------------------+ | :py:func:`nitclk.Session.initiate` | +-------------------------------------------------------------------+ +| :py:func:`nitclk.Session.initiate` | ++-------------------------------------------------------------------+ | :py:func:`nitclk.Session.is_done` | +-------------------------------------------------------------------+ | :py:func:`nitclk.Session.setup_for_sync_pulse_sender_synchronize` | diff --git a/generated/nidigital/session.py b/generated/nidigital/session.py index 9b4b1d929..3e94a8dce 100644 --- a/generated/nidigital/session.py +++ b/generated/nidigital/session.py @@ -1937,7 +1937,7 @@ def initiate(self): Note: This method will return a Python context manager that will initiate on entering and abort on exit. ''' - return _Acquisition(self) + return _Burst(self) def close(self): try: From 22890c19e94a0b7200905aa66eb0871707ef9de4 Mon Sep 17 00:00:00 2001 From: Mark Silva Date: Wed, 4 Sep 2019 15:05:38 -0500 Subject: [PATCH 35/56] Add different target for pr (project) and commit (patch) --- .codecov.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.codecov.yml b/.codecov.yml index ab610d719..928cc33a3 100644 --- a/.codecov.yml +++ b/.codecov.yml @@ -7,8 +7,10 @@ coverage: project: default: threshhold: 5% + target: 90% patch: default: threshhold: 5% + target: 70% From ea12f9b41ba1779466e638a97481654c5740c723 Mon Sep 17 00:00:00 2001 From: Mark Silva Date: Wed, 4 Sep 2019 15:05:53 -0500 Subject: [PATCH 36/56] threshold should be number --- .codecov.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.codecov.yml b/.codecov.yml index 928cc33a3..50a3e704b 100644 --- a/.codecov.yml +++ b/.codecov.yml @@ -6,11 +6,11 @@ coverage: status: project: default: - threshhold: 5% target: 90% + threshhold: 5 patch: default: - threshhold: 5% target: 70% + threshhold: 5 From b0401996ab1aaed51fc643375d217e3e021e9966 Mon Sep 17 00:00:00 2001 From: Mark Silva Date: Wed, 4 Sep 2019 16:27:58 -0500 Subject: [PATCH 37/56] Renumber scaler cases to be in order used in the code --- build/helper/codegen_helper.py | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/build/helper/codegen_helper.py b/build/helper/codegen_helper.py index fb0e3e645..34173395b 100644 --- a/build/helper/codegen_helper.py +++ b/build/helper/codegen_helper.py @@ -264,10 +264,10 @@ def _get_ctype_variable_definition_snippet_for_scalar(parameter, parameters, ivi S160. Input is size of input buffer: visatype.ViInt32(0 if list is None else len(list)) S170. Input is size of output buffer with mechanism ivi-dance, QUERY_SIZE: visatype.ViInt32() S180. Input is size of output buffer with mechanism ivi-dance, GET_DATA: visatype.ViInt32(error_code) - S190. Input is size of output buffer with mechanism passed-in: visatype.ViInt32(buffer_size) - S200. Output scalar or enum: visatype.ViInt32() - S210. Input is size of output buffer with mechanism ivi-dance-with-a-twist, QUERY_SIZE: visatype.ViInt32() - S220. Input is size of output buffer with mechanism ivi-dance-with-a-twist, GET_DATA: visatype.ViInt32(error_code) + S190. Input is size of output buffer with mechanism ivi-dance-with-a-twist, QUERY_SIZE: visatype.ViInt32() + S200. Input is size of output buffer with mechanism ivi-dance-with-a-twist, GET_DATA: visatype.ViInt32(error_code) + S210. Input is size of output buffer with mechanism passed-in: visatype.ViInt32(buffer_size) + S220. Output scalar or enum: visatype.ViInt32() Return Value (list): each item in the list will be one line needed for the declaration of that parameter ''' @@ -314,10 +314,10 @@ def _get_ctype_variable_definition_snippet_for_scalar(parameter, parameters, ivi assert p['direction'] == 'out' assert p['size']['mechanism'] == 'ivi-dance-with-a-twist' if ivi_dance_step == IviDanceStep.QUERY_SIZE: - definition = '{0}.{1}(0) # case S210'.format(module_name, parameter['ctypes_type']) + definition = '{0}.{1}(0) # case S190'.format(module_name, parameter['ctypes_type']) elif ivi_dance_step == IviDanceStep.GET_DATA: size_parameter_twist = find_size_parameter(corresponding_buffer_parameters[0], parameters, key='value_twist') - definition = '{0}.{1}({2}.value) # case S220'.format(module_name, parameter['ctypes_type'], size_parameter_twist['ctypes_variable_name']) + definition = '{0}.{1}({2}.value) # case S200'.format(module_name, parameter['ctypes_type'], size_parameter_twist['ctypes_variable_name']) else: assert False, "ivi_dance_step {0} not valid for parameter {1} with ['size']['mechanism'] == 'ivi-dance-with-a-twist'".format(ivi_dance_step, parameter['name']) else: @@ -325,10 +325,10 @@ def _get_ctype_variable_definition_snippet_for_scalar(parameter, parameters, ivi for p in corresponding_buffer_parameters: assert p['direction'] == 'out' assert p['size']['mechanism'] != 'fixed-size' - definition = '{0}.{1}({2}) # case S190'.format(module_name, parameter['ctypes_type'], parameter['python_name']) + definition = '{0}.{1}({2}) # case S210'.format(module_name, parameter['ctypes_type'], parameter['python_name']) else: assert parameter['direction'] == 'out' - definition = '{0}.{1}() # case S200'.format(module_name, parameter['ctypes_type']) + definition = '{0}.{1}() # case S220'.format(module_name, parameter['ctypes_type']) if definition is not None: definitions.append(parameter['ctypes_variable_name'] + ' = ' + definition) @@ -1405,24 +1405,24 @@ def test_get_ctype_variable_declaration_snippet_case_s180(): assert snippet == ["string_size_ctype = _visatype.ViInt32(error_code) # case S180"] -def test_get_ctype_variable_declaration_snippet_case_s190(): - snippet = get_ctype_variable_declaration_snippet(parameters_for_testing[4], parameters_for_testing, IviDanceStep.NOT_APPLICABLE, config_for_testing, use_numpy_array=False) - assert snippet == ["number_of_elements_ctype = _visatype.ViInt32(number_of_elements) # case S190"] +def test_get_ctype_variable_declaration_snippet_case_s2190(): + snippet = get_ctype_variable_declaration_snippet(parameters_for_testing[23], parameters_for_testing, IviDanceStep.QUERY_SIZE, config_for_testing, use_numpy_array=False) + assert snippet == ["string_size_twist_ctype = _visatype.ViInt32(0) # case S190"] def test_get_ctype_variable_declaration_snippet_case_s200(): - snippet = get_ctype_variable_declaration_snippet(parameters_for_testing[1], parameters_for_testing, IviDanceStep.NOT_APPLICABLE, config_for_testing, use_numpy_array=False) - assert snippet == ["output_ctype = _visatype.ViInt64() # case S200"] + snippet = get_ctype_variable_declaration_snippet(parameters_for_testing[23], parameters_for_testing, IviDanceStep.GET_DATA, config_for_testing, use_numpy_array=False) + assert snippet == ["string_size_twist_ctype = _visatype.ViInt32(output_twist_ctype.value) # case S200"] def test_get_ctype_variable_declaration_snippet_case_s210(): - snippet = get_ctype_variable_declaration_snippet(parameters_for_testing[23], parameters_for_testing, IviDanceStep.QUERY_SIZE, config_for_testing, use_numpy_array=False) - assert snippet == ["string_size_twist_ctype = _visatype.ViInt32(0) # case S210"] + snippet = get_ctype_variable_declaration_snippet(parameters_for_testing[4], parameters_for_testing, IviDanceStep.NOT_APPLICABLE, config_for_testing, use_numpy_array=False) + assert snippet == ["number_of_elements_ctype = _visatype.ViInt32(number_of_elements) # case S210"] def test_get_ctype_variable_declaration_snippet_case_s220(): - snippet = get_ctype_variable_declaration_snippet(parameters_for_testing[23], parameters_for_testing, IviDanceStep.GET_DATA, config_for_testing, use_numpy_array=False) - assert snippet == ["string_size_twist_ctype = _visatype.ViInt32(output_twist_ctype.value) # case S220"] + snippet = get_ctype_variable_declaration_snippet(parameters_for_testing[1], parameters_for_testing, IviDanceStep.NOT_APPLICABLE, config_for_testing, use_numpy_array=False) + assert snippet == ["output_ctype = _visatype.ViInt64() # case S220"] def test_get_ctype_variable_declaration_snippet_case_b510(): From 37b11e0bbf9e44b55a8a284be23108b831477ac8 Mon Sep 17 00:00:00 2001 From: Mark Silva Date: Wed, 4 Sep 2019 16:28:12 -0500 Subject: [PATCH 38/56] Update generated files --- generated/nidcpower/session.py | 60 +++++++++---------- generated/nidigital/session.py | 106 ++++++++++++++++----------------- generated/nidmm/session.py | 66 ++++++++++---------- generated/nifake/session.py | 82 ++++++++++++------------- generated/nifgen/session.py | 92 ++++++++++++++-------------- generated/nimodinst/session.py | 6 +- generated/niscope/session.py | 22 +++---- generated/nise/session.py | 10 ++-- generated/niswitch/session.py | 18 +++--- 9 files changed, 231 insertions(+), 231 deletions(-) diff --git a/generated/nidcpower/session.py b/generated/nidcpower/session.py index fb3dad432..a0ba58821 100644 --- a/generated/nidcpower/session.py +++ b/generated/nidcpower/session.py @@ -2515,7 +2515,7 @@ def _fetch_multiple(self, timeout, count): vi_ctype = _visatype.ViSession(self._vi) # case S110 channel_name_ctype = ctypes.create_string_buffer(self._repeated_capability.encode(self._encoding)) # case C010 timeout_ctype = _converters.convert_timedelta_to_seconds(timeout, _visatype.ViReal64) # case S140 - count_ctype = _visatype.ViInt32(count) # case S190 + count_ctype = _visatype.ViInt32(count) # case S210 voltage_measurements_size = count # case B600 voltage_measurements_array = array.array("d", [0] * voltage_measurements_size) # case B600 voltage_measurements_ctype = get_ctypes_pointer_for_buffer(value=voltage_measurements_array, library_type=_visatype.ViReal64) # case B600 @@ -2524,7 +2524,7 @@ def _fetch_multiple(self, timeout, count): current_measurements_ctype = get_ctypes_pointer_for_buffer(value=current_measurements_array, library_type=_visatype.ViReal64) # case B600 in_compliance_size = count # case B600 in_compliance_ctype = get_ctypes_pointer_for_buffer(library_type=_visatype.ViBoolean, size=in_compliance_size) # case B600 - actual_count_ctype = _visatype.ViInt32() # case S200 + actual_count_ctype = _visatype.ViInt32() # case S220 error_code = self._library.niDCPower_FetchMultiple(vi_ctype, channel_name_ctype, timeout_ctype, count_ctype, voltage_measurements_ctype, current_measurements_ctype, in_compliance_ctype, None if actual_count_ctype is None else (ctypes.pointer(actual_count_ctype))) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return voltage_measurements_array, current_measurements_array, [bool(in_compliance_ctype[i]) for i in range(count_ctype.value)] @@ -2579,7 +2579,7 @@ def _get_attribute_vi_boolean(self, attribute_id): vi_ctype = _visatype.ViSession(self._vi) # case S110 channel_name_ctype = ctypes.create_string_buffer(self._repeated_capability.encode(self._encoding)) # case C010 attribute_id_ctype = _visatype.ViAttr(attribute_id) # case S150 - attribute_value_ctype = _visatype.ViBoolean() # case S200 + attribute_value_ctype = _visatype.ViBoolean() # case S220 error_code = self._library.niDCPower_GetAttributeViBoolean(vi_ctype, channel_name_ctype, attribute_id_ctype, None if attribute_value_ctype is None else (ctypes.pointer(attribute_value_ctype))) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return bool(attribute_value_ctype.value) @@ -2634,7 +2634,7 @@ def _get_attribute_vi_int32(self, attribute_id): vi_ctype = _visatype.ViSession(self._vi) # case S110 channel_name_ctype = ctypes.create_string_buffer(self._repeated_capability.encode(self._encoding)) # case C010 attribute_id_ctype = _visatype.ViAttr(attribute_id) # case S150 - attribute_value_ctype = _visatype.ViInt32() # case S200 + attribute_value_ctype = _visatype.ViInt32() # case S220 error_code = self._library.niDCPower_GetAttributeViInt32(vi_ctype, channel_name_ctype, attribute_id_ctype, None if attribute_value_ctype is None else (ctypes.pointer(attribute_value_ctype))) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return int(attribute_value_ctype.value) @@ -2689,7 +2689,7 @@ def _get_attribute_vi_int64(self, attribute_id): vi_ctype = _visatype.ViSession(self._vi) # case S110 channel_name_ctype = ctypes.create_string_buffer(self._repeated_capability.encode(self._encoding)) # case C010 attribute_id_ctype = _visatype.ViAttr(attribute_id) # case S150 - attribute_value_ctype = _visatype.ViInt64() # case S200 + attribute_value_ctype = _visatype.ViInt64() # case S220 error_code = self._library.niDCPower_GetAttributeViInt64(vi_ctype, channel_name_ctype, attribute_id_ctype, None if attribute_value_ctype is None else (ctypes.pointer(attribute_value_ctype))) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return int(attribute_value_ctype.value) @@ -2744,7 +2744,7 @@ def _get_attribute_vi_real64(self, attribute_id): vi_ctype = _visatype.ViSession(self._vi) # case S110 channel_name_ctype = ctypes.create_string_buffer(self._repeated_capability.encode(self._encoding)) # case C010 attribute_id_ctype = _visatype.ViAttr(attribute_id) # case S150 - attribute_value_ctype = _visatype.ViReal64() # case S200 + attribute_value_ctype = _visatype.ViReal64() # case S220 error_code = self._library.niDCPower_GetAttributeViReal64(vi_ctype, channel_name_ctype, attribute_id_ctype, None if attribute_value_ctype is None else (ctypes.pointer(attribute_value_ctype))) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return float(attribute_value_ctype.value) @@ -2859,7 +2859,7 @@ def _get_error(self): ''' vi_ctype = _visatype.ViSession(self._vi) # case S110 - code_ctype = _visatype.ViStatus() # case S200 + code_ctype = _visatype.ViStatus() # case S220 buffer_size_ctype = _visatype.ViInt32() # case S170 description_ctype = None # case C050 error_code = self._library.niDCPower_GetError(vi_ctype, None if code_ctype is None else (ctypes.pointer(code_ctype)), buffer_size_ctype, description_ctype) @@ -2954,7 +2954,7 @@ def measure(self, measurement_type): vi_ctype = _visatype.ViSession(self._vi) # case S110 channel_name_ctype = ctypes.create_string_buffer(self._repeated_capability.encode(self._encoding)) # case C010 measurement_type_ctype = _visatype.ViInt32(measurement_type.value) # case S130 - measurement_ctype = _visatype.ViReal64() # case S200 + measurement_ctype = _visatype.ViReal64() # case S220 error_code = self._library.niDCPower_Measure(vi_ctype, channel_name_ctype, measurement_type_ctype, None if measurement_ctype is None else (ctypes.pointer(measurement_ctype))) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return float(measurement_ctype.value) @@ -3021,7 +3021,7 @@ def _parse_channel_count(self): ''' vi_ctype = _visatype.ViSession(self._vi) # case S110 channels_string_ctype = ctypes.create_string_buffer(self._repeated_capability.encode(self._encoding)) # case C010 - number_of_channels_ctype = _visatype.ViUInt32() # case S200 + number_of_channels_ctype = _visatype.ViUInt32() # case S220 error_code = self._library.niDCPower_ParseChannelCount(vi_ctype, channels_string_ctype, None if number_of_channels_ctype is None else (ctypes.pointer(number_of_channels_ctype))) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return int(number_of_channels_ctype.value) @@ -3068,7 +3068,7 @@ def query_in_compliance(self): ''' vi_ctype = _visatype.ViSession(self._vi) # case S110 channel_name_ctype = ctypes.create_string_buffer(self._repeated_capability.encode(self._encoding)) # case C010 - in_compliance_ctype = _visatype.ViBoolean() # case S200 + in_compliance_ctype = _visatype.ViBoolean() # case S220 error_code = self._library.niDCPower_QueryInCompliance(vi_ctype, channel_name_ctype, None if in_compliance_ctype is None else (ctypes.pointer(in_compliance_ctype))) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return bool(in_compliance_ctype.value) @@ -3101,7 +3101,7 @@ def query_max_current_limit(self, voltage_level): vi_ctype = _visatype.ViSession(self._vi) # case S110 channel_name_ctype = ctypes.create_string_buffer(self._repeated_capability.encode(self._encoding)) # case C010 voltage_level_ctype = _visatype.ViReal64(voltage_level) # case S150 - max_current_limit_ctype = _visatype.ViReal64() # case S200 + max_current_limit_ctype = _visatype.ViReal64() # case S220 error_code = self._library.niDCPower_QueryMaxCurrentLimit(vi_ctype, channel_name_ctype, voltage_level_ctype, None if max_current_limit_ctype is None else (ctypes.pointer(max_current_limit_ctype))) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return float(max_current_limit_ctype.value) @@ -3134,7 +3134,7 @@ def query_max_voltage_level(self, current_limit): vi_ctype = _visatype.ViSession(self._vi) # case S110 channel_name_ctype = ctypes.create_string_buffer(self._repeated_capability.encode(self._encoding)) # case C010 current_limit_ctype = _visatype.ViReal64(current_limit) # case S150 - max_voltage_level_ctype = _visatype.ViReal64() # case S200 + max_voltage_level_ctype = _visatype.ViReal64() # case S220 error_code = self._library.niDCPower_QueryMaxVoltageLevel(vi_ctype, channel_name_ctype, current_limit_ctype, None if max_voltage_level_ctype is None else (ctypes.pointer(max_voltage_level_ctype))) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return float(max_voltage_level_ctype.value) @@ -3167,7 +3167,7 @@ def query_min_current_limit(self, voltage_level): vi_ctype = _visatype.ViSession(self._vi) # case S110 channel_name_ctype = ctypes.create_string_buffer(self._repeated_capability.encode(self._encoding)) # case C010 voltage_level_ctype = _visatype.ViReal64(voltage_level) # case S150 - min_current_limit_ctype = _visatype.ViReal64() # case S200 + min_current_limit_ctype = _visatype.ViReal64() # case S220 error_code = self._library.niDCPower_QueryMinCurrentLimit(vi_ctype, channel_name_ctype, voltage_level_ctype, None if min_current_limit_ctype is None else (ctypes.pointer(min_current_limit_ctype))) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return float(min_current_limit_ctype.value) @@ -3212,7 +3212,7 @@ def query_output_state(self, output_state): vi_ctype = _visatype.ViSession(self._vi) # case S110 channel_name_ctype = ctypes.create_string_buffer(self._repeated_capability.encode(self._encoding)) # case C010 output_state_ctype = _visatype.ViInt32(output_state.value) # case S130 - in_state_ctype = _visatype.ViBoolean() # case S200 + in_state_ctype = _visatype.ViBoolean() # case S220 error_code = self._library.niDCPower_QueryOutputState(vi_ctype, channel_name_ctype, output_state_ctype, None if in_state_ctype is None else (ctypes.pointer(in_state_ctype))) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return bool(in_state_ctype.value) @@ -4216,11 +4216,11 @@ def _get_ext_cal_last_date_and_time(self): ''' vi_ctype = _visatype.ViSession(self._vi) # case S110 - year_ctype = _visatype.ViInt32() # case S200 - month_ctype = _visatype.ViInt32() # case S200 - day_ctype = _visatype.ViInt32() # case S200 - hour_ctype = _visatype.ViInt32() # case S200 - minute_ctype = _visatype.ViInt32() # case S200 + year_ctype = _visatype.ViInt32() # case S220 + month_ctype = _visatype.ViInt32() # case S220 + day_ctype = _visatype.ViInt32() # case S220 + hour_ctype = _visatype.ViInt32() # case S220 + minute_ctype = _visatype.ViInt32() # case S220 error_code = self._library.niDCPower_GetExtCalLastDateAndTime(vi_ctype, None if year_ctype is None else (ctypes.pointer(year_ctype)), None if month_ctype is None else (ctypes.pointer(month_ctype)), None if day_ctype is None else (ctypes.pointer(day_ctype)), None if hour_ctype is None else (ctypes.pointer(hour_ctype)), None if minute_ctype is None else (ctypes.pointer(minute_ctype))) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return int(year_ctype.value), int(month_ctype.value), int(day_ctype.value), int(hour_ctype.value), int(minute_ctype.value) @@ -4238,7 +4238,7 @@ def get_ext_cal_last_temp(self): ''' vi_ctype = _visatype.ViSession(self._vi) # case S110 - temperature_ctype = _visatype.ViReal64() # case S200 + temperature_ctype = _visatype.ViReal64() # case S220 error_code = self._library.niDCPower_GetExtCalLastTemp(vi_ctype, None if temperature_ctype is None else (ctypes.pointer(temperature_ctype))) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return float(temperature_ctype.value) @@ -4256,7 +4256,7 @@ def get_ext_cal_recommended_interval(self): ''' vi_ctype = _visatype.ViSession(self._vi) # case S110 - months_ctype = _visatype.ViInt32() # case S200 + months_ctype = _visatype.ViInt32() # case S220 error_code = self._library.niDCPower_GetExtCalRecommendedInterval(vi_ctype, None if months_ctype is None else (ctypes.pointer(months_ctype))) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return _converters.convert_month_to_timedelta(int(months_ctype.value)) @@ -4322,11 +4322,11 @@ def _get_self_cal_last_date_and_time(self): ''' vi_ctype = _visatype.ViSession(self._vi) # case S110 - year_ctype = _visatype.ViInt32() # case S200 - month_ctype = _visatype.ViInt32() # case S200 - day_ctype = _visatype.ViInt32() # case S200 - hour_ctype = _visatype.ViInt32() # case S200 - minute_ctype = _visatype.ViInt32() # case S200 + year_ctype = _visatype.ViInt32() # case S220 + month_ctype = _visatype.ViInt32() # case S220 + day_ctype = _visatype.ViInt32() # case S220 + hour_ctype = _visatype.ViInt32() # case S220 + minute_ctype = _visatype.ViInt32() # case S220 error_code = self._library.niDCPower_GetSelfCalLastDateAndTime(vi_ctype, None if year_ctype is None else (ctypes.pointer(year_ctype)), None if month_ctype is None else (ctypes.pointer(month_ctype)), None if day_ctype is None else (ctypes.pointer(day_ctype)), None if hour_ctype is None else (ctypes.pointer(hour_ctype)), None if minute_ctype is None else (ctypes.pointer(minute_ctype))) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return int(year_ctype.value), int(month_ctype.value), int(day_ctype.value), int(hour_ctype.value), int(minute_ctype.value) @@ -4357,7 +4357,7 @@ def get_self_cal_last_temp(self): ''' vi_ctype = _visatype.ViSession(self._vi) # case S110 - temperature_ctype = _visatype.ViReal64() # case S200 + temperature_ctype = _visatype.ViReal64() # case S220 error_code = self._library.niDCPower_GetSelfCalLastTemp(vi_ctype, None if temperature_ctype is None else (ctypes.pointer(temperature_ctype))) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return float(temperature_ctype.value) @@ -4553,7 +4553,7 @@ def _initialize_with_channels(self, resource_name, channels=None, reset=False, o channels_ctype = ctypes.create_string_buffer(channels.encode(self._encoding)) # case C020 reset_ctype = _visatype.ViBoolean(reset) # case S150 option_string_ctype = ctypes.create_string_buffer(option_string.encode(self._encoding)) # case C020 - vi_ctype = _visatype.ViSession() # case S200 + vi_ctype = _visatype.ViSession() # case S220 error_code = self._library.niDCPower_InitializeWithChannels(resource_name_ctype, channels_ctype, reset_ctype, option_string_ctype, None if vi_ctype is None else (ctypes.pointer(vi_ctype))) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return int(vi_ctype.value) @@ -4592,7 +4592,7 @@ def read_current_temperature(self): ''' vi_ctype = _visatype.ViSession(self._vi) # case S110 - temperature_ctype = _visatype.ViReal64() # case S200 + temperature_ctype = _visatype.ViReal64() # case S220 error_code = self._library.niDCPower_ReadCurrentTemperature(vi_ctype, None if temperature_ctype is None else (ctypes.pointer(temperature_ctype))) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return float(temperature_ctype.value) @@ -4836,7 +4836,7 @@ def _self_test(self): ''' vi_ctype = _visatype.ViSession(self._vi) # case S110 - self_test_result_ctype = _visatype.ViInt16() # case S200 + self_test_result_ctype = _visatype.ViInt16() # case S220 self_test_message_ctype = (_visatype.ViChar * 256)() # case C070 error_code = self._library.niDCPower_self_test(vi_ctype, None if self_test_result_ctype is None else (ctypes.pointer(self_test_result_ctype)), self_test_message_ctype) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) diff --git a/generated/nidigital/session.py b/generated/nidigital/session.py index 3e94a8dce..27bb8b9fd 100644 --- a/generated/nidigital/session.py +++ b/generated/nidigital/session.py @@ -886,12 +886,12 @@ def frequency_counter_measure_frequency(self): ''' vi_ctype = _visatype.ViSession(self._vi) # case S110 channel_list_ctype = ctypes.create_string_buffer(self._repeated_capability.encode(self._encoding)) # case C010 - frequencies_buffer_size_ctype = _visatype.ViInt32(0) # case S210 + frequencies_buffer_size_ctype = _visatype.ViInt32(0) # case S190 frequencies_ctype = None # case B610 - actual_num_frequencies_ctype = _visatype.ViInt32() # case S200 + actual_num_frequencies_ctype = _visatype.ViInt32() # case S220 error_code = self._library.niDigital_FrequencyCounter_MeasureFrequency(vi_ctype, channel_list_ctype, frequencies_buffer_size_ctype, frequencies_ctype, None if actual_num_frequencies_ctype is None else (ctypes.pointer(actual_num_frequencies_ctype))) errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False) - frequencies_buffer_size_ctype = _visatype.ViInt32(actual_num_frequencies_ctype.value) # case S220 + frequencies_buffer_size_ctype = _visatype.ViInt32(actual_num_frequencies_ctype.value) # case S200 frequencies_size = actual_num_frequencies_ctype.value # case B620 frequencies_ctype = get_ctypes_pointer_for_buffer(library_type=_visatype.ViReal64, size=frequencies_size) # case B620 error_code = self._library.niDigital_FrequencyCounter_MeasureFrequency(vi_ctype, channel_list_ctype, frequencies_buffer_size_ctype, frequencies_ctype, None if actual_num_frequencies_ctype is None else (ctypes.pointer(actual_num_frequencies_ctype))) @@ -923,7 +923,7 @@ def get_attribute_vi_boolean(self, attribute): vi_ctype = _visatype.ViSession(self._vi) # case S110 channel_name_ctype = ctypes.create_string_buffer(self._repeated_capability.encode(self._encoding)) # case C010 attribute_ctype = _visatype.ViAttr(attribute) # case S150 - value_ctype = _visatype.ViBoolean() # case S200 + value_ctype = _visatype.ViBoolean() # case S220 error_code = self._library.niDigital_GetAttributeViBoolean(vi_ctype, channel_name_ctype, attribute_ctype, None if value_ctype is None else (ctypes.pointer(value_ctype))) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return bool(value_ctype.value) @@ -953,7 +953,7 @@ def get_attribute_vi_int32(self, attribute): vi_ctype = _visatype.ViSession(self._vi) # case S110 channel_name_ctype = ctypes.create_string_buffer(self._repeated_capability.encode(self._encoding)) # case C010 attribute_ctype = _visatype.ViAttr(attribute) # case S150 - value_ctype = _visatype.ViInt32() # case S200 + value_ctype = _visatype.ViInt32() # case S220 error_code = self._library.niDigital_GetAttributeViInt32(vi_ctype, channel_name_ctype, attribute_ctype, None if value_ctype is None else (ctypes.pointer(value_ctype))) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return int(value_ctype.value) @@ -983,7 +983,7 @@ def get_attribute_vi_int64(self, attribute): vi_ctype = _visatype.ViSession(self._vi) # case S110 channel_name_ctype = ctypes.create_string_buffer(self._repeated_capability.encode(self._encoding)) # case C010 attribute_ctype = _visatype.ViAttr(attribute) # case S150 - value_ctype = _visatype.ViInt64() # case S200 + value_ctype = _visatype.ViInt64() # case S220 error_code = self._library.niDigital_GetAttributeViInt64(vi_ctype, channel_name_ctype, attribute_ctype, None if value_ctype is None else (ctypes.pointer(value_ctype))) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return int(value_ctype.value) @@ -1013,7 +1013,7 @@ def get_attribute_vi_real64(self, attribute): vi_ctype = _visatype.ViSession(self._vi) # case S110 channel_name_ctype = ctypes.create_string_buffer(self._repeated_capability.encode(self._encoding)) # case C010 attribute_ctype = _visatype.ViAttr(attribute) # case S150 - value_ctype = _visatype.ViReal64() # case S200 + value_ctype = _visatype.ViReal64() # case S220 error_code = self._library.niDigital_GetAttributeViReal64(vi_ctype, channel_name_ctype, attribute_ctype, None if value_ctype is None else (ctypes.pointer(value_ctype))) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return float(value_ctype.value) @@ -1043,7 +1043,7 @@ def get_attribute_vi_session(self, attribute): vi_ctype = _visatype.ViSession(self._vi) # case S110 channel_name_ctype = ctypes.create_string_buffer(self._repeated_capability.encode(self._encoding)) # case C010 attribute_ctype = _visatype.ViAttr(attribute) # case S150 - value_ctype = _visatype.ViSession() # case S200 + value_ctype = _visatype.ViSession() # case S220 error_code = self._library.niDigital_GetAttributeViSession(vi_ctype, channel_name_ctype, attribute_ctype, None if value_ctype is None else (ctypes.pointer(value_ctype))) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return int(value_ctype.value) @@ -1089,7 +1089,7 @@ def _get_error(self): ''' vi_ctype = _visatype.ViSession(self._vi) # case S110 - error_code_ctype = _visatype.ViStatus() # case S200 + error_code_ctype = _visatype.ViStatus() # case S220 error_description_buffer_size_ctype = _visatype.ViInt32() # case S170 error_description_ctype = None # case C050 error_code = self._library.niDigital_GetError(vi_ctype, None if error_code_ctype is None else (ctypes.pointer(error_code_ctype)), error_description_buffer_size_ctype, error_description_ctype) @@ -1120,12 +1120,12 @@ def get_fail_count(self): ''' vi_ctype = _visatype.ViSession(self._vi) # case S110 channel_list_ctype = ctypes.create_string_buffer(self._repeated_capability.encode(self._encoding)) # case C010 - buffer_size_ctype = _visatype.ViInt32(0) # case S210 + buffer_size_ctype = _visatype.ViInt32(0) # case S190 failure_count_ctype = None # case B610 - actual_num_read_ctype = _visatype.ViInt32() # case S200 + actual_num_read_ctype = _visatype.ViInt32() # case S220 error_code = self._library.niDigital_GetFailCount(vi_ctype, channel_list_ctype, buffer_size_ctype, failure_count_ctype, None if actual_num_read_ctype is None else (ctypes.pointer(actual_num_read_ctype))) errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False) - buffer_size_ctype = _visatype.ViInt32(actual_num_read_ctype.value) # case S220 + buffer_size_ctype = _visatype.ViInt32(actual_num_read_ctype.value) # case S200 failure_count_size = actual_num_read_ctype.value # case B620 failure_count_ctype = get_ctypes_pointer_for_buffer(library_type=_visatype.ViInt64, size=failure_count_size) # case B620 error_code = self._library.niDigital_GetFailCount(vi_ctype, channel_list_ctype, buffer_size_ctype, failure_count_ctype, None if actual_num_read_ctype is None else (ctypes.pointer(actual_num_read_ctype))) @@ -1152,14 +1152,14 @@ def get_pin_results_pin_information(self): ''' vi_ctype = _visatype.ViSession(self._vi) # case S110 channel_list_ctype = ctypes.create_string_buffer(self._repeated_capability.encode(self._encoding)) # case C010 - buffer_size_ctype = _visatype.ViInt32(0) # case S210 + buffer_size_ctype = _visatype.ViInt32(0) # case S190 pin_indexes_ctype = None # case B610 site_numbers_ctype = None # case B610 channel_indexes_ctype = None # case B610 - actual_num_values_ctype = _visatype.ViInt32() # case S200 + actual_num_values_ctype = _visatype.ViInt32() # case S220 error_code = self._library.niDigital_GetPinResultsPinInformation(vi_ctype, channel_list_ctype, buffer_size_ctype, pin_indexes_ctype, site_numbers_ctype, channel_indexes_ctype, None if actual_num_values_ctype is None else (ctypes.pointer(actual_num_values_ctype))) errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False) - buffer_size_ctype = _visatype.ViInt32(actual_num_values_ctype.value) # case S220 + buffer_size_ctype = _visatype.ViInt32(actual_num_values_ctype.value) # case S200 pin_indexes_size = actual_num_values_ctype.value # case B620 pin_indexes_ctype = get_ctypes_pointer_for_buffer(library_type=_visatype.ViInt32, size=pin_indexes_size) # case B620 site_numbers_size = actual_num_values_ctype.value # case B620 @@ -1479,12 +1479,12 @@ def ppmu_measure(self, measurement_type): vi_ctype = _visatype.ViSession(self._vi) # case S110 channel_list_ctype = ctypes.create_string_buffer(self._repeated_capability.encode(self._encoding)) # case C010 measurement_type_ctype = _visatype.ViInt32(measurement_type) # case S150 - buffer_size_ctype = _visatype.ViInt32(0) # case S210 + buffer_size_ctype = _visatype.ViInt32(0) # case S190 measurements_ctype = None # case B610 - actual_num_read_ctype = _visatype.ViInt32() # case S200 + actual_num_read_ctype = _visatype.ViInt32() # case S220 error_code = self._library.niDigital_PPMU_Measure(vi_ctype, channel_list_ctype, measurement_type_ctype, buffer_size_ctype, measurements_ctype, None if actual_num_read_ctype is None else (ctypes.pointer(actual_num_read_ctype))) errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False) - buffer_size_ctype = _visatype.ViInt32(actual_num_read_ctype.value) # case S220 + buffer_size_ctype = _visatype.ViInt32(actual_num_read_ctype.value) # case S200 measurements_size = actual_num_read_ctype.value # case B620 measurements_ctype = get_ctypes_pointer_for_buffer(library_type=_visatype.ViReal64, size=measurements_size) # case B620 error_code = self._library.niDigital_PPMU_Measure(vi_ctype, channel_list_ctype, measurement_type_ctype, buffer_size_ctype, measurements_ctype, None if actual_num_read_ctype is None else (ctypes.pointer(actual_num_read_ctype))) @@ -1531,12 +1531,12 @@ def read_static(self): ''' vi_ctype = _visatype.ViSession(self._vi) # case S110 channel_list_ctype = ctypes.create_string_buffer(self._repeated_capability.encode(self._encoding)) # case C010 - buffer_size_ctype = _visatype.ViInt32(0) # case S210 + buffer_size_ctype = _visatype.ViInt32(0) # case S190 data_ctype = None # case B610 - actual_num_read_ctype = _visatype.ViInt32() # case S200 + actual_num_read_ctype = _visatype.ViInt32() # case S220 error_code = self._library.niDigital_ReadStatic(vi_ctype, channel_list_ctype, buffer_size_ctype, data_ctype, None if actual_num_read_ctype is None else (ctypes.pointer(actual_num_read_ctype))) errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False) - buffer_size_ctype = _visatype.ViInt32(actual_num_read_ctype.value) # case S220 + buffer_size_ctype = _visatype.ViInt32(actual_num_read_ctype.value) # case S200 data_size = actual_num_read_ctype.value # case B620 data_ctype = get_ctypes_pointer_for_buffer(library_type=_visatype.ViUInt8, size=data_size) # case B620 error_code = self._library.niDigital_ReadStatic(vi_ctype, channel_list_ctype, buffer_size_ctype, data_ctype, None if actual_num_read_ctype is None else (ctypes.pointer(actual_num_read_ctype))) @@ -1784,12 +1784,12 @@ def tdr(self, apply_offsets): vi_ctype = _visatype.ViSession(self._vi) # case S110 channel_list_ctype = ctypes.create_string_buffer(self._repeated_capability.encode(self._encoding)) # case C010 apply_offsets_ctype = _visatype.ViBoolean(apply_offsets) # case S150 - offsets_buffer_size_ctype = _visatype.ViInt32(0) # case S210 + offsets_buffer_size_ctype = _visatype.ViInt32(0) # case S190 offsets_ctype = None # case B610 - actual_num_offsets_ctype = _visatype.ViInt32() # case S200 + actual_num_offsets_ctype = _visatype.ViInt32() # case S220 error_code = self._library.niDigital_TDR(vi_ctype, channel_list_ctype, apply_offsets_ctype, offsets_buffer_size_ctype, offsets_ctype, None if actual_num_offsets_ctype is None else (ctypes.pointer(actual_num_offsets_ctype))) errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False) - offsets_buffer_size_ctype = _visatype.ViInt32(actual_num_offsets_ctype.value) # case S220 + offsets_buffer_size_ctype = _visatype.ViInt32(actual_num_offsets_ctype.value) # case S200 offsets_size = actual_num_offsets_ctype.value # case B620 offsets_ctype = get_ctypes_pointer_for_buffer(library_type=_visatype.ViReal64, size=offsets_size) # case B620 error_code = self._library.niDigital_TDR(vi_ctype, channel_list_ctype, apply_offsets_ctype, offsets_buffer_size_ctype, offsets_ctype, None if actual_num_offsets_ctype is None else (ctypes.pointer(actual_num_offsets_ctype))) @@ -2785,11 +2785,11 @@ def fetch_history_ram_cycle_information(self, site, sample_index): vi_ctype = _visatype.ViSession(self._vi) # case S110 site_ctype = ctypes.create_string_buffer(site.encode(self._encoding)) # case C020 sample_index_ctype = _visatype.ViInt64(sample_index) # case S150 - pattern_index_ctype = _visatype.ViInt32() # case S200 - time_set_index_ctype = _visatype.ViInt32() # case S200 - vector_number_ctype = _visatype.ViInt64() # case S200 - cycle_number_ctype = _visatype.ViInt64() # case S200 - num_dut_cycles_ctype = _visatype.ViInt32() # case S200 + pattern_index_ctype = _visatype.ViInt32() # case S220 + time_set_index_ctype = _visatype.ViInt32() # case S220 + vector_number_ctype = _visatype.ViInt64() # case S220 + cycle_number_ctype = _visatype.ViInt64() # case S220 + num_dut_cycles_ctype = _visatype.ViInt32() # case S220 error_code = self._library.niDigital_FetchHistoryRAMCycleInformation(vi_ctype, site_ctype, sample_index_ctype, None if pattern_index_ctype is None else (ctypes.pointer(pattern_index_ctype)), None if time_set_index_ctype is None else (ctypes.pointer(time_set_index_ctype)), None if vector_number_ctype is None else (ctypes.pointer(vector_number_ctype)), None if cycle_number_ctype is None else (ctypes.pointer(cycle_number_ctype)), None if num_dut_cycles_ctype is None else (ctypes.pointer(num_dut_cycles_ctype))) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return int(pattern_index_ctype.value), int(time_set_index_ctype.value), int(vector_number_ctype.value), int(cycle_number_ctype.value), int(num_dut_cycles_ctype.value) @@ -2819,14 +2819,14 @@ def fetch_history_ram_cycle_pin_data(self, site, pin_list, sample_index, dut_cyc pin_list_ctype = ctypes.create_string_buffer(pin_list.encode(self._encoding)) # case C020 sample_index_ctype = _visatype.ViInt64(sample_index) # case S150 dut_cycle_index_ctype = _visatype.ViInt32(dut_cycle_index) # case S150 - pin_data_buffer_size_ctype = _visatype.ViInt32(0) # case S210 + pin_data_buffer_size_ctype = _visatype.ViInt32(0) # case S190 expected_pin_states_ctype = None # case B610 actual_pin_states_ctype = None # case B610 per_pin_pass_fail_ctype = None # case B610 - actual_num_pin_data_ctype = _visatype.ViInt32() # case S200 + actual_num_pin_data_ctype = _visatype.ViInt32() # case S220 error_code = self._library.niDigital_FetchHistoryRAMCyclePinData(vi_ctype, site_ctype, pin_list_ctype, sample_index_ctype, dut_cycle_index_ctype, pin_data_buffer_size_ctype, expected_pin_states_ctype, actual_pin_states_ctype, per_pin_pass_fail_ctype, None if actual_num_pin_data_ctype is None else (ctypes.pointer(actual_num_pin_data_ctype))) errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False) - pin_data_buffer_size_ctype = _visatype.ViInt32(actual_num_pin_data_ctype.value) # case S220 + pin_data_buffer_size_ctype = _visatype.ViInt32(actual_num_pin_data_ctype.value) # case S200 expected_pin_states_size = actual_num_pin_data_ctype.value # case B620 expected_pin_states_ctype = get_ctypes_pointer_for_buffer(library_type=_visatype.ViUInt8, size=expected_pin_states_size) # case B620 actual_pin_states_size = actual_num_pin_data_ctype.value # case B620 @@ -2856,7 +2856,7 @@ def fetch_history_ram_scan_cycle_number(self, site, sample_index): vi_ctype = _visatype.ViSession(self._vi) # case S110 site_ctype = ctypes.create_string_buffer(site.encode(self._encoding)) # case C020 sample_index_ctype = _visatype.ViInt64(sample_index) # case S150 - scan_cycle_number_ctype = _visatype.ViInt64() # case S200 + scan_cycle_number_ctype = _visatype.ViInt64() # case S220 error_code = self._library.niDigital_FetchHistoryRAMScanCycleNumber(vi_ctype, site_ctype, sample_index_ctype, None if scan_cycle_number_ctype is None else (ctypes.pointer(scan_cycle_number_ctype))) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return int(scan_cycle_number_ctype.value) @@ -2921,7 +2921,7 @@ def get_history_ram_sample_count(self, site): ''' vi_ctype = _visatype.ViSession(self._vi) # case S110 site_ctype = ctypes.create_string_buffer(site.encode(self._encoding)) # case C020 - sample_count_ctype = _visatype.ViInt64() # case S200 + sample_count_ctype = _visatype.ViInt64() # case S220 error_code = self._library.niDigital_GetHistoryRAMSampleCount(vi_ctype, site_ctype, None if sample_count_ctype is None else (ctypes.pointer(sample_count_ctype))) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return int(sample_count_ctype.value) @@ -2964,12 +2964,12 @@ def get_pattern_pin_indexes(self, start_label): ''' vi_ctype = _visatype.ViSession(self._vi) # case S110 start_label_ctype = ctypes.create_string_buffer(start_label.encode(self._encoding)) # case C020 - pin_indexes_buffer_size_ctype = _visatype.ViInt32(0) # case S210 + pin_indexes_buffer_size_ctype = _visatype.ViInt32(0) # case S190 pin_indexes_ctype = None # case B610 - actual_num_pins_ctype = _visatype.ViInt32() # case S200 + actual_num_pins_ctype = _visatype.ViInt32() # case S220 error_code = self._library.niDigital_GetPatternPinIndexes(vi_ctype, start_label_ctype, pin_indexes_buffer_size_ctype, pin_indexes_ctype, None if actual_num_pins_ctype is None else (ctypes.pointer(actual_num_pins_ctype))) errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False) - pin_indexes_buffer_size_ctype = _visatype.ViInt32(actual_num_pins_ctype.value) # case S220 + pin_indexes_buffer_size_ctype = _visatype.ViInt32(actual_num_pins_ctype.value) # case S200 pin_indexes_size = actual_num_pins_ctype.value # case B620 pin_indexes_ctype = get_ctypes_pointer_for_buffer(library_type=_visatype.ViInt32, size=pin_indexes_size) # case B620 error_code = self._library.niDigital_GetPatternPinIndexes(vi_ctype, start_label_ctype, pin_indexes_buffer_size_ctype, pin_indexes_ctype, None if actual_num_pins_ctype is None else (ctypes.pointer(actual_num_pins_ctype))) @@ -3036,12 +3036,12 @@ def get_site_pass_fail(self, site_list): ''' vi_ctype = _visatype.ViSession(self._vi) # case S110 site_list_ctype = ctypes.create_string_buffer(site_list.encode(self._encoding)) # case C020 - pass_fail_buffer_size_ctype = _visatype.ViInt32(0) # case S210 + pass_fail_buffer_size_ctype = _visatype.ViInt32(0) # case S190 pass_fail_ctype = None # case B610 - actual_num_sites_ctype = _visatype.ViInt32() # case S200 + actual_num_sites_ctype = _visatype.ViInt32() # case S220 error_code = self._library.niDigital_GetSitePassFail(vi_ctype, site_list_ctype, pass_fail_buffer_size_ctype, pass_fail_ctype, None if actual_num_sites_ctype is None else (ctypes.pointer(actual_num_sites_ctype))) errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False) - pass_fail_buffer_size_ctype = _visatype.ViInt32(actual_num_sites_ctype.value) # case S220 + pass_fail_buffer_size_ctype = _visatype.ViInt32(actual_num_sites_ctype.value) # case S200 pass_fail_size = actual_num_sites_ctype.value # case B620 pass_fail_ctype = get_ctypes_pointer_for_buffer(library_type=_visatype.ViBoolean, size=pass_fail_size) # case B620 error_code = self._library.niDigital_GetSitePassFail(vi_ctype, site_list_ctype, pass_fail_buffer_size_ctype, pass_fail_ctype, None if actual_num_sites_ctype is None else (ctypes.pointer(actual_num_sites_ctype))) @@ -3067,12 +3067,12 @@ def get_site_results_site_numbers(self, site_list, site_result_type): vi_ctype = _visatype.ViSession(self._vi) # case S110 site_list_ctype = ctypes.create_string_buffer(site_list.encode(self._encoding)) # case C020 site_result_type_ctype = _visatype.ViInt32(site_result_type) # case S150 - site_numbers_buffer_size_ctype = _visatype.ViInt32(0) # case S210 + site_numbers_buffer_size_ctype = _visatype.ViInt32(0) # case S190 site_numbers_ctype = None # case B610 - actual_num_site_numbers_ctype = _visatype.ViInt32() # case S200 + actual_num_site_numbers_ctype = _visatype.ViInt32() # case S220 error_code = self._library.niDigital_GetSiteResultsSiteNumbers(vi_ctype, site_list_ctype, site_result_type_ctype, site_numbers_buffer_size_ctype, site_numbers_ctype, None if actual_num_site_numbers_ctype is None else (ctypes.pointer(actual_num_site_numbers_ctype))) errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False) - site_numbers_buffer_size_ctype = _visatype.ViInt32(actual_num_site_numbers_ctype.value) # case S220 + site_numbers_buffer_size_ctype = _visatype.ViInt32(actual_num_site_numbers_ctype.value) # case S200 site_numbers_size = actual_num_site_numbers_ctype.value # case B620 site_numbers_ctype = get_ctypes_pointer_for_buffer(library_type=_visatype.ViInt32, size=site_numbers_size) # case B620 error_code = self._library.niDigital_GetSiteResultsSiteNumbers(vi_ctype, site_list_ctype, site_result_type_ctype, site_numbers_buffer_size_ctype, site_numbers_ctype, None if actual_num_site_numbers_ctype is None else (ctypes.pointer(actual_num_site_numbers_ctype))) @@ -3098,7 +3098,7 @@ def get_time_set_drive_format(self, pin, time_set): vi_ctype = _visatype.ViSession(self._vi) # case S110 pin_ctype = ctypes.create_string_buffer(pin.encode(self._encoding)) # case C020 time_set_ctype = ctypes.create_string_buffer(time_set.encode(self._encoding)) # case C020 - format_ctype = _visatype.ViInt32() # case S200 + format_ctype = _visatype.ViInt32() # case S220 error_code = self._library.niDigital_GetTimeSetDriveFormat(vi_ctype, pin_ctype, time_set_ctype, None if format_ctype is None else (ctypes.pointer(format_ctype))) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return int(format_ctype.value) @@ -3125,7 +3125,7 @@ def get_time_set_edge(self, pin, time_set, edge): pin_ctype = ctypes.create_string_buffer(pin.encode(self._encoding)) # case C020 time_set_ctype = ctypes.create_string_buffer(time_set.encode(self._encoding)) # case C020 edge_ctype = _visatype.ViInt32(edge) # case S150 - time_ctype = _visatype.ViReal64() # case S200 + time_ctype = _visatype.ViReal64() # case S220 error_code = self._library.niDigital_GetTimeSetEdge(vi_ctype, pin_ctype, time_set_ctype, edge_ctype, None if time_ctype is None else (ctypes.pointer(time_ctype))) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return float(time_ctype.value) @@ -3149,7 +3149,7 @@ def get_time_set_edge_multiplier(self, pin, time_set): vi_ctype = _visatype.ViSession(self._vi) # case S110 pin_ctype = ctypes.create_string_buffer(pin.encode(self._encoding)) # case C020 time_set_ctype = ctypes.create_string_buffer(time_set.encode(self._encoding)) # case C020 - edge_multiplier_ctype = _visatype.ViInt32() # case S200 + edge_multiplier_ctype = _visatype.ViInt32() # case S220 error_code = self._library.niDigital_GetTimeSetEdgeMultiplier(vi_ctype, pin_ctype, time_set_ctype, None if edge_multiplier_ctype is None else (ctypes.pointer(edge_multiplier_ctype))) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return int(edge_multiplier_ctype.value) @@ -3192,7 +3192,7 @@ def get_time_set_period(self, time_set): ''' vi_ctype = _visatype.ViSession(self._vi) # case S110 time_set_ctype = ctypes.create_string_buffer(time_set.encode(self._encoding)) # case C020 - period_ctype = _visatype.ViReal64() # case S200 + period_ctype = _visatype.ViReal64() # case S220 error_code = self._library.niDigital_GetTimeSetPeriod(vi_ctype, time_set_ctype, None if period_ctype is None else (ctypes.pointer(period_ctype))) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return float(period_ctype.value) @@ -3220,7 +3220,7 @@ def _init_with_options(self, resource_name, id_query=False, reset_device=False, id_query_ctype = _visatype.ViBoolean(id_query) # case S150 reset_device_ctype = _visatype.ViBoolean(reset_device) # case S150 option_string_ctype = ctypes.create_string_buffer(option_string.encode(self._encoding)) # case C020 - new_vi_ctype = _visatype.ViSession() # case S200 + new_vi_ctype = _visatype.ViSession() # case S220 error_code = self._library.niDigital_InitWithOptions(resource_name_ctype, id_query_ctype, reset_device_ctype, option_string_ctype, None if new_vi_ctype is None else (ctypes.pointer(new_vi_ctype))) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return int(new_vi_ctype.value) @@ -3247,7 +3247,7 @@ def is_done(self): ''' vi_ctype = _visatype.ViSession(self._vi) # case S110 - done_ctype = _visatype.ViBoolean() # case S200 + done_ctype = _visatype.ViBoolean() # case S220 error_code = self._library.niDigital_IsDone(vi_ctype, None if done_ctype is None else (ctypes.pointer(done_ctype))) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return bool(done_ctype.value) @@ -3268,7 +3268,7 @@ def is_site_enabled(self, site): ''' vi_ctype = _visatype.ViSession(self._vi) # case S110 site_ctype = ctypes.create_string_buffer(site.encode(self._encoding)) # case C020 - enable_ctype = _visatype.ViBoolean() # case S200 + enable_ctype = _visatype.ViBoolean() # case S220 error_code = self._library.niDigital_IsSiteEnabled(vi_ctype, site_ctype, None if enable_ctype is None else (ctypes.pointer(enable_ctype))) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return bool(enable_ctype.value) @@ -3369,7 +3369,7 @@ def read_sequencer_flag(self, flag): ''' vi_ctype = _visatype.ViSession(self._vi) # case S110 flag_ctype = ctypes.create_string_buffer(flag.encode(self._encoding)) # case C020 - value_ctype = _visatype.ViBoolean() # case S200 + value_ctype = _visatype.ViBoolean() # case S220 error_code = self._library.niDigital_ReadSequencerFlag(vi_ctype, flag_ctype, None if value_ctype is None else (ctypes.pointer(value_ctype))) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return bool(value_ctype.value) @@ -3390,7 +3390,7 @@ def read_sequencer_register(self, reg): ''' vi_ctype = _visatype.ViSession(self._vi) # case S110 reg_ctype = ctypes.create_string_buffer(reg.encode(self._encoding)) # case C020 - value_ctype = _visatype.ViInt32() # case S200 + value_ctype = _visatype.ViInt32() # case S220 error_code = self._library.niDigital_ReadSequencerRegister(vi_ctype, reg_ctype, None if value_ctype is None else (ctypes.pointer(value_ctype))) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return int(value_ctype.value) @@ -3597,7 +3597,7 @@ def _self_test(self): ''' vi_ctype = _visatype.ViSession(self._vi) # case S110 - test_result_ctype = _visatype.ViInt16() # case S200 + test_result_ctype = _visatype.ViInt16() # case S220 test_message_ctype = (_visatype.ViChar * 2048)() # case C070 error_code = self._library.niDigital_self_test(vi_ctype, None if test_result_ctype is None else (ctypes.pointer(test_result_ctype)), test_message_ctype) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) diff --git a/generated/nidmm/session.py b/generated/nidmm/session.py index 6266be767..fc5e3c9d4 100644 --- a/generated/nidmm/session.py +++ b/generated/nidmm/session.py @@ -596,7 +596,7 @@ def _get_attribute_vi_boolean(self, attribute_id): vi_ctype = _visatype.ViSession(self._vi) # case S110 channel_name_ctype = ctypes.create_string_buffer(self._repeated_capability.encode(self._encoding)) # case C010 attribute_id_ctype = _visatype.ViAttr(attribute_id) # case S150 - attribute_value_ctype = _visatype.ViBoolean() # case S200 + attribute_value_ctype = _visatype.ViBoolean() # case S220 error_code = self._library.niDMM_GetAttributeViBoolean(vi_ctype, channel_name_ctype, attribute_id_ctype, None if attribute_value_ctype is None else (ctypes.pointer(attribute_value_ctype))) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return bool(attribute_value_ctype.value) @@ -636,7 +636,7 @@ def _get_attribute_vi_int32(self, attribute_id): vi_ctype = _visatype.ViSession(self._vi) # case S110 channel_name_ctype = ctypes.create_string_buffer(self._repeated_capability.encode(self._encoding)) # case C010 attribute_id_ctype = _visatype.ViAttr(attribute_id) # case S150 - attribute_value_ctype = _visatype.ViInt32() # case S200 + attribute_value_ctype = _visatype.ViInt32() # case S220 error_code = self._library.niDMM_GetAttributeViInt32(vi_ctype, channel_name_ctype, attribute_id_ctype, None if attribute_value_ctype is None else (ctypes.pointer(attribute_value_ctype))) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return int(attribute_value_ctype.value) @@ -676,7 +676,7 @@ def _get_attribute_vi_real64(self, attribute_id): vi_ctype = _visatype.ViSession(self._vi) # case S110 channel_name_ctype = ctypes.create_string_buffer(self._repeated_capability.encode(self._encoding)) # case C010 attribute_id_ctype = _visatype.ViAttr(attribute_id) # case S150 - attribute_value_ctype = _visatype.ViReal64() # case S200 + attribute_value_ctype = _visatype.ViReal64() # case S220 error_code = self._library.niDMM_GetAttributeViReal64(vi_ctype, channel_name_ctype, attribute_id_ctype, None if attribute_value_ctype is None else (ctypes.pointer(attribute_value_ctype))) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return float(attribute_value_ctype.value) @@ -740,7 +740,7 @@ def _get_error(self): ''' vi_ctype = _visatype.ViSession(self._vi) # case S110 - error_code_ctype = _visatype.ViStatus() # case S200 + error_code_ctype = _visatype.ViStatus() # case S220 buffer_size_ctype = _visatype.ViInt32() # case S170 description_ctype = None # case C050 error_code = self._library.niDMM_GetError(vi_ctype, None if error_code_ctype is None else (ctypes.pointer(error_code_ctype)), buffer_size_ctype, description_ctype) @@ -1807,7 +1807,7 @@ def fetch(self, maximum_time=datetime.timedelta(milliseconds=-1)): ''' vi_ctype = _visatype.ViSession(self._vi) # case S110 maximum_time_ctype = _converters.convert_timedelta_to_milliseconds(maximum_time, _visatype.ViInt32) # case S140 - reading_ctype = _visatype.ViReal64() # case S200 + reading_ctype = _visatype.ViReal64() # case S220 error_code = self._library.niDMM_Fetch(vi_ctype, maximum_time_ctype, None if reading_ctype is None else (ctypes.pointer(reading_ctype))) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return float(reading_ctype.value) @@ -1858,11 +1858,11 @@ def fetch_multi_point(self, array_size, maximum_time=datetime.timedelta(millisec ''' vi_ctype = _visatype.ViSession(self._vi) # case S110 maximum_time_ctype = _converters.convert_timedelta_to_milliseconds(maximum_time, _visatype.ViInt32) # case S140 - array_size_ctype = _visatype.ViInt32(array_size) # case S190 + array_size_ctype = _visatype.ViInt32(array_size) # case S210 reading_array_size = array_size # case B600 reading_array_array = array.array("d", [0] * reading_array_size) # case B600 reading_array_ctype = get_ctypes_pointer_for_buffer(value=reading_array_array, library_type=_visatype.ViReal64) # case B600 - actual_number_of_points_ctype = _visatype.ViInt32() # case S200 + actual_number_of_points_ctype = _visatype.ViInt32() # case S220 error_code = self._library.niDMM_FetchMultiPoint(vi_ctype, maximum_time_ctype, array_size_ctype, reading_array_ctype, None if actual_number_of_points_ctype is None else (ctypes.pointer(actual_number_of_points_ctype))) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return reading_array_array @@ -1905,11 +1905,11 @@ def fetch_waveform(self, array_size, maximum_time=datetime.timedelta(millisecond ''' vi_ctype = _visatype.ViSession(self._vi) # case S110 maximum_time_ctype = _converters.convert_timedelta_to_milliseconds(maximum_time, _visatype.ViInt32) # case S140 - array_size_ctype = _visatype.ViInt32(array_size) # case S190 + array_size_ctype = _visatype.ViInt32(array_size) # case S210 waveform_array_size = array_size # case B600 waveform_array_array = array.array("d", [0] * waveform_array_size) # case B600 waveform_array_ctype = get_ctypes_pointer_for_buffer(value=waveform_array_array, library_type=_visatype.ViReal64) # case B600 - actual_number_of_points_ctype = _visatype.ViInt32() # case S200 + actual_number_of_points_ctype = _visatype.ViInt32() # case S220 error_code = self._library.niDMM_FetchWaveform(vi_ctype, maximum_time_ctype, array_size_ctype, waveform_array_ctype, None if actual_number_of_points_ctype is None else (ctypes.pointer(actual_number_of_points_ctype))) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return waveform_array_array @@ -1960,9 +1960,9 @@ def fetch_waveform_into(self, waveform_array, maximum_time=datetime.timedelta(mi vi_ctype = _visatype.ViSession(self._vi) # case S110 maximum_time_ctype = _converters.convert_timedelta_to_milliseconds(maximum_time, _visatype.ViInt32) # case S140 - array_size_ctype = _visatype.ViInt32(array_size) # case S190 + array_size_ctype = _visatype.ViInt32(array_size) # case S210 waveform_array_ctype = get_ctypes_pointer_for_buffer(value=waveform_array) # case B510 - actual_number_of_points_ctype = _visatype.ViInt32() # case S200 + actual_number_of_points_ctype = _visatype.ViInt32() # case S220 error_code = self._library.niDMM_FetchWaveform(vi_ctype, maximum_time_ctype, array_size_ctype, waveform_array_ctype, None if actual_number_of_points_ctype is None else (ctypes.pointer(actual_number_of_points_ctype))) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return @@ -2005,11 +2005,11 @@ def _get_cal_date_and_time(self, cal_type): ''' vi_ctype = _visatype.ViSession(self._vi) # case S110 cal_type_ctype = _visatype.ViInt32(cal_type) # case S150 - month_ctype = _visatype.ViInt32() # case S200 - day_ctype = _visatype.ViInt32() # case S200 - year_ctype = _visatype.ViInt32() # case S200 - hour_ctype = _visatype.ViInt32() # case S200 - minute_ctype = _visatype.ViInt32() # case S200 + month_ctype = _visatype.ViInt32() # case S220 + day_ctype = _visatype.ViInt32() # case S220 + year_ctype = _visatype.ViInt32() # case S220 + hour_ctype = _visatype.ViInt32() # case S220 + minute_ctype = _visatype.ViInt32() # case S220 error_code = self._library.niDMM_GetCalDateAndTime(vi_ctype, cal_type_ctype, None if month_ctype is None else (ctypes.pointer(month_ctype)), None if day_ctype is None else (ctypes.pointer(day_ctype)), None if year_ctype is None else (ctypes.pointer(year_ctype)), None if hour_ctype is None else (ctypes.pointer(hour_ctype)), None if minute_ctype is None else (ctypes.pointer(minute_ctype))) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return int(month_ctype.value), int(day_ctype.value), int(year_ctype.value), int(hour_ctype.value), int(minute_ctype.value) @@ -2032,7 +2032,7 @@ def get_dev_temp(self, options=""): ''' vi_ctype = _visatype.ViSession(self._vi) # case S110 options_ctype = ctypes.create_string_buffer(options.encode(self._encoding)) # case C020 - temperature_ctype = _visatype.ViReal64() # case S200 + temperature_ctype = _visatype.ViReal64() # case S220 error_code = self._library.niDMM_GetDevTemp(vi_ctype, options_ctype, None if temperature_ctype is None else (ctypes.pointer(temperature_ctype))) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return float(temperature_ctype.value) @@ -2052,7 +2052,7 @@ def get_ext_cal_recommended_interval(self): ''' vi_ctype = _visatype.ViSession(self._vi) # case S110 - months_ctype = _visatype.ViInt32() # case S200 + months_ctype = _visatype.ViInt32() # case S220 error_code = self._library.niDMM_GetExtCalRecommendedInterval(vi_ctype, None if months_ctype is None else (ctypes.pointer(months_ctype))) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return _converters.convert_month_to_timedelta(int(months_ctype.value)) @@ -2117,7 +2117,7 @@ def get_last_cal_temp(self, cal_type): ''' vi_ctype = _visatype.ViSession(self._vi) # case S110 cal_type_ctype = _visatype.ViInt32(cal_type) # case S150 - temperature_ctype = _visatype.ViReal64() # case S200 + temperature_ctype = _visatype.ViReal64() # case S220 error_code = self._library.niDMM_GetLastCalTemp(vi_ctype, cal_type_ctype, None if temperature_ctype is None else (ctypes.pointer(temperature_ctype))) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return float(temperature_ctype.value) @@ -2141,7 +2141,7 @@ def get_self_cal_supported(self): ''' vi_ctype = _visatype.ViSession(self._vi) # case S110 - self_cal_supported_ctype = _visatype.ViBoolean() # case S200 + self_cal_supported_ctype = _visatype.ViBoolean() # case S220 error_code = self._library.niDMM_GetSelfCalSupported(vi_ctype, None if self_cal_supported_ctype is None else (ctypes.pointer(self_cal_supported_ctype))) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return bool(self_cal_supported_ctype.value) @@ -2354,7 +2354,7 @@ def _init_with_options(self, resource_name, id_query=False, reset_device=False, id_query_ctype = _visatype.ViBoolean(id_query) # case S150 reset_device_ctype = _visatype.ViBoolean(reset_device) # case S150 option_string_ctype = ctypes.create_string_buffer(option_string.encode(self._encoding)) # case C020 - vi_ctype = _visatype.ViSession() # case S200 + vi_ctype = _visatype.ViSession() # case S220 error_code = self._library.niDMM_InitWithOptions(resource_name_ctype, id_query_ctype, reset_device_ctype, option_string_ctype, None if vi_ctype is None else (ctypes.pointer(vi_ctype))) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return int(vi_ctype.value) @@ -2400,8 +2400,8 @@ def perform_open_cable_comp(self): ''' vi_ctype = _visatype.ViSession(self._vi) # case S110 - conductance_ctype = _visatype.ViReal64() # case S200 - susceptance_ctype = _visatype.ViReal64() # case S200 + conductance_ctype = _visatype.ViReal64() # case S220 + susceptance_ctype = _visatype.ViReal64() # case S220 error_code = self._library.niDMM_PerformOpenCableComp(vi_ctype, None if conductance_ctype is None else (ctypes.pointer(conductance_ctype)), None if susceptance_ctype is None else (ctypes.pointer(susceptance_ctype))) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return float(conductance_ctype.value), float(susceptance_ctype.value) @@ -2431,8 +2431,8 @@ def perform_short_cable_comp(self): ''' vi_ctype = _visatype.ViSession(self._vi) # case S110 - resistance_ctype = _visatype.ViReal64() # case S200 - reactance_ctype = _visatype.ViReal64() # case S200 + resistance_ctype = _visatype.ViReal64() # case S220 + reactance_ctype = _visatype.ViReal64() # case S220 error_code = self._library.niDMM_PerformShortCableComp(vi_ctype, None if resistance_ctype is None else (ctypes.pointer(resistance_ctype)), None if reactance_ctype is None else (ctypes.pointer(reactance_ctype))) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return float(resistance_ctype.value), float(reactance_ctype.value) @@ -2465,7 +2465,7 @@ def read(self, maximum_time=datetime.timedelta(milliseconds=-1)): ''' vi_ctype = _visatype.ViSession(self._vi) # case S110 maximum_time_ctype = _converters.convert_timedelta_to_milliseconds(maximum_time, _visatype.ViInt32) # case S140 - reading_ctype = _visatype.ViReal64() # case S200 + reading_ctype = _visatype.ViReal64() # case S220 error_code = self._library.niDMM_Read(vi_ctype, maximum_time_ctype, None if reading_ctype is None else (ctypes.pointer(reading_ctype))) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return float(reading_ctype.value) @@ -2515,11 +2515,11 @@ def read_multi_point(self, array_size, maximum_time=datetime.timedelta(milliseco ''' vi_ctype = _visatype.ViSession(self._vi) # case S110 maximum_time_ctype = _converters.convert_timedelta_to_milliseconds(maximum_time, _visatype.ViInt32) # case S140 - array_size_ctype = _visatype.ViInt32(array_size) # case S190 + array_size_ctype = _visatype.ViInt32(array_size) # case S210 reading_array_size = array_size # case B600 reading_array_array = array.array("d", [0] * reading_array_size) # case B600 reading_array_ctype = get_ctypes_pointer_for_buffer(value=reading_array_array, library_type=_visatype.ViReal64) # case B600 - actual_number_of_points_ctype = _visatype.ViInt32() # case S200 + actual_number_of_points_ctype = _visatype.ViInt32() # case S220 error_code = self._library.niDMM_ReadMultiPoint(vi_ctype, maximum_time_ctype, array_size_ctype, reading_array_ctype, None if actual_number_of_points_ctype is None else (ctypes.pointer(actual_number_of_points_ctype))) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return reading_array_array @@ -2563,8 +2563,8 @@ def read_status(self): ''' vi_ctype = _visatype.ViSession(self._vi) # case S110 - acquisition_backlog_ctype = _visatype.ViInt32() # case S200 - acquisition_status_ctype = _visatype.ViInt16() # case S200 + acquisition_backlog_ctype = _visatype.ViInt32() # case S220 + acquisition_status_ctype = _visatype.ViInt16() # case S220 error_code = self._library.niDMM_ReadStatus(vi_ctype, None if acquisition_backlog_ctype is None else (ctypes.pointer(acquisition_backlog_ctype)), None if acquisition_status_ctype is None else (ctypes.pointer(acquisition_status_ctype))) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return int(acquisition_backlog_ctype.value), enums.AcquisitionStatus(acquisition_status_ctype.value) @@ -2612,11 +2612,11 @@ def read_waveform(self, array_size, maximum_time=datetime.timedelta(milliseconds ''' vi_ctype = _visatype.ViSession(self._vi) # case S110 maximum_time_ctype = _converters.convert_timedelta_to_milliseconds(maximum_time, _visatype.ViInt32) # case S140 - array_size_ctype = _visatype.ViInt32(array_size) # case S190 + array_size_ctype = _visatype.ViInt32(array_size) # case S210 waveform_array_size = array_size # case B600 waveform_array_array = array.array("d", [0] * waveform_array_size) # case B600 waveform_array_ctype = get_ctypes_pointer_for_buffer(value=waveform_array_array, library_type=_visatype.ViReal64) # case B600 - actual_number_of_points_ctype = _visatype.ViInt32() # case S200 + actual_number_of_points_ctype = _visatype.ViInt32() # case S220 error_code = self._library.niDMM_ReadWaveform(vi_ctype, maximum_time_ctype, array_size_ctype, waveform_array_ctype, None if actual_number_of_points_ctype is None else (ctypes.pointer(actual_number_of_points_ctype))) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return waveform_array_array @@ -2762,7 +2762,7 @@ def _self_test(self): ''' vi_ctype = _visatype.ViSession(self._vi) # case S110 - self_test_result_ctype = _visatype.ViInt16() # case S200 + self_test_result_ctype = _visatype.ViInt16() # case S220 self_test_message_ctype = (_visatype.ViChar * 256)() # case C070 error_code = self._library.niDMM_self_test(vi_ctype, None if self_test_result_ctype is None else (ctypes.pointer(self_test_result_ctype)), self_test_message_ctype) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) diff --git a/generated/nifake/session.py b/generated/nifake/session.py index 4301a9cbc..4bd90579e 100644 --- a/generated/nifake/session.py +++ b/generated/nifake/session.py @@ -238,7 +238,7 @@ def _get_attribute_vi_boolean(self, attribute_id): vi_ctype = _visatype.ViSession(self._vi) # case S110 channel_name_ctype = ctypes.create_string_buffer(self._repeated_capability.encode(self._encoding)) # case C010 attribute_id_ctype = _visatype.ViAttr(attribute_id) # case S150 - attribute_value_ctype = _visatype.ViBoolean() # case S200 + attribute_value_ctype = _visatype.ViBoolean() # case S220 error_code = self._library.niFake_GetAttributeViBoolean(vi_ctype, channel_name_ctype, attribute_id_ctype, None if attribute_value_ctype is None else (ctypes.pointer(attribute_value_ctype))) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return bool(attribute_value_ctype.value) @@ -268,7 +268,7 @@ def _get_attribute_vi_int32(self, attribute_id): vi_ctype = _visatype.ViSession(self._vi) # case S110 channel_name_ctype = ctypes.create_string_buffer(self._repeated_capability.encode(self._encoding)) # case C010 attribute_id_ctype = _visatype.ViAttr(attribute_id) # case S150 - attribute_value_ctype = _visatype.ViInt32() # case S200 + attribute_value_ctype = _visatype.ViInt32() # case S220 error_code = self._library.niFake_GetAttributeViInt32(vi_ctype, channel_name_ctype, attribute_id_ctype, None if attribute_value_ctype is None else (ctypes.pointer(attribute_value_ctype))) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return int(attribute_value_ctype.value) @@ -298,7 +298,7 @@ def _get_attribute_vi_int64(self, attribute_id): vi_ctype = _visatype.ViSession(self._vi) # case S110 channel_name_ctype = ctypes.create_string_buffer(self._repeated_capability.encode(self._encoding)) # case C010 attribute_id_ctype = _visatype.ViAttr(attribute_id) # case S150 - attribute_value_ctype = _visatype.ViInt64() # case S200 + attribute_value_ctype = _visatype.ViInt64() # case S220 error_code = self._library.niFake_GetAttributeViInt64(vi_ctype, channel_name_ctype, attribute_id_ctype, None if attribute_value_ctype is None else (ctypes.pointer(attribute_value_ctype))) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return int(attribute_value_ctype.value) @@ -328,7 +328,7 @@ def _get_attribute_vi_real64(self, attribute_id): vi_ctype = _visatype.ViSession(self._vi) # case S110 channel_name_ctype = ctypes.create_string_buffer(self._repeated_capability.encode(self._encoding)) # case C010 attribute_id_ctype = _visatype.ViAttr(attribute_id) # case S150 - attribute_value_ctype = _visatype.ViReal64() # case S200 + attribute_value_ctype = _visatype.ViReal64() # case S220 error_code = self._library.niFake_GetAttributeViReal64(vi_ctype, channel_name_ctype, attribute_id_ctype, None if attribute_value_ctype is None else (ctypes.pointer(attribute_value_ctype))) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return float(attribute_value_ctype.value) @@ -374,7 +374,7 @@ def _get_error(self): ''' vi_ctype = _visatype.ViSession(self._vi) # case S110 - error_code_ctype = _visatype.ViStatus() # case S200 + error_code_ctype = _visatype.ViStatus() # case S220 buffer_size_ctype = _visatype.ViInt32() # case S170 description_ctype = None # case C050 error_code = self._library.niFake_GetError(vi_ctype, None if error_code_ctype is None else (ctypes.pointer(error_code_ctype)), buffer_size_ctype, description_ctype) @@ -455,7 +455,7 @@ def read_from_channel(self, maximum_time): vi_ctype = _visatype.ViSession(self._vi) # case S110 channel_name_ctype = ctypes.create_string_buffer(self._repeated_capability.encode(self._encoding)) # case C010 maximum_time_ctype = _converters.convert_timedelta_to_microseconds(maximum_time, _visatype.ViInt32) # case S140 - reading_ctype = _visatype.ViReal64() # case S200 + reading_ctype = _visatype.ViReal64() # case S220 error_code = self._library.niFake_ReadFromChannel(vi_ctype, channel_name_ctype, maximum_time_ctype, None if reading_ctype is None else (ctypes.pointer(reading_ctype))) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return float(reading_ctype.value) @@ -768,7 +768,7 @@ def bool_array_output_function(self, number_of_elements): ''' vi_ctype = _visatype.ViSession(self._vi) # case S110 - number_of_elements_ctype = _visatype.ViInt32(number_of_elements) # case S190 + number_of_elements_ctype = _visatype.ViInt32(number_of_elements) # case S210 an_array_size = number_of_elements # case B600 an_array_ctype = get_ctypes_pointer_for_buffer(library_type=_visatype.ViBoolean, size=an_array_size) # case B600 error_code = self._library.niFake_BoolArrayOutputFunction(vi_ctype, number_of_elements_ctype, an_array_ctype) @@ -790,7 +790,7 @@ def enum_array_output_function(self, number_of_elements): ''' vi_ctype = _visatype.ViSession(self._vi) # case S110 - number_of_elements_ctype = _visatype.ViInt32(number_of_elements) # case S190 + number_of_elements_ctype = _visatype.ViInt32(number_of_elements) # case S210 an_array_size = number_of_elements # case B600 an_array_ctype = get_ctypes_pointer_for_buffer(library_type=_visatype.ViInt16, size=an_array_size) # case B600 error_code = self._library.niFake_EnumArrayOutputFunction(vi_ctype, number_of_elements_ctype, an_array_ctype) @@ -842,11 +842,11 @@ def fetch_waveform(self, number_of_samples): ''' vi_ctype = _visatype.ViSession(self._vi) # case S110 - number_of_samples_ctype = _visatype.ViInt32(number_of_samples) # case S190 + number_of_samples_ctype = _visatype.ViInt32(number_of_samples) # case S210 waveform_data_size = number_of_samples # case B600 waveform_data_array = array.array("d", [0] * waveform_data_size) # case B600 waveform_data_ctype = get_ctypes_pointer_for_buffer(value=waveform_data_array, library_type=_visatype.ViReal64) # case B600 - actual_number_of_samples_ctype = _visatype.ViInt32() # case S200 + actual_number_of_samples_ctype = _visatype.ViInt32() # case S220 error_code = self._library.niFake_FetchWaveform(vi_ctype, number_of_samples_ctype, waveform_data_ctype, None if actual_number_of_samples_ctype is None else (ctypes.pointer(actual_number_of_samples_ctype))) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return waveform_data_array @@ -878,9 +878,9 @@ def fetch_waveform_into(self, waveform_data): number_of_samples = len(waveform_data) vi_ctype = _visatype.ViSession(self._vi) # case S110 - number_of_samples_ctype = _visatype.ViInt32(number_of_samples) # case S190 + number_of_samples_ctype = _visatype.ViInt32(number_of_samples) # case S210 waveform_data_ctype = get_ctypes_pointer_for_buffer(value=waveform_data) # case B510 - actual_number_of_samples_ctype = _visatype.ViInt32() # case S200 + actual_number_of_samples_ctype = _visatype.ViInt32() # case S220 error_code = self._library.niFake_FetchWaveform(vi_ctype, number_of_samples_ctype, waveform_data_ctype, None if actual_number_of_samples_ctype is None else (ctypes.pointer(actual_number_of_samples_ctype))) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return @@ -898,7 +898,7 @@ def get_a_boolean(self): ''' vi_ctype = _visatype.ViSession(self._vi) # case S110 - a_boolean_ctype = _visatype.ViBoolean() # case S200 + a_boolean_ctype = _visatype.ViBoolean() # case S220 error_code = self._library.niFake_GetABoolean(vi_ctype, None if a_boolean_ctype is None else (ctypes.pointer(a_boolean_ctype))) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return bool(a_boolean_ctype.value) @@ -916,7 +916,7 @@ def get_a_number(self): ''' vi_ctype = _visatype.ViSession(self._vi) # case S110 - a_number_ctype = _visatype.ViInt16() # case S200 + a_number_ctype = _visatype.ViInt16() # case S220 error_code = self._library.niFake_GetANumber(vi_ctype, None if a_number_ctype is None else (ctypes.pointer(a_number_ctype))) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return int(a_number_ctype.value) @@ -988,12 +988,12 @@ def get_an_ivi_dance_with_a_twist_string(self): ''' vi_ctype = _visatype.ViSession(self._vi) # case S110 - buffer_size_ctype = _visatype.ViInt32(0) # case S210 + buffer_size_ctype = _visatype.ViInt32(0) # case S190 a_string_ctype = None # case C090 - actual_size_ctype = _visatype.ViInt32() # case S200 + actual_size_ctype = _visatype.ViInt32() # case S220 error_code = self._library.niFake_GetAnIviDanceWithATwistString(vi_ctype, buffer_size_ctype, a_string_ctype, None if actual_size_ctype is None else (ctypes.pointer(actual_size_ctype))) errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False) - buffer_size_ctype = _visatype.ViInt32(actual_size_ctype.value) # case S220 + buffer_size_ctype = _visatype.ViInt32(actual_size_ctype.value) # case S200 a_string_ctype = (_visatype.ViChar * actual_size_ctype.value)() # case C100 error_code = self._library.niFake_GetAnIviDanceWithATwistString(vi_ctype, buffer_size_ctype, a_string_ctype, None if actual_size_ctype is None else (ctypes.pointer(actual_size_ctype))) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) @@ -1046,7 +1046,7 @@ def get_array_size_for_python_code(self): ''' vi_ctype = _visatype.ViSession(self._vi) # case S110 - size_out_ctype = _visatype.ViInt32() # case S200 + size_out_ctype = _visatype.ViInt32() # case S220 error_code = self._library.niFake_GetArraySizeForPythonCode(vi_ctype, None if size_out_ctype is None else (ctypes.pointer(size_out_ctype))) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return int(size_out_ctype.value) @@ -1093,11 +1093,11 @@ def _get_cal_date_and_time(self, cal_type): ''' vi_ctype = _visatype.ViSession(self._vi) # case S110 cal_type_ctype = _visatype.ViInt32(cal_type) # case S150 - month_ctype = _visatype.ViInt32() # case S200 - day_ctype = _visatype.ViInt32() # case S200 - year_ctype = _visatype.ViInt32() # case S200 - hour_ctype = _visatype.ViInt32() # case S200 - minute_ctype = _visatype.ViInt32() # case S200 + month_ctype = _visatype.ViInt32() # case S220 + day_ctype = _visatype.ViInt32() # case S220 + year_ctype = _visatype.ViInt32() # case S220 + hour_ctype = _visatype.ViInt32() # case S220 + minute_ctype = _visatype.ViInt32() # case S220 error_code = self._library.niFake_GetCalDateAndTime(vi_ctype, cal_type_ctype, None if month_ctype is None else (ctypes.pointer(month_ctype)), None if day_ctype is None else (ctypes.pointer(day_ctype)), None if year_ctype is None else (ctypes.pointer(year_ctype)), None if hour_ctype is None else (ctypes.pointer(hour_ctype)), None if minute_ctype is None else (ctypes.pointer(minute_ctype))) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return int(month_ctype.value), int(day_ctype.value), int(year_ctype.value), int(hour_ctype.value), int(minute_ctype.value) @@ -1113,7 +1113,7 @@ def get_cal_interval(self): ''' vi_ctype = _visatype.ViSession(self._vi) # case S110 - months_ctype = _visatype.ViInt32() # case S200 + months_ctype = _visatype.ViInt32() # case S220 error_code = self._library.niFake_GetCalInterval(vi_ctype, None if months_ctype is None else (ctypes.pointer(months_ctype))) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return _converters.convert_month_to_timedelta(int(months_ctype.value)) @@ -1129,7 +1129,7 @@ def get_custom_type(self): ''' vi_ctype = _visatype.ViSession(self._vi) # case S110 - cs_ctype = custom_struct.struct_CustomStruct() # case S200 + cs_ctype = custom_struct.struct_CustomStruct() # case S220 error_code = self._library.niFake_GetCustomType(vi_ctype, None if cs_ctype is None else (ctypes.pointer(cs_ctype))) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return custom_struct.CustomStruct(cs_ctype) @@ -1149,7 +1149,7 @@ def get_custom_type_array(self, number_of_elements): ''' vi_ctype = _visatype.ViSession(self._vi) # case S110 - number_of_elements_ctype = _visatype.ViInt32(number_of_elements) # case S190 + number_of_elements_ctype = _visatype.ViInt32(number_of_elements) # case S210 cs_size = number_of_elements # case B600 cs_ctype = get_ctypes_pointer_for_buffer(library_type=custom_struct.struct_CustomStruct, size=cs_size) # case B600 error_code = self._library.niFake_GetCustomTypeArray(vi_ctype, number_of_elements_ctype, cs_ctype) @@ -1183,8 +1183,8 @@ def get_enum_value(self): ''' vi_ctype = _visatype.ViSession(self._vi) # case S110 - a_quantity_ctype = _visatype.ViInt32() # case S200 - a_turtle_ctype = _visatype.ViInt16() # case S200 + a_quantity_ctype = _visatype.ViInt32() # case S220 + a_turtle_ctype = _visatype.ViInt16() # case S220 error_code = self._library.niFake_GetEnumValue(vi_ctype, None if a_quantity_ctype is None else (ctypes.pointer(a_quantity_ctype)), None if a_turtle_ctype is None else (ctypes.pointer(a_turtle_ctype))) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return int(a_quantity_ctype.value), enums.Turtle(a_turtle_ctype.value) @@ -1243,7 +1243,7 @@ def _init_with_options(self, resource_name, option_string, id_query=False, reset id_query_ctype = _visatype.ViBoolean(id_query) # case S150 reset_device_ctype = _visatype.ViBoolean(reset_device) # case S150 option_string_ctype = ctypes.create_string_buffer(option_string.encode(self._encoding)) # case C020 - vi_ctype = _visatype.ViSession() # case S200 + vi_ctype = _visatype.ViSession() # case S220 error_code = self._library.niFake_InitWithOptions(resource_name_ctype, id_query_ctype, reset_device_ctype, option_string_ctype, None if vi_ctype is None else (ctypes.pointer(vi_ctype))) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return int(vi_ctype.value) @@ -1282,7 +1282,7 @@ def multiple_array_types(self, output_array_size, input_array_of_floats, input_a ''' vi_ctype = _visatype.ViSession(self._vi) # case S110 - output_array_size_ctype = _visatype.ViInt32(output_array_size) # case S190 + output_array_size_ctype = _visatype.ViInt32(output_array_size) # case S210 output_array_size = output_array_size # case B600 output_array_ctype = get_ctypes_pointer_for_buffer(library_type=_visatype.ViReal64, size=output_array_size) # case B600 output_array_of_fixed_length_size = 3 # case B570 @@ -1420,7 +1420,7 @@ def read(self, maximum_time): ''' vi_ctype = _visatype.ViSession(self._vi) # case S110 maximum_time_ctype = _converters.convert_timedelta_to_seconds(maximum_time, _visatype.ViReal64) # case S140 - reading_ctype = _visatype.ViReal64() # case S200 + reading_ctype = _visatype.ViReal64() # case S220 error_code = self._library.niFake_Read(vi_ctype, maximum_time_ctype, None if reading_ctype is None else (ctypes.pointer(reading_ctype))) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return float(reading_ctype.value) @@ -1440,7 +1440,7 @@ def return_a_number_and_a_string(self): ''' vi_ctype = _visatype.ViSession(self._vi) # case S110 - a_number_ctype = _visatype.ViInt16() # case S200 + a_number_ctype = _visatype.ViInt16() # case S220 a_string_ctype = (_visatype.ViChar * 256)() # case C070 error_code = self._library.niFake_ReturnANumberAndAString(vi_ctype, None if a_number_ctype is None else (ctypes.pointer(a_number_ctype)), a_string_ctype) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) @@ -1485,13 +1485,13 @@ def return_multiple_types(self, array_size): ''' vi_ctype = _visatype.ViSession(self._vi) # case S110 - a_boolean_ctype = _visatype.ViBoolean() # case S200 - an_int32_ctype = _visatype.ViInt32() # case S200 - an_int64_ctype = _visatype.ViInt64() # case S200 - an_int_enum_ctype = _visatype.ViInt16() # case S200 - a_float_ctype = _visatype.ViReal64() # case S200 - a_float_enum_ctype = _visatype.ViReal64() # case S200 - array_size_ctype = _visatype.ViInt32(array_size) # case S190 + a_boolean_ctype = _visatype.ViBoolean() # case S220 + an_int32_ctype = _visatype.ViInt32() # case S220 + an_int64_ctype = _visatype.ViInt64() # case S220 + an_int_enum_ctype = _visatype.ViInt16() # case S220 + a_float_ctype = _visatype.ViReal64() # case S220 + a_float_enum_ctype = _visatype.ViReal64() # case S220 + array_size_ctype = _visatype.ViInt32(array_size) # case S210 an_array_size = array_size # case B600 an_array_ctype = get_ctypes_pointer_for_buffer(library_type=_visatype.ViReal64, size=an_array_size) # case B600 string_size_ctype = _visatype.ViInt32() # case S170 @@ -1574,7 +1574,7 @@ def use64_bit_number(self, input): ''' vi_ctype = _visatype.ViSession(self._vi) # case S110 input_ctype = _visatype.ViInt64(input) # case S150 - output_ctype = _visatype.ViInt64() # case S200 + output_ctype = _visatype.ViInt64() # case S220 error_code = self._library.niFake_Use64BitNumber(vi_ctype, input_ctype, None if output_ctype is None else (ctypes.pointer(output_ctype))) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return int(output_ctype.value) @@ -1656,7 +1656,7 @@ def _self_test(self): ''' vi_ctype = _visatype.ViSession(self._vi) # case S110 - self_test_result_ctype = _visatype.ViInt16() # case S200 + self_test_result_ctype = _visatype.ViInt16() # case S220 self_test_message_ctype = (_visatype.ViChar * 256)() # case C070 error_code = self._library.niFake_self_test(vi_ctype, None if self_test_result_ctype is None else (ctypes.pointer(self_test_result_ctype)), self_test_message_ctype) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) diff --git a/generated/nifgen/session.py b/generated/nifgen/session.py index 39b521838..17c1e7fd6 100644 --- a/generated/nifgen/session.py +++ b/generated/nifgen/session.py @@ -1043,7 +1043,7 @@ def allocate_waveform(self, waveform_size): vi_ctype = _visatype.ViSession(self._vi) # case S110 channel_name_ctype = ctypes.create_string_buffer(self._repeated_capability.encode(self._encoding)) # case C010 waveform_size_ctype = _visatype.ViInt32(waveform_size) # case S150 - waveform_handle_ctype = _visatype.ViInt32() # case S200 + waveform_handle_ctype = _visatype.ViInt32() # case S220 error_code = self._library.niFgen_AllocateWaveform(vi_ctype, channel_name_ctype, waveform_size_ctype, None if waveform_handle_ctype is None else (ctypes.pointer(waveform_handle_ctype))) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return int(waveform_handle_ctype.value) @@ -1511,7 +1511,7 @@ def _create_waveform_f64(self, waveform_data_array): waveform_size_ctype = _visatype.ViInt32(0 if waveform_data_array is None else len(waveform_data_array)) # case S160 waveform_data_array_array = get_ctypes_and_array(value=waveform_data_array, array_type="d") # case B550 waveform_data_array_ctype = get_ctypes_pointer_for_buffer(value=waveform_data_array_array, library_type=_visatype.ViReal64) # case B550 - waveform_handle_ctype = _visatype.ViInt32() # case S200 + waveform_handle_ctype = _visatype.ViInt32() # case S220 error_code = self._library.niFgen_CreateWaveformF64(vi_ctype, channel_name_ctype, waveform_size_ctype, waveform_data_array_ctype, None if waveform_handle_ctype is None else (ctypes.pointer(waveform_handle_ctype))) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return int(waveform_handle_ctype.value) @@ -1567,7 +1567,7 @@ def _create_waveform_f64_numpy(self, waveform_data_array): channel_name_ctype = ctypes.create_string_buffer(self._repeated_capability.encode(self._encoding)) # case C010 waveform_size_ctype = _visatype.ViInt32(0 if waveform_data_array is None else len(waveform_data_array)) # case S160 waveform_data_array_ctype = get_ctypes_pointer_for_buffer(value=waveform_data_array) # case B510 - waveform_handle_ctype = _visatype.ViInt32() # case S200 + waveform_handle_ctype = _visatype.ViInt32() # case S220 error_code = self._library.niFgen_CreateWaveformF64(vi_ctype, channel_name_ctype, waveform_size_ctype, waveform_data_array_ctype, None if waveform_handle_ctype is None else (ctypes.pointer(waveform_handle_ctype))) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return int(waveform_handle_ctype.value) @@ -1631,7 +1631,7 @@ def create_waveform_from_file_f64(self, file_name, byte_order): channel_name_ctype = ctypes.create_string_buffer(self._repeated_capability.encode(self._encoding)) # case C010 file_name_ctype = ctypes.create_string_buffer(file_name.encode(self._encoding)) # case C020 byte_order_ctype = _visatype.ViInt32(byte_order.value) # case S130 - waveform_handle_ctype = _visatype.ViInt32() # case S200 + waveform_handle_ctype = _visatype.ViInt32() # case S220 error_code = self._library.niFgen_CreateWaveformFromFileF64(vi_ctype, channel_name_ctype, file_name_ctype, byte_order_ctype, None if waveform_handle_ctype is None else (ctypes.pointer(waveform_handle_ctype))) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return int(waveform_handle_ctype.value) @@ -1695,7 +1695,7 @@ def create_waveform_from_file_i16(self, file_name, byte_order): channel_name_ctype = ctypes.create_string_buffer(self._repeated_capability.encode(self._encoding)) # case C010 file_name_ctype = ctypes.create_string_buffer(file_name.encode(self._encoding)) # case C020 byte_order_ctype = _visatype.ViInt32(byte_order.value) # case S130 - waveform_handle_ctype = _visatype.ViInt32() # case S200 + waveform_handle_ctype = _visatype.ViInt32() # case S220 error_code = self._library.niFgen_CreateWaveformFromFileI16(vi_ctype, channel_name_ctype, file_name_ctype, byte_order_ctype, None if waveform_handle_ctype is None else (ctypes.pointer(waveform_handle_ctype))) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return int(waveform_handle_ctype.value) @@ -1749,7 +1749,7 @@ def _create_waveform_i16_numpy(self, waveform_data_array): channel_name_ctype = ctypes.create_string_buffer(self._repeated_capability.encode(self._encoding)) # case C010 waveform_size_ctype = _visatype.ViInt32(0 if waveform_data_array is None else len(waveform_data_array)) # case S160 waveform_data_array_ctype = get_ctypes_pointer_for_buffer(value=waveform_data_array) # case B510 - waveform_handle_ctype = _visatype.ViInt32() # case S200 + waveform_handle_ctype = _visatype.ViInt32() # case S220 error_code = self._library.niFgen_CreateWaveformI16(vi_ctype, channel_name_ctype, waveform_size_ctype, waveform_data_array_ctype, None if waveform_handle_ctype is None else (ctypes.pointer(waveform_handle_ctype))) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return int(waveform_handle_ctype.value) @@ -1917,7 +1917,7 @@ def _get_attribute_vi_boolean(self, attribute_id): vi_ctype = _visatype.ViSession(self._vi) # case S110 channel_name_ctype = ctypes.create_string_buffer(self._repeated_capability.encode(self._encoding)) # case C010 attribute_id_ctype = _visatype.ViAttr(attribute_id) # case S150 - attribute_value_ctype = _visatype.ViBoolean() # case S200 + attribute_value_ctype = _visatype.ViBoolean() # case S220 error_code = self._library.niFgen_GetAttributeViBoolean(vi_ctype, channel_name_ctype, attribute_id_ctype, None if attribute_value_ctype is None else (ctypes.pointer(attribute_value_ctype))) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return bool(attribute_value_ctype.value) @@ -1955,7 +1955,7 @@ def _get_attribute_vi_int32(self, attribute_id): vi_ctype = _visatype.ViSession(self._vi) # case S110 channel_name_ctype = ctypes.create_string_buffer(self._repeated_capability.encode(self._encoding)) # case C010 attribute_id_ctype = _visatype.ViAttr(attribute_id) # case S150 - attribute_value_ctype = _visatype.ViInt32() # case S200 + attribute_value_ctype = _visatype.ViInt32() # case S220 error_code = self._library.niFgen_GetAttributeViInt32(vi_ctype, channel_name_ctype, attribute_id_ctype, None if attribute_value_ctype is None else (ctypes.pointer(attribute_value_ctype))) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return int(attribute_value_ctype.value) @@ -1995,7 +1995,7 @@ def _get_attribute_vi_real64(self, attribute_id): vi_ctype = _visatype.ViSession(self._vi) # case S110 channel_name_ctype = ctypes.create_string_buffer(self._repeated_capability.encode(self._encoding)) # case C010 attribute_id_ctype = _visatype.ViAttr(attribute_id) # case S150 - attribute_value_ctype = _visatype.ViReal64() # case S200 + attribute_value_ctype = _visatype.ViReal64() # case S220 error_code = self._library.niFgen_GetAttributeViReal64(vi_ctype, channel_name_ctype, attribute_id_ctype, None if attribute_value_ctype is None else (ctypes.pointer(attribute_value_ctype))) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return float(attribute_value_ctype.value) @@ -2087,7 +2087,7 @@ def _get_error(self): ''' vi_ctype = _visatype.ViSession(self._vi) # case S110 - error_code_ctype = _visatype.ViStatus() # case S200 + error_code_ctype = _visatype.ViStatus() # case S220 error_description_buffer_size_ctype = _visatype.ViInt32() # case S170 error_description_ctype = None # case C050 error_code = self._library.niFgen_GetError(vi_ctype, None if error_code_ctype is None else (ctypes.pointer(error_code_ctype)), error_description_buffer_size_ctype, error_description_ctype) @@ -3437,7 +3437,7 @@ def create_advanced_arb_sequence(self, waveform_handles_array, loop_counts_array marker_location_array_ctype = get_ctypes_pointer_for_buffer(value=marker_location_array, library_type=_visatype.ViInt32) # case B550 coerced_markers_array_size = (0 if marker_location_array is None else len(marker_location_array)) # case B560 coerced_markers_array_ctype = get_ctypes_pointer_for_buffer(library_type=_visatype.ViInt32, size=coerced_markers_array_size) # case B560 - sequence_handle_ctype = _visatype.ViInt32() # case S200 + sequence_handle_ctype = _visatype.ViInt32() # case S220 error_code = self._library.niFgen_CreateAdvancedArbSequence(vi_ctype, sequence_length_ctype, waveform_handles_array_ctype, loop_counts_array_ctype, sample_counts_array_ctype, marker_location_array_ctype, coerced_markers_array_ctype, None if sequence_handle_ctype is None else (ctypes.pointer(sequence_handle_ctype))) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return [int(coerced_markers_array_ctype[i]) for i in range((0 if marker_location_array is None else len(marker_location_array)))], int(sequence_handle_ctype.value) @@ -3505,7 +3505,7 @@ def create_arb_sequence(self, waveform_handles_array, loop_counts_array): raise ValueError("Length of loop_counts_array and waveform_handles_array parameters do not match.") # case S160 waveform_handles_array_ctype = get_ctypes_pointer_for_buffer(value=waveform_handles_array, library_type=_visatype.ViInt32) # case B550 loop_counts_array_ctype = get_ctypes_pointer_for_buffer(value=loop_counts_array, library_type=_visatype.ViInt32) # case B550 - sequence_handle_ctype = _visatype.ViInt32() # case S200 + sequence_handle_ctype = _visatype.ViInt32() # case S220 error_code = self._library.niFgen_CreateArbSequence(vi_ctype, sequence_length_ctype, waveform_handles_array_ctype, loop_counts_array_ctype, None if sequence_handle_ctype is None else (ctypes.pointer(sequence_handle_ctype))) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return int(sequence_handle_ctype.value) @@ -3594,7 +3594,7 @@ def create_freq_list(self, waveform, frequency_array, duration_array): raise ValueError("Length of duration_array and frequency_array parameters do not match.") # case S160 frequency_array_ctype = get_ctypes_pointer_for_buffer(value=frequency_array, library_type=_visatype.ViReal64) # case B550 duration_array_ctype = get_ctypes_pointer_for_buffer(value=duration_array, library_type=_visatype.ViReal64) # case B550 - frequency_list_handle_ctype = _visatype.ViInt32() # case S200 + frequency_list_handle_ctype = _visatype.ViInt32() # case S220 error_code = self._library.niFgen_CreateFreqList(vi_ctype, waveform_ctype, frequency_list_length_ctype, frequency_array_ctype, duration_array_ctype, None if frequency_list_handle_ctype is None else (ctypes.pointer(frequency_list_handle_ctype))) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return int(frequency_list_handle_ctype.value) @@ -3634,11 +3634,11 @@ def _get_ext_cal_last_date_and_time(self): ''' vi_ctype = _visatype.ViSession(self._vi) # case S110 - year_ctype = _visatype.ViInt32() # case S200 - month_ctype = _visatype.ViInt32() # case S200 - day_ctype = _visatype.ViInt32() # case S200 - hour_ctype = _visatype.ViInt32() # case S200 - minute_ctype = _visatype.ViInt32() # case S200 + year_ctype = _visatype.ViInt32() # case S220 + month_ctype = _visatype.ViInt32() # case S220 + day_ctype = _visatype.ViInt32() # case S220 + hour_ctype = _visatype.ViInt32() # case S220 + minute_ctype = _visatype.ViInt32() # case S220 error_code = self._library.niFgen_GetExtCalLastDateAndTime(vi_ctype, None if year_ctype is None else (ctypes.pointer(year_ctype)), None if month_ctype is None else (ctypes.pointer(month_ctype)), None if day_ctype is None else (ctypes.pointer(day_ctype)), None if hour_ctype is None else (ctypes.pointer(hour_ctype)), None if minute_ctype is None else (ctypes.pointer(minute_ctype))) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return int(year_ctype.value), int(month_ctype.value), int(day_ctype.value), int(hour_ctype.value), int(minute_ctype.value) @@ -3656,7 +3656,7 @@ def get_ext_cal_last_temp(self): ''' vi_ctype = _visatype.ViSession(self._vi) # case S110 - temperature_ctype = _visatype.ViReal64() # case S200 + temperature_ctype = _visatype.ViReal64() # case S220 error_code = self._library.niFgen_GetExtCalLastTemp(vi_ctype, None if temperature_ctype is None else (ctypes.pointer(temperature_ctype))) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return float(temperature_ctype.value) @@ -3674,7 +3674,7 @@ def get_ext_cal_recommended_interval(self): ''' vi_ctype = _visatype.ViSession(self._vi) # case S110 - months_ctype = _visatype.ViInt32() # case S200 + months_ctype = _visatype.ViInt32() # case S220 error_code = self._library.niFgen_GetExtCalRecommendedInterval(vi_ctype, None if months_ctype is None else (ctypes.pointer(months_ctype))) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return _converters.convert_month_to_timedelta(int(months_ctype.value)) @@ -3707,7 +3707,7 @@ def get_hardware_state(self): ''' vi_ctype = _visatype.ViSession(self._vi) # case S110 - state_ctype = _visatype.ViInt32() # case S200 + state_ctype = _visatype.ViInt32() # case S220 error_code = self._library.niFgen_GetHardwareState(vi_ctype, None if state_ctype is None else (ctypes.pointer(state_ctype))) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return enums.HardwareState(state_ctype.value) @@ -3767,11 +3767,11 @@ def _get_self_cal_last_date_and_time(self): ''' vi_ctype = _visatype.ViSession(self._vi) # case S110 - year_ctype = _visatype.ViInt32() # case S200 - month_ctype = _visatype.ViInt32() # case S200 - day_ctype = _visatype.ViInt32() # case S200 - hour_ctype = _visatype.ViInt32() # case S200 - minute_ctype = _visatype.ViInt32() # case S200 + year_ctype = _visatype.ViInt32() # case S220 + month_ctype = _visatype.ViInt32() # case S220 + day_ctype = _visatype.ViInt32() # case S220 + hour_ctype = _visatype.ViInt32() # case S220 + minute_ctype = _visatype.ViInt32() # case S220 error_code = self._library.niFgen_GetSelfCalLastDateAndTime(vi_ctype, None if year_ctype is None else (ctypes.pointer(year_ctype)), None if month_ctype is None else (ctypes.pointer(month_ctype)), None if day_ctype is None else (ctypes.pointer(day_ctype)), None if hour_ctype is None else (ctypes.pointer(hour_ctype)), None if minute_ctype is None else (ctypes.pointer(minute_ctype))) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return int(year_ctype.value), int(month_ctype.value), int(day_ctype.value), int(hour_ctype.value), int(minute_ctype.value) @@ -3789,7 +3789,7 @@ def get_self_cal_last_temp(self): ''' vi_ctype = _visatype.ViSession(self._vi) # case S110 - temperature_ctype = _visatype.ViReal64() # case S200 + temperature_ctype = _visatype.ViReal64() # case S220 error_code = self._library.niFgen_GetSelfCalLastTemp(vi_ctype, None if temperature_ctype is None else (ctypes.pointer(temperature_ctype))) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return float(temperature_ctype.value) @@ -3813,7 +3813,7 @@ def get_self_cal_supported(self): ''' vi_ctype = _visatype.ViSession(self._vi) # case S110 - self_cal_supported_ctype = _visatype.ViBoolean() # case S200 + self_cal_supported_ctype = _visatype.ViBoolean() # case S220 error_code = self._library.niFgen_GetSelfCalSupported(vi_ctype, None if self_cal_supported_ctype is None else (ctypes.pointer(self_cal_supported_ctype))) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return bool(self_cal_supported_ctype.value) @@ -3950,7 +3950,7 @@ def _initialize_with_channels(self, resource_name, channel_name=None, reset_devi channel_name_ctype = ctypes.create_string_buffer(channel_name.encode(self._encoding)) # case C020 reset_device_ctype = _visatype.ViBoolean(reset_device) # case S150 option_string_ctype = ctypes.create_string_buffer(option_string.encode(self._encoding)) # case C020 - vi_ctype = _visatype.ViSession() # case S200 + vi_ctype = _visatype.ViSession() # case S220 error_code = self._library.niFgen_InitializeWithChannels(resource_name_ctype, channel_name_ctype, reset_device_ctype, option_string_ctype, None if vi_ctype is None else (ctypes.pointer(vi_ctype))) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return int(vi_ctype.value) @@ -3994,7 +3994,7 @@ def is_done(self): ''' vi_ctype = _visatype.ViSession(self._vi) # case S110 - done_ctype = _visatype.ViBoolean() # case S200 + done_ctype = _visatype.ViBoolean() # case S220 error_code = self._library.niFgen_IsDone(vi_ctype, None if done_ctype is None else (ctypes.pointer(done_ctype))) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return bool(done_ctype.value) @@ -4028,10 +4028,10 @@ def query_arb_seq_capabilities(self): ''' vi_ctype = _visatype.ViSession(self._vi) # case S110 - maximum_number_of_sequences_ctype = _visatype.ViInt32() # case S200 - minimum_sequence_length_ctype = _visatype.ViInt32() # case S200 - maximum_sequence_length_ctype = _visatype.ViInt32() # case S200 - maximum_loop_count_ctype = _visatype.ViInt32() # case S200 + maximum_number_of_sequences_ctype = _visatype.ViInt32() # case S220 + minimum_sequence_length_ctype = _visatype.ViInt32() # case S220 + maximum_sequence_length_ctype = _visatype.ViInt32() # case S220 + maximum_loop_count_ctype = _visatype.ViInt32() # case S220 error_code = self._library.niFgen_QueryArbSeqCapabilities(vi_ctype, None if maximum_number_of_sequences_ctype is None else (ctypes.pointer(maximum_number_of_sequences_ctype)), None if minimum_sequence_length_ctype is None else (ctypes.pointer(minimum_sequence_length_ctype)), None if maximum_sequence_length_ctype is None else (ctypes.pointer(maximum_sequence_length_ctype)), None if maximum_loop_count_ctype is None else (ctypes.pointer(maximum_loop_count_ctype))) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return int(maximum_number_of_sequences_ctype.value), int(minimum_sequence_length_ctype.value), int(maximum_sequence_length_ctype.value), int(maximum_loop_count_ctype.value) @@ -4072,10 +4072,10 @@ def query_arb_wfm_capabilities(self): ''' vi_ctype = _visatype.ViSession(self._vi) # case S110 - maximum_number_of_waveforms_ctype = _visatype.ViInt32() # case S200 - waveform_quantum_ctype = _visatype.ViInt32() # case S200 - minimum_waveform_size_ctype = _visatype.ViInt32() # case S200 - maximum_waveform_size_ctype = _visatype.ViInt32() # case S200 + maximum_number_of_waveforms_ctype = _visatype.ViInt32() # case S220 + waveform_quantum_ctype = _visatype.ViInt32() # case S220 + minimum_waveform_size_ctype = _visatype.ViInt32() # case S220 + maximum_waveform_size_ctype = _visatype.ViInt32() # case S220 error_code = self._library.niFgen_QueryArbWfmCapabilities(vi_ctype, None if maximum_number_of_waveforms_ctype is None else (ctypes.pointer(maximum_number_of_waveforms_ctype)), None if waveform_quantum_ctype is None else (ctypes.pointer(waveform_quantum_ctype)), None if minimum_waveform_size_ctype is None else (ctypes.pointer(minimum_waveform_size_ctype)), None if maximum_waveform_size_ctype is None else (ctypes.pointer(maximum_waveform_size_ctype))) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return int(maximum_number_of_waveforms_ctype.value), int(waveform_quantum_ctype.value), int(minimum_waveform_size_ctype.value), int(maximum_waveform_size_ctype.value) @@ -4120,12 +4120,12 @@ def query_freq_list_capabilities(self): ''' vi_ctype = _visatype.ViSession(self._vi) # case S110 - maximum_number_of_freq_lists_ctype = _visatype.ViInt32() # case S200 - minimum_frequency_list_length_ctype = _visatype.ViInt32() # case S200 - maximum_frequency_list_length_ctype = _visatype.ViInt32() # case S200 - minimum_frequency_list_duration_ctype = _visatype.ViReal64() # case S200 - maximum_frequency_list_duration_ctype = _visatype.ViReal64() # case S200 - frequency_list_duration_quantum_ctype = _visatype.ViReal64() # case S200 + maximum_number_of_freq_lists_ctype = _visatype.ViInt32() # case S220 + minimum_frequency_list_length_ctype = _visatype.ViInt32() # case S220 + maximum_frequency_list_length_ctype = _visatype.ViInt32() # case S220 + minimum_frequency_list_duration_ctype = _visatype.ViReal64() # case S220 + maximum_frequency_list_duration_ctype = _visatype.ViReal64() # case S220 + frequency_list_duration_quantum_ctype = _visatype.ViReal64() # case S220 error_code = self._library.niFgen_QueryFreqListCapabilities(vi_ctype, None if maximum_number_of_freq_lists_ctype is None else (ctypes.pointer(maximum_number_of_freq_lists_ctype)), None if minimum_frequency_list_length_ctype is None else (ctypes.pointer(minimum_frequency_list_length_ctype)), None if maximum_frequency_list_length_ctype is None else (ctypes.pointer(maximum_frequency_list_length_ctype)), None if minimum_frequency_list_duration_ctype is None else (ctypes.pointer(minimum_frequency_list_duration_ctype)), None if maximum_frequency_list_duration_ctype is None else (ctypes.pointer(maximum_frequency_list_duration_ctype)), None if frequency_list_duration_quantum_ctype is None else (ctypes.pointer(frequency_list_duration_quantum_ctype))) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return int(maximum_number_of_freq_lists_ctype.value), int(minimum_frequency_list_length_ctype.value), int(maximum_frequency_list_length_ctype.value), float(minimum_frequency_list_duration_ctype.value), float(maximum_frequency_list_duration_ctype.value), float(frequency_list_duration_quantum_ctype.value) @@ -4143,7 +4143,7 @@ def read_current_temperature(self): ''' vi_ctype = _visatype.ViSession(self._vi) # case S110 - temperature_ctype = _visatype.ViReal64() # case S200 + temperature_ctype = _visatype.ViReal64() # case S220 error_code = self._library.niFgen_ReadCurrentTemperature(vi_ctype, None if temperature_ctype is None else (ctypes.pointer(temperature_ctype))) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return float(temperature_ctype.value) @@ -4315,7 +4315,7 @@ def _self_test(self): ''' vi_ctype = _visatype.ViSession(self._vi) # case S110 - self_test_result_ctype = _visatype.ViInt16() # case S200 + self_test_result_ctype = _visatype.ViInt16() # case S220 self_test_message_ctype = (_visatype.ViChar * 256)() # case C070 error_code = self._library.niFgen_self_test(vi_ctype, None if self_test_result_ctype is None else (ctypes.pointer(self_test_result_ctype)), self_test_message_ctype) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) diff --git a/generated/nimodinst/session.py b/generated/nimodinst/session.py index 8a7044bfe..14e9a580a 100644 --- a/generated/nimodinst/session.py +++ b/generated/nimodinst/session.py @@ -294,7 +294,7 @@ def _get_installed_device_attribute_vi_int32(self, index, attribute_id): handle_ctype = _visatype.ViSession(self._handle) # case S110 index_ctype = _visatype.ViInt32(index) # case S150 attribute_id_ctype = _visatype.ViInt32(attribute_id) # case S150 - attribute_value_ctype = _visatype.ViInt32() # case S200 + attribute_value_ctype = _visatype.ViInt32() # case S220 error_code = self._library.niModInst_GetInstalledDeviceAttributeViInt32(handle_ctype, index_ctype, attribute_id_ctype, None if attribute_value_ctype is None else (ctypes.pointer(attribute_value_ctype))) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return int(attribute_value_ctype.value) @@ -379,8 +379,8 @@ def _open_installed_devices_session(self, driver): ''' driver_ctype = ctypes.create_string_buffer(driver.encode(self._encoding)) # case C020 - handle_ctype = _visatype.ViSession() # case S200 - device_count_ctype = _visatype.ViInt32() # case S200 + handle_ctype = _visatype.ViSession() # case S220 + device_count_ctype = _visatype.ViInt32() # case S220 error_code = self._library.niModInst_OpenInstalledDevicesSession(driver_ctype, None if handle_ctype is None else (ctypes.pointer(handle_ctype)), None if device_count_ctype is None else (ctypes.pointer(device_count_ctype))) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return int(handle_ctype.value), int(device_count_ctype.value) diff --git a/generated/niscope/session.py b/generated/niscope/session.py index baa51105e..ee34dc7ec 100644 --- a/generated/niscope/session.py +++ b/generated/niscope/session.py @@ -1638,7 +1638,7 @@ def _actual_meas_wfm_size(self, array_meas_function): raise TypeError('Parameter mode must be of type ' + str(enums._ArrayMeasurement)) vi_ctype = _visatype.ViSession(self._vi) # case S110 array_meas_function_ctype = _visatype.ViInt32(array_meas_function.value) # case S130 - meas_waveform_size_ctype = _visatype.ViInt32() # case S200 + meas_waveform_size_ctype = _visatype.ViInt32() # case S220 error_code = self._library.niScope_ActualMeasWfmSize(vi_ctype, array_meas_function_ctype, None if meas_waveform_size_ctype is None else (ctypes.pointer(meas_waveform_size_ctype))) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return int(meas_waveform_size_ctype.value) @@ -1666,7 +1666,7 @@ def _actual_num_wfms(self): ''' vi_ctype = _visatype.ViSession(self._vi) # case S110 channel_list_ctype = ctypes.create_string_buffer(self._repeated_capability.encode(self._encoding)) # case C010 - num_wfms_ctype = _visatype.ViInt32() # case S200 + num_wfms_ctype = _visatype.ViInt32() # case S220 error_code = self._library.niScope_ActualNumWfms(vi_ctype, channel_list_ctype, None if num_wfms_ctype is None else (ctypes.pointer(num_wfms_ctype))) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return int(num_wfms_ctype.value) @@ -3163,7 +3163,7 @@ def _get_attribute_vi_boolean(self, attribute_id): vi_ctype = _visatype.ViSession(self._vi) # case S110 channel_list_ctype = ctypes.create_string_buffer(self._repeated_capability.encode(self._encoding)) # case C010 attribute_id_ctype = _visatype.ViAttr(attribute_id) # case S150 - value_ctype = _visatype.ViBoolean() # case S200 + value_ctype = _visatype.ViBoolean() # case S220 error_code = self._library.niScope_GetAttributeViBoolean(vi_ctype, channel_list_ctype, attribute_id_ctype, None if value_ctype is None else (ctypes.pointer(value_ctype))) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return bool(value_ctype.value) @@ -3200,7 +3200,7 @@ def _get_attribute_vi_int32(self, attribute_id): vi_ctype = _visatype.ViSession(self._vi) # case S110 channel_list_ctype = ctypes.create_string_buffer(self._repeated_capability.encode(self._encoding)) # case C010 attribute_id_ctype = _visatype.ViAttr(attribute_id) # case S150 - value_ctype = _visatype.ViInt32() # case S200 + value_ctype = _visatype.ViInt32() # case S220 error_code = self._library.niScope_GetAttributeViInt32(vi_ctype, channel_list_ctype, attribute_id_ctype, None if value_ctype is None else (ctypes.pointer(value_ctype))) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return int(value_ctype.value) @@ -3237,7 +3237,7 @@ def _get_attribute_vi_int64(self, attribute_id): vi_ctype = _visatype.ViSession(self._vi) # case S110 channel_list_ctype = ctypes.create_string_buffer(self._repeated_capability.encode(self._encoding)) # case C010 attribute_id_ctype = _visatype.ViAttr(attribute_id) # case S150 - value_ctype = _visatype.ViInt64() # case S200 + value_ctype = _visatype.ViInt64() # case S220 error_code = self._library.niScope_GetAttributeViInt64(vi_ctype, channel_list_ctype, attribute_id_ctype, None if value_ctype is None else (ctypes.pointer(value_ctype))) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return int(value_ctype.value) @@ -3275,7 +3275,7 @@ def _get_attribute_vi_real64(self, attribute_id): vi_ctype = _visatype.ViSession(self._vi) # case S110 channel_list_ctype = ctypes.create_string_buffer(self._repeated_capability.encode(self._encoding)) # case C010 attribute_id_ctype = _visatype.ViAttr(attribute_id) # case S150 - value_ctype = _visatype.ViReal64() # case S200 + value_ctype = _visatype.ViReal64() # case S220 error_code = self._library.niScope_GetAttributeViReal64(vi_ctype, channel_list_ctype, attribute_id_ctype, None if value_ctype is None else (ctypes.pointer(value_ctype))) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return float(value_ctype.value) @@ -3361,7 +3361,7 @@ def _get_equalization_filter_coefficients(self, number_of_coefficients): ''' vi_ctype = _visatype.ViSession(self._vi) # case S110 channel_ctype = ctypes.create_string_buffer(self._repeated_capability.encode(self._encoding)) # case C010 - number_of_coefficients_ctype = _visatype.ViInt32(number_of_coefficients) # case S190 + number_of_coefficients_ctype = _visatype.ViInt32(number_of_coefficients) # case S210 coefficients_size = number_of_coefficients # case B600 coefficients_ctype = get_ctypes_pointer_for_buffer(library_type=_visatype.ViReal64, size=coefficients_size) # case B600 error_code = self._library.niScope_GetEqualizationFilterCoefficients(vi_ctype, channel_ctype, number_of_coefficients_ctype, coefficients_ctype) @@ -3397,7 +3397,7 @@ def _get_error(self): ''' vi_ctype = _visatype.ViSession(self._vi) # case S110 - error_code_ctype = _visatype.ViStatus() # case S200 + error_code_ctype = _visatype.ViStatus() # case S220 buffer_size_ctype = _visatype.ViInt32() # case S170 description_ctype = None # case C050 error_code = self._library.niScope_GetError(vi_ctype, None if error_code_ctype is None else (ctypes.pointer(error_code_ctype)), buffer_size_ctype, description_ctype) @@ -4111,7 +4111,7 @@ def acquisition_status(self): ''' vi_ctype = _visatype.ViSession(self._vi) # case S110 - acquisition_status_ctype = _visatype.ViInt32() # case S200 + acquisition_status_ctype = _visatype.ViInt32() # case S220 error_code = self._library.niScope_AcquisitionStatus(vi_ctype, None if acquisition_status_ctype is None else (ctypes.pointer(acquisition_status_ctype))) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return enums.AcquisitionStatus(acquisition_status_ctype.value) @@ -5005,7 +5005,7 @@ def _init_with_options(self, resource_name, id_query=False, reset_device=False, id_query_ctype = _visatype.ViBoolean(id_query) # case S150 reset_device_ctype = _visatype.ViBoolean(reset_device) # case S150 option_string_ctype = ctypes.create_string_buffer(option_string.encode(self._encoding)) # case C020 - vi_ctype = _visatype.ViSession() # case S200 + vi_ctype = _visatype.ViSession() # case S220 error_code = self._library.niScope_InitWithOptions(resource_name_ctype, id_query_ctype, reset_device_ctype, option_string_ctype, None if vi_ctype is None else (ctypes.pointer(vi_ctype))) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return int(vi_ctype.value) @@ -5182,7 +5182,7 @@ def _self_test(self): ''' vi_ctype = _visatype.ViSession(self._vi) # case S110 - self_test_result_ctype = _visatype.ViInt16() # case S200 + self_test_result_ctype = _visatype.ViInt16() # case S220 self_test_message_ctype = (_visatype.ViChar * 256)() # case C070 error_code = self._library.niScope_self_test(vi_ctype, None if self_test_result_ctype is None else (ctypes.pointer(self_test_result_ctype)), self_test_message_ctype) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) diff --git a/generated/nise/session.py b/generated/nise/session.py index de532a106..84949ff1f 100644 --- a/generated/nise/session.py +++ b/generated/nise/session.py @@ -160,7 +160,7 @@ def _get_error(self, error_description_size=[1024]): ''' vi_ctype = _visatype.ViSession(self._vi) # case S110 - error_number_ctype = _visatype.ViInt32() # case S200 + error_number_ctype = _visatype.ViInt32() # case S220 error_description_ctype = (_visatype.ViChar * error_description_size[0])() # case C080 error_description_size_ctype = get_ctypes_pointer_for_buffer(value=error_description_size, library_type=_visatype.ViInt32) # case B550 error_code = self._library.niSE_GetError(vi_ctype, None if error_number_ctype is None else (ctypes.pointer(error_number_ctype)), error_description_ctype, error_description_size_ctype) @@ -613,7 +613,7 @@ def find_route(self, channel1, channel2, route_spec_size=[1024]): channel2_ctype = ctypes.create_string_buffer(channel2.encode(self._encoding)) # case C020 route_spec_ctype = (_visatype.ViChar * route_spec_size[0])() # case C080 route_spec_size_ctype = get_ctypes_pointer_for_buffer(value=route_spec_size, library_type=_visatype.ViInt32) # case B550 - path_capability_ctype = _visatype.ViInt32() # case S200 + path_capability_ctype = _visatype.ViInt32() # case S220 error_code = self._library.niSE_FindRoute(vi_ctype, channel1_ctype, channel2_ctype, route_spec_ctype, route_spec_size_ctype, None if path_capability_ctype is None else (ctypes.pointer(path_capability_ctype))) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return route_spec_ctype.value.decode(self._encoding), enums.PathCapability(path_capability_ctype.value) @@ -689,7 +689,7 @@ def is_connected(self, route_spec): ''' vi_ctype = _visatype.ViSession(self._vi) # case S110 route_spec_ctype = ctypes.create_string_buffer(route_spec.encode(self._encoding)) # case C020 - is_connected_ctype = _visatype.ViBoolean() # case S200 + is_connected_ctype = _visatype.ViBoolean() # case S220 error_code = self._library.niSE_IsConnected(vi_ctype, route_spec_ctype, None if is_connected_ctype is None else (ctypes.pointer(is_connected_ctype))) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return bool(is_connected_ctype.value) @@ -708,7 +708,7 @@ def is_debounced(self): ''' vi_ctype = _visatype.ViSession(self._vi) # case S110 - is_debounced_ctype = _visatype.ViBoolean() # case S200 + is_debounced_ctype = _visatype.ViBoolean() # case S220 error_code = self._library.niSE_IsDebounced(vi_ctype, None if is_debounced_ctype is None else (ctypes.pointer(is_debounced_ctype))) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return bool(is_debounced_ctype.value) @@ -746,7 +746,7 @@ def _open_session(self, virtual_device_name, option_string=""): ''' virtual_device_name_ctype = ctypes.create_string_buffer(virtual_device_name.encode(self._encoding)) # case C020 option_string_ctype = ctypes.create_string_buffer(option_string.encode(self._encoding)) # case C020 - vi_ctype = _visatype.ViSession() # case S200 + vi_ctype = _visatype.ViSession() # case S220 error_code = self._library.niSE_OpenSession(virtual_device_name_ctype, option_string_ctype, None if vi_ctype is None else (ctypes.pointer(vi_ctype))) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return int(vi_ctype.value) diff --git a/generated/niswitch/session.py b/generated/niswitch/session.py index c7d061336..43d5c18ea 100644 --- a/generated/niswitch/session.py +++ b/generated/niswitch/session.py @@ -646,7 +646,7 @@ def _get_attribute_vi_boolean(self, attribute_id): vi_ctype = _visatype.ViSession(self._vi) # case S110 channel_name_ctype = ctypes.create_string_buffer(self._repeated_capability.encode(self._encoding)) # case C010 attribute_id_ctype = _visatype.ViAttr(attribute_id) # case S150 - attribute_value_ctype = _visatype.ViBoolean() # case S200 + attribute_value_ctype = _visatype.ViBoolean() # case S220 error_code = self._library.niSwitch_GetAttributeViBoolean(vi_ctype, channel_name_ctype, attribute_id_ctype, None if attribute_value_ctype is None else (ctypes.pointer(attribute_value_ctype))) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return bool(attribute_value_ctype.value) @@ -702,7 +702,7 @@ def _get_attribute_vi_int32(self, attribute_id): vi_ctype = _visatype.ViSession(self._vi) # case S110 channel_name_ctype = ctypes.create_string_buffer(self._repeated_capability.encode(self._encoding)) # case C010 attribute_id_ctype = _visatype.ViAttr(attribute_id) # case S150 - attribute_value_ctype = _visatype.ViInt32() # case S200 + attribute_value_ctype = _visatype.ViInt32() # case S220 error_code = self._library.niSwitch_GetAttributeViInt32(vi_ctype, channel_name_ctype, attribute_id_ctype, None if attribute_value_ctype is None else (ctypes.pointer(attribute_value_ctype))) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return int(attribute_value_ctype.value) @@ -758,7 +758,7 @@ def _get_attribute_vi_real64(self, attribute_id): vi_ctype = _visatype.ViSession(self._vi) # case S110 channel_name_ctype = ctypes.create_string_buffer(self._repeated_capability.encode(self._encoding)) # case C010 attribute_id_ctype = _visatype.ViAttr(attribute_id) # case S150 - attribute_value_ctype = _visatype.ViReal64() # case S200 + attribute_value_ctype = _visatype.ViReal64() # case S220 error_code = self._library.niSwitch_GetAttributeViReal64(vi_ctype, channel_name_ctype, attribute_id_ctype, None if attribute_value_ctype is None else (ctypes.pointer(attribute_value_ctype))) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return float(attribute_value_ctype.value) @@ -854,7 +854,7 @@ def _get_error(self): ''' vi_ctype = _visatype.ViSession(self._vi) # case S110 - code_ctype = _visatype.ViStatus() # case S200 + code_ctype = _visatype.ViStatus() # case S220 buffer_size_ctype = _visatype.ViInt32() # case S170 description_ctype = None # case C050 error_code = self._library.niSwitch_GetError(vi_ctype, None if code_ctype is None else (ctypes.pointer(code_ctype)), buffer_size_ctype, description_ctype) @@ -1575,7 +1575,7 @@ def can_connect(self, channel1, channel2): vi_ctype = _visatype.ViSession(self._vi) # case S110 channel1_ctype = ctypes.create_string_buffer(channel1.encode(self._encoding)) # case C020 channel2_ctype = ctypes.create_string_buffer(channel2.encode(self._encoding)) # case C020 - path_capability_ctype = _visatype.ViInt32() # case S200 + path_capability_ctype = _visatype.ViInt32() # case S220 error_code = self._library.niSwitch_CanConnect(vi_ctype, channel1_ctype, channel2_ctype, None if path_capability_ctype is None else (ctypes.pointer(path_capability_ctype))) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return enums.PathCapability(path_capability_ctype.value) @@ -1845,7 +1845,7 @@ def get_relay_count(self, relay_name): ''' vi_ctype = _visatype.ViSession(self._vi) # case S110 relay_name_ctype = ctypes.create_string_buffer(relay_name.encode(self._encoding)) # case C020 - relay_count_ctype = _visatype.ViInt32() # case S200 + relay_count_ctype = _visatype.ViInt32() # case S220 error_code = self._library.niSwitch_GetRelayCount(vi_ctype, relay_name_ctype, None if relay_count_ctype is None else (ctypes.pointer(relay_count_ctype))) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return int(relay_count_ctype.value) @@ -1896,7 +1896,7 @@ def get_relay_position(self, relay_name): ''' vi_ctype = _visatype.ViSession(self._vi) # case S110 relay_name_ctype = ctypes.create_string_buffer(relay_name.encode(self._encoding)) # case C020 - relay_position_ctype = _visatype.ViInt32() # case S200 + relay_position_ctype = _visatype.ViInt32() # case S220 error_code = self._library.niSwitch_GetRelayPosition(vi_ctype, relay_name_ctype, None if relay_position_ctype is None else (ctypes.pointer(relay_position_ctype))) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return enums.RelayPosition(relay_position_ctype.value) @@ -2145,7 +2145,7 @@ def _init_with_topology(self, resource_name, topology="Configured Topology", sim topology_ctype = ctypes.create_string_buffer(topology.encode(self._encoding)) # case C020 simulate_ctype = _visatype.ViBoolean(simulate) # case S150 reset_device_ctype = _visatype.ViBoolean(reset_device) # case S150 - vi_ctype = _visatype.ViSession() # case S200 + vi_ctype = _visatype.ViSession() # case S220 error_code = self._library.niSwitch_InitWithTopology(resource_name_ctype, topology_ctype, simulate_ctype, reset_device_ctype, None if vi_ctype is None else (ctypes.pointer(vi_ctype))) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return int(vi_ctype.value) @@ -2451,7 +2451,7 @@ def _self_test(self): ''' vi_ctype = _visatype.ViSession(self._vi) # case S110 - self_test_result_ctype = _visatype.ViInt16() # case S200 + self_test_result_ctype = _visatype.ViInt16() # case S220 self_test_message_ctype = (_visatype.ViChar * 256)() # case C070 error_code = self._library.niSwitch_self_test(vi_ctype, None if self_test_result_ctype is None else (ctypes.pointer(self_test_result_ctype)), self_test_message_ctype) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) From 4b1082b0fbe411c30659bbff1506e6a33af2e260 Mon Sep 17 00:00:00 2001 From: Mark Silva Date: Wed, 4 Sep 2019 16:33:51 -0500 Subject: [PATCH 39/56] Renumber buffer cases to match order used in code --- build/helper/codegen_helper.py | 72 +++++++++++++++++----------------- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/build/helper/codegen_helper.py b/build/helper/codegen_helper.py index 34173395b..e4efe99c5 100644 --- a/build/helper/codegen_helper.py +++ b/build/helper/codegen_helper.py @@ -339,6 +339,7 @@ def _get_ctype_variable_definition_snippet_for_buffers(parameter, parameters, iv '''These are the different cases for initializing the ctype variable for buffers: B510. Input/output numpy array: get_ctypes_pointer_for_buffer(value=waveform) + B520. Input buffer of simple types with converter: get_ctypes_pointer_for_buffer(value=convert(array.array('d', list)), library_type=visatype.ViReal64) B540. Input buffer (custom type): get_ctypes_pointer_for_buffer(value=[custom_struct(l) for l in list], library_type=custom_struct) B550. Input buffer of simple types: get_ctypes_pointer_for_buffer(value=array.array('d', list), library_type=visatype.ViReal64) B560. Output buffer with mechanism python-code: get_ctypes_pointer_for_buffer(value=array.array('d'), library_type=ViInt32) @@ -348,7 +349,6 @@ def _get_ctype_variable_definition_snippet_for_buffers(parameter, parameters, iv B600. Output buffer with mechanism passed-in: get_ctypes_pointer_for_buffer(value-array.array('d', [0] * buffer_size, library_type=ViInt32) B610. Output buffer with mechanism ivi-dance-with-a-twist, QUERY_SIZE: None B620. Output buffer with mechanism ivi-dance-with-a-twist, GET_DATA: get_ctypes_pointer_for_buffer(value=array.array('d', [0] * buffer_size_ctype.value, library_type=ViInt32) - B630. Input buffer of simple types with converter: get_ctypes_pointer_for_buffer(value=convert(array.array('d', list)), library_type=visatype.ViReal64) Return Value (list): each item in the list will be one line needed for the declaration of that parameter @@ -367,11 +367,11 @@ def _get_ctype_variable_definition_snippet_for_buffers(parameter, parameters, iv else: if parameter['use_array']: # If the incoming type is array.array, we can just use that, otherwise we need to create an array.array that is initialized with the passed in value, which must be iterable - array_declaration = '{0}_array = get_ctypes_and_array(value=_converters.{2}({0}), array_type="{1}") # case B630'.format(parameter['python_name'], get_array_type_for_api_type(parameter['ctypes_type']), parameter['python_api_converter_name']) + array_declaration = '{0}_array = get_ctypes_and_array(value=_converters.{2}({0}), array_type="{1}") # case B520'.format(parameter['python_name'], get_array_type_for_api_type(parameter['ctypes_type']), parameter['python_api_converter_name']) definitions.append(array_declaration) - definition = 'get_ctypes_pointer_for_buffer(value={0}_array, library_type={1}.{2}) # case B630'.format(parameter['python_name'], module_name, parameter['ctypes_type']) + definition = 'get_ctypes_pointer_for_buffer(value={0}_array, library_type={1}.{2}) # case B520'.format(parameter['python_name'], module_name, parameter['ctypes_type']) elif parameter['use_list']: - definition = 'get_ctypes_pointer_for_buffer(value=_converters.{3}({0}), library_type={1}.{2}) # case B630'.format(parameter['python_name'], module_name, parameter['ctypes_type'], parameter['python_api_converter_name']) + definition = 'get_ctypes_pointer_for_buffer(value=_converters.{3}({0}), library_type={1}.{2}) # case B520'.format(parameter['python_name'], module_name, parameter['ctypes_type'], parameter['python_api_converter_name']) else: assert False, "Expected either 'use_array' or 'use_list' to be True. Both False." elif parameter['direction'] == 'in': @@ -1430,6 +1430,38 @@ def test_get_ctype_variable_declaration_snippet_case_b510(): assert snippet == ["output_ctype = get_ctypes_pointer_for_buffer(value=output) # case B510"] +def test_get_ctype_variable_declaration_snippet_case_b520_array(): + actual = get_ctype_variable_declaration_snippet(parameters_for_testing[30], parameters_for_testing, IviDanceStep.NOT_APPLICABLE, config_for_testing, use_numpy_array=False) + expected = [ + 'input_array_3_array = get_ctypes_and_array(value=_converters.convert_to_nitclk_session_num_list(input_array_3), array_type="d") # case B520', + 'input_array_3_ctype = get_ctypes_pointer_for_buffer(value=input_array_3_array, library_type=_visatype.ViReal64) # case B520', + ] + assert len(actual) == len(expected) + for i in range(max(len(actual), len(expected))): + assert actual[i] == expected[i] + + +def test_get_ctype_variable_declaration_snippet_case_b520_list(): + snippet = get_ctype_variable_declaration_snippet(parameters_for_testing[29], parameters_for_testing, IviDanceStep.NOT_APPLICABLE, config_for_testing, use_numpy_array=False) + assert snippet == ["input_array_2_ctype = get_ctypes_pointer_for_buffer(value=_converters.convert_to_nitclk_session_num_list(input_array_2), library_type=_visatype.ViReal64) # case B520"] + + +def test_get_ctype_variable_declaration_snippet_case_b520_custom_type(): + try: + get_ctype_variable_declaration_snippet(parameters_for_testing[31], parameters_for_testing, IviDanceStep.NOT_APPLICABLE, config_for_testing, use_numpy_array=False) + assert False + except AssertionError: + pass + + +def test_get_ctype_variable_declaration_snippet_case_b520_not_array_or_list(): + try: + get_ctype_variable_declaration_snippet(parameters_for_testing[32], parameters_for_testing, IviDanceStep.NOT_APPLICABLE, config_for_testing, use_numpy_array=False) + assert False + except AssertionError: + pass + + def test_get_ctype_variable_declaration_snippet_case_b530(): snippet = get_ctype_variable_declaration_snippet(parameters_for_testing[16], parameters_for_testing, IviDanceStep.NOT_APPLICABLE, config_for_testing, use_numpy_array=False) assert snippet == ["a_string_ctype = ctypes.create_string_buffer(a_string.encode(self._encoding)) # case C020"] @@ -1557,38 +1589,6 @@ def test_get_ctype_variable_declaration_snippet_case_b620_list(): assert actual[i] == expected[i] -def test_get_ctype_variable_declaration_snippet_case_b630_array(): - actual = get_ctype_variable_declaration_snippet(parameters_for_testing[30], parameters_for_testing, IviDanceStep.NOT_APPLICABLE, config_for_testing, use_numpy_array=False) - expected = [ - 'input_array_3_array = get_ctypes_and_array(value=_converters.convert_to_nitclk_session_num_list(input_array_3), array_type="d") # case B630', - 'input_array_3_ctype = get_ctypes_pointer_for_buffer(value=input_array_3_array, library_type=_visatype.ViReal64) # case B630', - ] - assert len(actual) == len(expected) - for i in range(max(len(actual), len(expected))): - assert actual[i] == expected[i] - - -def test_get_ctype_variable_declaration_snippet_case_b630_list(): - snippet = get_ctype_variable_declaration_snippet(parameters_for_testing[29], parameters_for_testing, IviDanceStep.NOT_APPLICABLE, config_for_testing, use_numpy_array=False) - assert snippet == ["input_array_2_ctype = get_ctypes_pointer_for_buffer(value=_converters.convert_to_nitclk_session_num_list(input_array_2), library_type=_visatype.ViReal64) # case B630"] - - -def test_get_ctype_variable_declaration_snippet_case_b630_custom_type(): - try: - get_ctype_variable_declaration_snippet(parameters_for_testing[31], parameters_for_testing, IviDanceStep.NOT_APPLICABLE, config_for_testing, use_numpy_array=False) - assert False - except AssertionError: - pass - - -def test_get_ctype_variable_declaration_snippet_case_b630_not_array_or_list(): - try: - get_ctype_variable_declaration_snippet(parameters_for_testing[32], parameters_for_testing, IviDanceStep.NOT_APPLICABLE, config_for_testing, use_numpy_array=False) - assert False - except AssertionError: - pass - - def test_get_ctype_variable_declaration_snippet_bad_ivi_dance_step(): try: get_ctype_variable_declaration_snippet(parameters_for_testing[12], parameters_for_testing, IviDanceStep.NOT_APPLICABLE, config_for_testing, use_numpy_array=False) From 30bc0ce81493d6c46f9e1b89d706635e3273bcc9 Mon Sep 17 00:00:00 2001 From: Mark Silva Date: Wed, 4 Sep 2019 16:36:11 -0500 Subject: [PATCH 40/56] Move and rename test to match case (C020) --- build/helper/codegen_helper.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/build/helper/codegen_helper.py b/build/helper/codegen_helper.py index e4efe99c5..5de29b0e2 100644 --- a/build/helper/codegen_helper.py +++ b/build/helper/codegen_helper.py @@ -1335,6 +1335,11 @@ def test_get_ctype_variable_declaration_snippet_case_c010(): assert snippet == ["channel_list_ctype = ctypes.create_string_buffer(self._repeated_capability.encode(self._encoding)) # case C010"] +def test_get_ctype_variable_declaration_snippet_case_c020(): + snippet = get_ctype_variable_declaration_snippet(parameters_for_testing[16], parameters_for_testing, IviDanceStep.NOT_APPLICABLE, config_for_testing, use_numpy_array=False) + assert snippet == ["a_string_ctype = ctypes.create_string_buffer(a_string.encode(self._encoding)) # case C020"] + + def test_get_ctype_variable_declaration_snippet_case_c050(): snippet = get_ctype_variable_declaration_snippet(parameters_for_testing[13], parameters_for_testing, IviDanceStep.QUERY_SIZE, config_for_testing, use_numpy_array=False) assert snippet == ["a_string_ctype = None # case C050"] @@ -1462,11 +1467,6 @@ def test_get_ctype_variable_declaration_snippet_case_b520_not_array_or_list(): pass -def test_get_ctype_variable_declaration_snippet_case_b530(): - snippet = get_ctype_variable_declaration_snippet(parameters_for_testing[16], parameters_for_testing, IviDanceStep.NOT_APPLICABLE, config_for_testing, use_numpy_array=False) - assert snippet == ["a_string_ctype = ctypes.create_string_buffer(a_string.encode(self._encoding)) # case C020"] - - def test_get_ctype_variable_declaration_snippet_case_b540(): snippet = get_ctype_variable_declaration_snippet(parameters_for_testing[17], parameters_for_testing, IviDanceStep.NOT_APPLICABLE, config_for_testing, use_numpy_array=False) assert snippet == ["array_in_ctype = get_ctypes_pointer_for_buffer([custom_struct.custom_struct(c) for c in array_in], library_type=custom_struct.custom_struct) # case B540"] From 24bd8470bbcfb9d67de4c161b6ec57317c823093 Mon Sep 17 00:00:00 2001 From: Mark Silva Date: Wed, 4 Sep 2019 16:47:07 -0500 Subject: [PATCH 41/56] Update generated files --- docs/nitclk/class.rst | 6 ------ generated/nitclk/__init__.py | 13 ++++++++++++- generated/nitclk/_attributes.py | 12 ++++++++++++ generated/nitclk/_converters.py | 28 ++++++++++++++++++++++++++++ 4 files changed, 52 insertions(+), 7 deletions(-) diff --git a/docs/nitclk/class.rst b/docs/nitclk/class.rst index 34e50d40e..4dc89edde 100644 --- a/docs/nitclk/class.rst +++ b/docs/nitclk/class.rst @@ -57,8 +57,6 @@ nitclk.Session +----------------------------------------------------+ | :py:func:`initiate` | +----------------------------------------------------+ - | :py:func:`initiate` | - +----------------------------------------------------+ | :py:func:`is_done` | +----------------------------------------------------+ | :py:func:`setup_for_sync_pulse_sender_synchronize` | @@ -691,8 +689,6 @@ initiate - .. note:: This method will return a Python context manager that will initiate on entering and abort on exit. - :param sessions: @@ -945,8 +941,6 @@ Methods +-------------------------------------------------------------------+ | :py:func:`nitclk.Session.initiate` | +-------------------------------------------------------------------+ -| :py:func:`nitclk.Session.initiate` | -+-------------------------------------------------------------------+ | :py:func:`nitclk.Session.is_done` | +-------------------------------------------------------------------+ | :py:func:`nitclk.Session.setup_for_sync_pulse_sender_synchronize` | diff --git a/generated/nitclk/__init__.py b/generated/nitclk/__init__.py index e89737a14..f640a6295 100644 --- a/generated/nitclk/__init__.py +++ b/generated/nitclk/__init__.py @@ -6,7 +6,18 @@ from nitclk.errors import DriverWarning # noqa: F401 from nitclk.errors import Error # noqa: F401 -from nitclk.session import Session # noqa: F401 +from nitclk.session import SessionReference # noqa: F401 + +# Function imports +from nitclk.session import configure_for_homogeneous_triggers # noqa: F401 +from nitclk.session import finish_sync_pulse_sender_synchronize # noqa: F401 +from nitclk.session import init_for_documentation # noqa: F401 +from nitclk.session import initiate # noqa: F401 +from nitclk.session import is_done # noqa: F401 +from nitclk.session import setup_for_sync_pulse_sender_synchronize # noqa: F401 +from nitclk.session import synchronize # noqa: F401 +from nitclk.session import synchronize_to_sync_pulse_sender # noqa: F401 +from nitclk.session import wait_until_done # noqa: F401 def get_diagnostic_information(): diff --git a/generated/nitclk/_attributes.py b/generated/nitclk/_attributes.py index c9bb6426a..24c967dd7 100644 --- a/generated/nitclk/_attributes.py +++ b/generated/nitclk/_attributes.py @@ -109,4 +109,16 @@ def __set__(self, session, value): return self._underlying_attribute.__set__(session, value.value) +# nitclk specific attribute type +class AttributeViInt32SessionReference(Attribute): + + def __get__(self, session, session_type): + # Import here to avoid a circular dependency when initial import happens + from nitclk.session import SessionReference + return SessionReference(session._get_attribute_vi_int32(self._attribute_id)) + + def __set__(self, session, value): + session._set_attribute_vi_int32(self._attribute_id, _converters.convert_to_nitclk_session_num(value)) + + diff --git a/generated/nitclk/_converters.py b/generated/nitclk/_converters.py index 4b1211879..69c09314a 100644 --- a/generated/nitclk/_converters.py +++ b/generated/nitclk/_converters.py @@ -211,6 +211,34 @@ def convert_init_with_options_dictionary(values, encoding): return init_with_options_string +# nitclk specific converters +def convert_to_nitclk_session_num(item): + '''Convert from supported objects to NI-TClk Session Num + + Supported objects are: + - class with .tclk object of type nitclk.SessionReference + - nitclk.SessionReference + - NI-TClk Session Num + ''' + try: + return item.tclk.get_session_number() + except KeyError: + pass + + try: + return item.get_session_number() + except KeyError: + pass + + # If we haven't gotten a SessionReference, we assume the item is the actual nitclk session num and return it + return item + + +def convert_to_nitclk_session_num_list(item_list): + '''Converts a list of items to nitclk session nums''' + return [convert_to_nitclk_session_num(i) for i in item_list] + + # Let's run some tests def test_convert_init_with_options_dictionary(): assert convert_init_with_options_dictionary('', 'ascii') == '' From a65cc127e61e8600835da28ae59324ce2b057264 Mon Sep 17 00:00:00 2001 From: Mark Silva Date: Thu, 5 Sep 2019 10:56:56 -0500 Subject: [PATCH 42/56] Add nitclk specific session template --- src/nitclk/templates/session.py.mako | 217 +++++++++++++++++++++++++++ 1 file changed, 217 insertions(+) create mode 100644 src/nitclk/templates/session.py.mako diff --git a/src/nitclk/templates/session.py.mako b/src/nitclk/templates/session.py.mako new file mode 100644 index 000000000..ef4c1d2b5 --- /dev/null +++ b/src/nitclk/templates/session.py.mako @@ -0,0 +1,217 @@ +# This file was generated +<% + import build.helper as helper + + config = template_parameters['metadata'].config + attributes = helper.filter_codegen_attributes(config['attributes']) + functions = config['functions'] + + module_name = config['module_name'] + c_function_prefix = config['c_function_prefix'] + + functions = helper.filter_codegen_functions(functions) +%>\ + +import array +import ctypes +import datetime +import threading + +% if attributes: +import ${module_name}._attributes as _attributes +% endif +import ${module_name}._converters as _converters +import ${module_name}._library_singleton as _library_singleton +import ${module_name}._visatype as _visatype +import ${module_name}.errors as errors + +# Used for __repr__ and __str__ +import pprint +pp = pprint.PrettyPrinter(indent=4) + +_session_instance = None +_session_instance_lock = threading.Lock() + + +# Helper functions for creating ctypes needed for calling into the driver DLL +def get_ctypes_pointer_for_buffer(value=None, library_type=None, size=None): + if isinstance(value, array.array): + assert library_type is not None, 'library_type is required for array.array' + addr, _ = value.buffer_info() + return ctypes.cast(addr, ctypes.POINTER(library_type)) + elif str(type(value)).find("'numpy.ndarray'") != -1: + import numpy + return numpy.ctypeslib.as_ctypes(value) + elif isinstance(value, list): + assert library_type is not None, 'library_type is required for list' + return (library_type * len(value))(*value) + else: + if library_type is not None and size is not None: + return (library_type * size)() + else: + return None + + +class SessionReference(object): + '''Properties container for NI-TClk attributes.''' + + # This is needed during __init__. Without it, __setattr__ raises an exception + _is_frozen = False + +% for attribute in helper.sorted_attrs(attributes): +<% +helper.add_attribute_rep_cap_tip_docstring(attributes[attribute], config) +%>\ + %if attributes[attribute]['enum']: + ${attributes[attribute]['python_name']} = _attributes.AttributeEnum(_attributes.Attribute${attributes[attribute]['type']}, enums.${enums[attributes[attribute]['enum']]['python_name']}, ${attribute}) + %else: + ${attributes[attribute]['python_name']} = _attributes.${attributes[attribute]['attribute_class']}(${attribute}) + %endif +% if 'documentation' in attributes[attribute] and len(helper.get_documentation_for_node_docstring(attributes[attribute], config, indent=4).strip()) > 0: + '''Type: ${attributes[attribute]['type_in_documentation']} + + ${helper.get_documentation_for_node_docstring(attributes[attribute], config, indent=4)} + ''' +% endif +% endfor + + def __init__(self, ${config['session_handle_parameter_name']}, repeated_capability_list='', encoding='windows-1251'): + self._repeated_capability_list = repeated_capability_list + self._repeated_capability = ','.join(repeated_capability_list) + self._${config['session_handle_parameter_name']} = ${config['session_handle_parameter_name']} + self._library = _library_singleton.get() + self._encoding = encoding + + # Store the parameter list for later printing in __repr__ + param_list = [] + param_list.append("${config['session_handle_parameter_name']}=" + pp.pformat(${config['session_handle_parameter_name']})) + param_list.append("repeated_capability_list=" + pp.pformat(repeated_capability_list)) + param_list.append("encoding=" + pp.pformat(encoding)) + self._param_list = ', '.join(param_list) + + self._is_frozen = True + + def __repr__(self): + return '{0}.{1}({2})'.format('${module_name}', self.__class__.__name__, self._param_list) + + def __setattr__(self, key, value): + if self._is_frozen and key not in dir(self): + raise AttributeError("'{0}' object has no attribute '{1}'".format(type(self).__name__, key)) + object.__setattr__(self, key, value) + + def _get_error_description(self, error_code): + '''_get_error_description + + Returns the error description. + ''' + try: + ''' + It is expected for _get_error to raise when the session is invalid + (IVI spec requires GetError to fail). + Use _error_message instead. It doesn't require a session. + ''' + error_string = self._get_extended_error_info() + return error_string + except errors.Error: + return "Failed to retrieve error description." + + def get_session_number(self): + return self._${config['session_handle_parameter_name']} + +<% +# We need _get_extended_error_info() to exist in both this class as well as the _Session class, so we will +# Set then unset the 'render_in_session_base' flag to get it added to both +functions['GetExtendedErrorInfo']['render_in_session_base'] = True +%>\ +% for func_name in sorted({k: v for k, v in functions.items() if v['render_in_session_base']}): +% for method_template in functions[func_name]['method_templates']: +<%include file="${'/session.py' + method_template['session_filename'] + '.py.mako'}" args="f=functions[func_name], config=config, method_template=method_template" />\ +% endfor +% endfor + +<% +# The main reason for having this class is to allow reusing the default method template. +%>\ +class _Session(object): + '''Hidden class for template reuse''' + + def __init__(self): + '''Hidden class for template reuse''' + self._library = _library_singleton.get() + self._encoding = 'windows-1251' + + # Instantiate any repeated capability objects +% for rep_cap in config['repeated_capabilities']: + self.${rep_cap['python_name']} = _RepeatedCapabilities(self, '${rep_cap["prefix"]}') +% endfor + + # Store the parameter list for later printing in __repr__ + param_list = [] + self._param_list = ', '.join(param_list) + + self._is_frozen = True + + def _get_error_description(self, error_code): + '''_get_error_description + + Returns the error description. + ''' + try: + ''' + It is expected for _get_error to raise when the session is invalid + (IVI spec requires GetError to fail). + Use _error_message instead. It doesn't require a session. + ''' + error_string = self._get_extended_error_info() + return error_string + except errors.Error: + return "Failed to retrieve error description." + + ''' These are code-generated ''' +<% +# We need _get_extended_error_info() to exist in both this class as well as the SessionReference class, so we will +# Set then unset the 'render_in_session_base' flag to get it added to both +functions['GetExtendedErrorInfo']['render_in_session_base'] = False +%>\ +% for func_name in sorted({k: v for k, v in functions.items() if not v['render_in_session_base']}): +% for method_template in functions[func_name]['method_templates']: +<%include file="${'/session.py' + method_template['session_filename'] + '.py.mako'}" args="f=functions[func_name], config=config, method_template=method_template" />\ +% endfor +% endfor + +def _get_session_class(): + '''Internal function to return session singleton''' + global _session_instance + global _session_instance_lock + + with _session_instance_lock: + if _session_instance is None: + _session_instance = _Session() + + return _session_instance + + +<% +# We need _get_extended_error_info() to exist in both this class as well as the _Session class, so we will +# Set then unset the 'render_in_session_base' flag to get it added to both. We do not want it in the standalone +# functions so we set it back to True here to remove it from this list +functions['GetExtendedErrorInfo']['render_in_session_base'] = True +%>\ +% for func_name in sorted({k: v for k, v in functions.items() if not v['render_in_session_base']}): +<% +f = functions[func_name] +name = f['python_name'] +parameter_list = helper.get_params_snippet(f, helper.ParameterUsageOptions.SESSION_METHOD_DECLARATION) +# We remove 'self, ' since we are not part of a class here +parameter_list = parameter_list.replace('self, ', '') +%>\ +def ${name}(${parameter_list}): + '''${name} + + ${helper.get_function_docstring(f, False, config, indent=4)} + ''' + return _get_session_class().${name}(${parameter_list}) + + +% endfor + From 70f9dbbb8e45b65aeb385d69cb12e052ed3e44d1 Mon Sep 17 00:00:00 2001 From: Mark Silva Date: Thu, 5 Sep 2019 10:57:29 -0500 Subject: [PATCH 43/56] No longer need to skip generating session.py --- src/nitclk/nitclk.mak | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/nitclk/nitclk.mak b/src/nitclk/nitclk.mak index 25e6e7a4e..f02daf21c 100644 --- a/src/nitclk/nitclk.mak +++ b/src/nitclk/nitclk.mak @@ -2,9 +2,7 @@ include $(BUILD_HELPER_DIR)/defines.mak -# Eventually we will get back to this as we add/update more templates -# MODULE_FILES_TO_GENERATE := $(filter-out enums.py,$(DEFAULT_PY_FILES_TO_GENERATE)) -MODULE_FILES_TO_GENERATE := $(filter-out session.py enums.py,$(DEFAULT_PY_FILES_TO_GENERATE)) +MODULE_FILES_TO_GENERATE := $(filter-out enums.py,$(DEFAULT_PY_FILES_TO_GENERATE)) MODULE_FILES_TO_COPY := $(DEFAULT_PY_FILES_TO_COPY) From aea6f5082296151c6877feda1b7798f78572c8a8 Mon Sep 17 00:00:00 2001 From: Mark Silva Date: Thu, 5 Sep 2019 10:57:49 -0500 Subject: [PATCH 44/56] Add new session.py --- generated/nitclk/session.py | 1142 +++++++++++++++++++++++++++++++++++ 1 file changed, 1142 insertions(+) create mode 100644 generated/nitclk/session.py diff --git a/generated/nitclk/session.py b/generated/nitclk/session.py new file mode 100644 index 000000000..f7ddc117f --- /dev/null +++ b/generated/nitclk/session.py @@ -0,0 +1,1142 @@ +# This file was generated + +import array +import ctypes +import datetime +import threading + +import nitclk._attributes as _attributes +import nitclk._converters as _converters +import nitclk._library_singleton as _library_singleton +import nitclk._visatype as _visatype +import nitclk.errors as errors + +# Used for __repr__ and __str__ +import pprint +pp = pprint.PrettyPrinter(indent=4) + +_session_instance = None +_session_instance_lock = threading.Lock() + + +# Helper functions for creating ctypes needed for calling into the driver DLL +def get_ctypes_pointer_for_buffer(value=None, library_type=None, size=None): + if isinstance(value, array.array): + assert library_type is not None, 'library_type is required for array.array' + addr, _ = value.buffer_info() + return ctypes.cast(addr, ctypes.POINTER(library_type)) + elif str(type(value)).find("'numpy.ndarray'") != -1: + import numpy + return numpy.ctypeslib.as_ctypes(value) + elif isinstance(value, list): + assert library_type is not None, 'library_type is required for list' + return (library_type * len(value))(*value) + else: + if library_type is not None and size is not None: + return (library_type * size)() + else: + return None + + +class SessionReference(object): + '''Properties container for NI-TClk attributes.''' + + # This is needed during __init__. Without it, __setattr__ raises an exception + _is_frozen = False + + exported_sync_pulse_output_terminal = _attributes.AttributeViString(2) + '''Type: str + + Specifies the destination of the Sync Pulse. This property is most often used when synchronizing a multichassis system. + Values + Empty string. Empty string is a valid value, indicating that the signal is not exported. + PXI Devices - 'PXI_Trig0' through 'PXI_Trig7' and device-specific settings + PCI Devices - 'RTSI_0' through 'RTSI_7' and device-specific settings + Examples of Device-Specific Settings + - NI PXI-5122 supports 'PFI0' and 'PFI1' + - NI PXI-5421 supports 'PFI0', 'PFI1', 'PFI4', and 'PFI5' + - NI PXI-6551/6552 supports 'PFI0', 'PFI1', 'PFI2', and 'PFI3' + Default Value is empty string + ''' + exported_tclk_output_terminal = _attributes.AttributeViString(9) + '''Type: str + + Specifies the destination of the device's TClk signal. + Values + Empty string. Empty string is a valid value, indicating that the signal is not exported. + PXI Devices - 'PXI_Trig0' through 'PXI_Trig7' and device-specific settings + PCI Devices - 'RTSI_0' through 'RTSI_7' and device-specific settings + Examples of Device-Specific Settings + - NI PXI-5122 supports 'PFI0' and 'PFI1' + - NI PXI-5421 supports 'PFI0', 'PFI1', 'PFI4', and 'PFI5' + - NI PXI-6551/6552 supports 'PFI0', 'PFI1', 'PFI2', and 'PFI3' + Default Value is empty string + ''' + pause_trigger_master_session = _attributes.AttributeViInt32SessionReference(6) + '''Type: nimi-python Session class, nitclk.SessionReference, NI-TClk Session Number + + Specifies the pause trigger master session. + For external triggers, the session that originally receives the trigger. For None (no trigger configured) or software triggers, the session that originally generates the trigger. + ''' + ref_trigger_master_session = _attributes.AttributeViInt32SessionReference(4) + '''Type: nimi-python Session class, nitclk.SessionReference, NI-TClk Session Number + + Specifies the reference trigger master session. + For external triggers, the session that originally receives the trigger. For None (no trigger configured) or software triggers, the session that originally generates the trigger. + ''' + sample_clock_delay = _attributes.AttributeViReal64(11) + '''Type: float + + Specifies the sample clock delay. + Specifies the delay, in seconds, to apply to the session sample clock relative to the other synchronized sessions. During synchronization, NI-TClk aligns the sample clocks on the synchronized devices. If you want to delay the sample clocks, set this property before calling synchronize. + not supported for acquisition sessions. + Values - Between minus one and plus one period of the sample clock. + One sample clock period is equal to (1/sample clock rate). For example, for a session with sample rate of 100 MS/s, you can specify sample clock delays between -10.0 ns and +10.0 ns. + Default Value is 0 + + Note: Sample clock delay is supported for generation sessions only; it is + ''' + script_trigger_master_session = _attributes.AttributeViInt32SessionReference(5) + '''Type: nimi-python Session class, nitclk.SessionReference, NI-TClk Session Number + + Specifies the script trigger master session. + For external triggers, the session that originally receives the trigger. For None (no trigger configured) or software triggers, the session that originally generates the trigger. + ''' + sequencer_flag_master_session = _attributes.AttributeViInt32SessionReference(16) + '''Type: nimi-python Session class, nitclk.SessionReference, NI-TClk Session Number + + Specifies the sequencer flag master session. + For external triggers, the session that originally receives the trigger. + For None (no trigger configured) or software triggers, the session that + originally generates the trigger. + ''' + start_trigger_master_session = _attributes.AttributeViInt32SessionReference(3) + '''Type: nimi-python Session class, nitclk.SessionReference, NI-TClk Session Number + + Specifies the start trigger master session. + For external triggers, the session that originally receives the trigger. For None (no trigger configured) or software triggers, the session that originally generates the trigger. + ''' + sync_pulse_clock_source = _attributes.AttributeViString(10) + '''Type: str + + Specifies the Sync Pulse Clock source. This property is typically used to synchronize PCI devices when you want to control RTSI 7 yourself. Make sure that a 10 MHz clock is driven onto RTSI 7. + Values + PCI Devices - 'RTSI_7' and 'None' + PXI Devices - 'PXI_CLK10' and 'None' + Default Value - 'None' directs synchronize to create the necessary routes. For PCI, one of the synchronized devices drives a 10 MHz clock on RTSI 7 unless that line is already being driven. + ''' + sync_pulse_sender_sync_pulse_source = _attributes.AttributeViString(13) + '''Type: str + + Specifies the external sync pulse source for the Sync Pulse Sender. You can use this source to synchronize the Sync Pulse Sender with an external non-TClk source. + Values + Empty string. Empty string is a valid value, indicating that the signal is not exported. + PXI Devices - 'PXI_Trig0' through 'PXI_Trig7' and device-specific settings + PCI Devices - 'RTSI_0' through 'RTSI_7' and device-specific settings + Examples of Device-Specific Settings + - NI PXI-5122 supports 'PFI0' and 'PFI1' + - NI PXI-5421 supports 'PFI0', 'PFI1', 'PFI4', and 'PFI5' + - NI PXI-6551/6552 supports 'PFI0', 'PFI1', 'PFI2', and 'PFI3' + Default Value is empty string + ''' + sync_pulse_source = _attributes.AttributeViString(1) + '''Type: str + + Specifies the Sync Pulse source. This property is most often used when synchronizing a multichassis system. + Values + Empty string + PXI Devices - 'PXI_Trig0' through 'PXI_Trig7' and device-specific settings + PCI Devices - 'RTSI_0' through 'RTSI_7' and device-specific settings + Examples of Device-Specific Settings + - NI PXI-5122 supports 'PFI0' and 'PFI1' + - NI PXI-5421 supports 'PFI0', 'PFI1', 'PFI2', and 'PFI3' + - NI PXI-6551/6552 supports 'PFI0', 'PFI1', 'PFI2', and 'PFI3' + Default Value - Empty string. This default value directs synchronize to set this property when all the synchronized devices are in one PXI chassis. To synchronize a multichassis system, you must set this property before calling synchronize. + ''' + tclk_actual_period = _attributes.AttributeViReal64(8) + '''Type: float + + Indicates the computed TClk period that will be used during the acquisition. + ''' + + def __init__(self, session, repeated_capability_list='', encoding='windows-1251'): + self._repeated_capability_list = repeated_capability_list + self._repeated_capability = ','.join(repeated_capability_list) + self._session = session + self._library = _library_singleton.get() + self._encoding = encoding + + # Store the parameter list for later printing in __repr__ + param_list = [] + param_list.append("session=" + pp.pformat(session)) + param_list.append("repeated_capability_list=" + pp.pformat(repeated_capability_list)) + param_list.append("encoding=" + pp.pformat(encoding)) + self._param_list = ', '.join(param_list) + + self._is_frozen = True + + def __repr__(self): + return '{0}.{1}({2})'.format('nitclk', self.__class__.__name__, self._param_list) + + def __setattr__(self, key, value): + if self._is_frozen and key not in dir(self): + raise AttributeError("'{0}' object has no attribute '{1}'".format(type(self).__name__, key)) + object.__setattr__(self, key, value) + + def _get_error_description(self, error_code): + '''_get_error_description + + Returns the error description. + ''' + try: + ''' + It is expected for _get_error to raise when the session is invalid + (IVI spec requires GetError to fail). + Use _error_message instead. It doesn't require a session. + ''' + error_string = self._get_extended_error_info() + return error_string + except errors.Error: + return "Failed to retrieve error description." + + def get_session_number(self): + return self._session + + def _get_attribute_vi_boolean(self, attribute_id): + r'''_get_attribute_vi_boolean + + TBD + + Tip: + This method requires repeated capabilities (channels). If called directly on the + nitclk.Session object, then the method will use all repeated capabilities in the session. + You can specify a subset of repeated capabilities using the Python index notation on an + nitclk.Session repeated capabilities container, and calling this method on the result.: + + session.channels[0,1]._get_attribute_vi_boolean(attribute_id) + + Args: + attribute_id (int): + + + Returns: + value (bool): + + ''' + session_ctype = _visatype.ViSession(self._session) # case S110 + channel_name_ctype = ctypes.create_string_buffer(self._repeated_capability.encode(self._encoding)) # case C010 + attribute_id_ctype = _visatype.ViAttr(attribute_id) # case S150 + value_ctype = _visatype.ViBoolean() # case S220 + error_code = self._library.niTClk_GetAttributeViBoolean(session_ctype, channel_name_ctype, attribute_id_ctype, None if value_ctype is None else (ctypes.pointer(value_ctype))) + errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) + return bool(value_ctype.value) + + def _get_attribute_vi_real64(self, attribute_id): + r'''_get_attribute_vi_real64 + + Gets the value of an NI-TClk ViReal64 property. + + Tip: + This method requires repeated capabilities (channels). If called directly on the + nitclk.Session object, then the method will use all repeated capabilities in the session. + You can specify a subset of repeated capabilities using the Python index notation on an + nitclk.Session repeated capabilities container, and calling this method on the result.: + + session.channels[0,1]._get_attribute_vi_real64(attribute_id) + + Args: + attribute_id (int): The ID of the property that you want to get Supported Property + sample_clock_delay + + + Returns: + value (float): The value that you are getting + + ''' + session_ctype = _visatype.ViSession(self._session) # case S110 + channel_name_ctype = ctypes.create_string_buffer(self._repeated_capability.encode(self._encoding)) # case C010 + attribute_id_ctype = _visatype.ViAttr(attribute_id) # case S150 + value_ctype = _visatype.ViReal64() # case S220 + error_code = self._library.niTClk_GetAttributeViReal64(session_ctype, channel_name_ctype, attribute_id_ctype, None if value_ctype is None else (ctypes.pointer(value_ctype))) + errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) + return float(value_ctype.value) + + def _get_attribute_vi_session(self, attribute_id): + r'''_get_attribute_vi_session + + Gets the value of an NI-TClk ViSession property. + + Tip: + This method requires repeated capabilities (channels). If called directly on the + nitclk.Session object, then the method will use all repeated capabilities in the session. + You can specify a subset of repeated capabilities using the Python index notation on an + nitclk.Session repeated capabilities container, and calling this method on the result.: + + session.channels[0,1]._get_attribute_vi_session(attribute_id) + + Args: + attribute_id (int): The ID of the property that you want to set Supported Properties + start_trigger_master_session + ref_trigger_master_session + script_trigger_master_session + pause_trigger_master_session + + + Returns: + value (int): The value that you are getting + + ''' + session_ctype = _visatype.ViSession(self._session) # case S110 + channel_name_ctype = ctypes.create_string_buffer(self._repeated_capability.encode(self._encoding)) # case C010 + attribute_id_ctype = _visatype.ViAttr(attribute_id) # case S150 + value_ctype = _visatype.ViSession() # case S220 + error_code = self._library.niTClk_GetAttributeViSession(session_ctype, channel_name_ctype, attribute_id_ctype, None if value_ctype is None else (ctypes.pointer(value_ctype))) + errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) + return int(value_ctype.value) + + def _get_attribute_vi_string(self, attribute_id, buf_size, value): + r'''_get_attribute_vi_string + + This method queries the value of an NI-TClk ViString property. You + must provide a ViChar array to serve as a buffer for the value. You pass + the number of bytes in the buffer as bufSize. If the current value of + the property, including the terminating NULL byte, is larger than the + size you indicate in bufSize, the method copies bufSize minus 1 bytes + into the buffer, places an ASCII NULL byte at the end of the buffer, and + returns the array size that you must pass to get the entire value. For + example, if the value is "123456" and bufSize is 4, the method places + "123" into the buffer and returns 7. If you want to call + _get_attribute_vi_string just to get the required array size, pass 0 + for bufSize and VI_NULL for the value. + + Tip: + This method requires repeated capabilities (channels). If called directly on the + nitclk.Session object, then the method will use all repeated capabilities in the session. + You can specify a subset of repeated capabilities using the Python index notation on an + nitclk.Session repeated capabilities container, and calling this method on the result.: + + session.channels[0,1]._get_attribute_vi_string(attribute_id, buf_size, value) + + Args: + attribute_id (int): The ID of the property that you want to get Supported Properties + sync_pulse_source + sync_pulse_clock_source + exported_sync_pulse_output_terminal + + buf_size (int): The number of bytes in the ViChar array that you specify for the value + parameter + + value (str): The value that you are getting + + ''' + session_ctype = _visatype.ViSession(self._session) # case S110 + channel_name_ctype = ctypes.create_string_buffer(self._repeated_capability.encode(self._encoding)) # case C010 + attribute_id_ctype = _visatype.ViAttr(attribute_id) # case S150 + buf_size_ctype = _visatype.ViInt32(buf_size) # case S150 + value_ctype = ctypes.create_string_buffer(value.encode(self._encoding)) # case C020 + error_code = self._library.niTClk_GetAttributeViString(session_ctype, channel_name_ctype, attribute_id_ctype, buf_size_ctype, value_ctype) + errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) + return + + def _get_extended_error_info(self): + r'''_get_extended_error_info + + Reports extended error information for the most recent NI-TClk method + that returned an error. To establish the method that returned an + error, use the return values of the individual methods because once + _get_extended_error_info reports an errorString, it does not report + an empty string again. + ''' + error_string_ctype = None # case C050 + error_string_size_ctype = _visatype.ViUInt32() # case S170 + error_code = self._library.niTClk_GetExtendedErrorInfo(error_string_ctype, error_string_size_ctype) + errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=True) + error_string_size_ctype = _visatype.ViUInt32(error_code) # case S180 + error_string_ctype = (_visatype.ViChar * error_string_size_ctype.value)() # case C060 + error_code = self._library.niTClk_GetExtendedErrorInfo(error_string_ctype, error_string_size_ctype) + errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=True) + return error_string_ctype.value.decode(self._encoding) + + def _set_attribute_vi_boolean(self, attribute_id, value): + r'''_set_attribute_vi_boolean + + TBD + + Tip: + This method requires repeated capabilities (channels). If called directly on the + nitclk.Session object, then the method will use all repeated capabilities in the session. + You can specify a subset of repeated capabilities using the Python index notation on an + nitclk.Session repeated capabilities container, and calling this method on the result.: + + session.channels[0,1]._set_attribute_vi_boolean(attribute_id, value) + + Args: + attribute_id (int): + + value (bool): + + ''' + session_ctype = _visatype.ViSession(self._session) # case S110 + channel_name_ctype = ctypes.create_string_buffer(self._repeated_capability.encode(self._encoding)) # case C010 + attribute_id_ctype = _visatype.ViAttr(attribute_id) # case S150 + value_ctype = _visatype.ViBoolean(value) # case S150 + error_code = self._library.niTClk_SetAttributeViBoolean(session_ctype, channel_name_ctype, attribute_id_ctype, value_ctype) + errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) + return + + def _set_attribute_vi_real64(self, attribute_id, value): + r'''_set_attribute_vi_real64 + + Sets the value of an NI-TClk VIReal64 property. + _set_attribute_vi_real64 is a low-level method that you can use to + set the values NI-TClk properties. NI-TClk contains high-level methods + that set most of the properties. It is best to use the high-level + methods as much as possible. + + Tip: + This method requires repeated capabilities (channels). If called directly on the + nitclk.Session object, then the method will use all repeated capabilities in the session. + You can specify a subset of repeated capabilities using the Python index notation on an + nitclk.Session repeated capabilities container, and calling this method on the result.: + + session.channels[0,1]._set_attribute_vi_real64(attribute_id, value) + + Args: + attribute_id (int): The ID of the property that you want to set Supported Property + sample_clock_delay + + value (float): The value for the property + + ''' + session_ctype = _visatype.ViSession(self._session) # case S110 + channel_name_ctype = ctypes.create_string_buffer(self._repeated_capability.encode(self._encoding)) # case C010 + attribute_id_ctype = _visatype.ViAttr(attribute_id) # case S150 + value_ctype = _visatype.ViReal64(value) # case S150 + error_code = self._library.niTClk_SetAttributeViReal64(session_ctype, channel_name_ctype, attribute_id_ctype, value_ctype) + errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) + return + + def _set_attribute_vi_session(self, attribute_id): + r'''_set_attribute_vi_session + + Sets the value of an NI-TClk ViSession property. + _set_attribute_vi_session is a low-level method that you can use + to set the values NI-TClk properties. NI-TClk contains high-level + methods that set most of the properties. It is best to use the + high-level methods as much as possible. + + Tip: + This method requires repeated capabilities (channels). If called directly on the + nitclk.Session object, then the method will use all repeated capabilities in the session. + You can specify a subset of repeated capabilities using the Python index notation on an + nitclk.Session repeated capabilities container, and calling this method on the result.: + + session.channels[0,1]._set_attribute_vi_session(attribute_id) + + Args: + attribute_id (int): The ID of the property that you want to set Supported Properties + start_trigger_master_session + ref_trigger_master_session + script_trigger_master_session + pause_trigger_master_session + + ''' + session_ctype = _visatype.ViSession(self._session) # case S110 + channel_name_ctype = ctypes.create_string_buffer(self._repeated_capability.encode(self._encoding)) # case C010 + attribute_id_ctype = _visatype.ViAttr(attribute_id) # case S150 + value_ctype = _visatype.ViSession(self._value) # case S110 + error_code = self._library.niTClk_SetAttributeViSession(session_ctype, channel_name_ctype, attribute_id_ctype, value_ctype) + errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) + return + + def _set_attribute_vi_string(self, attribute_id, value): + r'''_set_attribute_vi_string + + Sets the value of an NI-TClk VIString property. + _set_attribute_vi_string is a low-level method that you can use to + set the values of NI-TClk properties. NI-TClk contain high-level + methods that set most of the properties. It is best to use the + high-level methods as much as possible. + + Tip: + This method requires repeated capabilities (channels). If called directly on the + nitclk.Session object, then the method will use all repeated capabilities in the session. + You can specify a subset of repeated capabilities using the Python index notation on an + nitclk.Session repeated capabilities container, and calling this method on the result.: + + session.channels[0,1]._set_attribute_vi_string(attribute_id, value) + + Args: + attribute_id (int): Pass the ID of the property that you want to set Supported Properties + sync_pulse_source + sync_pulse_clock_source + exported_sync_pulse_output_terminal + + value (str): Pass the value for the property + + ''' + session_ctype = _visatype.ViSession(self._session) # case S110 + channel_name_ctype = ctypes.create_string_buffer(self._repeated_capability.encode(self._encoding)) # case C010 + attribute_id_ctype = _visatype.ViAttr(attribute_id) # case S150 + value_ctype = ctypes.create_string_buffer(value.encode(self._encoding)) # case C020 + error_code = self._library.niTClk_SetAttributeViString(session_ctype, channel_name_ctype, attribute_id_ctype, value_ctype) + errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) + return + + +class _Session(object): + '''Hidden class for template reuse''' + + def __init__(self): + '''Hidden class for template reuse''' + self._library = _library_singleton.get() + self._encoding = 'windows-1251' + + # Instantiate any repeated capability objects + + # Store the parameter list for later printing in __repr__ + param_list = [] + self._param_list = ', '.join(param_list) + + self._is_frozen = True + + def _get_error_description(self, error_code): + '''_get_error_description + + Returns the error description. + ''' + try: + ''' + It is expected for _get_error to raise when the session is invalid + (IVI spec requires GetError to fail). + Use _error_message instead. It doesn't require a session. + ''' + error_string = self._get_extended_error_info() + return error_string + except errors.Error: + return "Failed to retrieve error description." + + ''' These are code-generated ''' + def configure_for_homogeneous_triggers(self, sessions): + r'''configure_for_homogeneous_triggers + + Configures the properties commonly required for the TClk synchronization + of device sessions with homogeneous triggers in a single PXI chassis or + a single PC. Use configure_for_homogeneous_triggers to configure + the properties for the reference clocks, start triggers, reference + triggers, script triggers, and pause triggers. If + configure_for_homogeneous_triggers cannot perform all the steps + appropriate for the given sessions, it returns an error. If an error is + returned, use the instrument driver methods and properties for signal + routing, along with the following NI-TClk properties: + start_trigger_master_session + ref_trigger_master_session + script_trigger_master_session + pause_trigger_master_session + configure_for_homogeneous_triggers affects the following clocks and + triggers: - Reference clocks - Start triggers - Reference triggers - + Script triggers - Pause triggers Reference Clocks + configure_for_homogeneous_triggers configures the reference clocks + if they are needed. Specifically, if the internal sample clocks or + internal sample clock timebases are used, and the reference clock source + is not configured--or is set to None (no trigger + configured)--configure_for_homogeneous_triggers configures the + following: PXI--The reference clock source on all devices is set to be + the 10 MHz PXI backplane clock (PXI_CLK10). PCI--One of the devices + exports its 10 MHz onboard reference clock to RTSI 7. The reference + clock source on all devices is set to be RTSI 7. Note: If the reference + clock source is set to a value other than None, + configure_for_homogeneous_triggers cannot configure the reference + clock source. Start Triggers If the start trigger is set to None (no + trigger configured) for all sessions, the sessions are configured to + share the start trigger. The start trigger is shared by: - Implicitly + exporting the start trigger from one session - Configuring the other + sessions for digital edge start triggers with sources corresponding to + the exported start trigger - Setting + start_trigger_master_session to the session that is + exporting the trigger for all sessions If the start triggers are None + for all except one session, configure_for_homogeneous_triggers + configures the sessions to share the start trigger from the one excepted + session. The start trigger is shared by: - Implicitly exporting start + trigger from the session with the start trigger that is not None - + Configuring the other sessions for digital-edge start triggers with + sources corresponding to the exported start trigger - Setting + start_trigger_master_session to the session that is + exporting the trigger for all sessions If start triggers are configured + for all sessions, configure_for_homogeneous_triggers does not + affect the start triggers. Start triggers are considered to be + configured for all sessions if either of the following conditions is + true: - No session has a start trigger that is None - One session has a + start trigger that is None, and all other sessions have start triggers + other than None. The one session with the None trigger must have + start_trigger_master_session set to itself, indicating + that the session itself is the start trigger master Reference Triggers + configure_for_homogeneous_triggers configures sessions that support + reference triggers to share the reference triggers if the reference + triggers are None (no trigger configured) for all except one session. + The reference triggers are shared by: - Implicitly exporting the + reference trigger from the session whose reference trigger is not None - + Configuring the other sessions that support the reference trigger for + digital-edge reference triggers with sources corresponding to the + exported reference trigger - Setting + ref_trigger_master_session to the session that is + exporting the trigger for all sessions that support reference trigger If + the reference triggers are configured for all sessions that support + reference triggers, configure_for_homogeneous_triggers does not + affect the reference triggers. Reference triggers are considered to be + configured for all sessions if either one or the other of the following + conditions is true: - No session has a reference trigger that is None - + One session has a reference trigger that is None, and all other sessions + have reference triggers other than None. The one session with the None + trigger must have ref_trigger_master_session set to + itself, indicating that the session itself is the reference trigger + master Reference Trigger Holdoffs Acquisition sessions may be configured + with the reference trigger. For acquisition sessions, when the reference + trigger is shared, configure_for_homogeneous_triggers configures + the holdoff properties (which are instrument driver specific) on the + reference trigger master session so that the session does not recognize + the reference trigger before the other sessions are ready. This + condition is only relevant when the sample clock rates, sample clock + timebase rates, sample counts, holdoffs, and/or any delays for the + acquisitions are different. When the sample clock rates, sample clock + timebase rates, and/or the sample counts are different in acquisition + sessions sharing the reference trigger, you should also set the holdoff + properties for the reference trigger master using the instrument driver. + Script Triggers configure_for_homogeneous_triggers configures + sessions that support script triggers to share them, if the script + triggers are None (no trigger configured) for all except one session. + The script triggers are shared in the following ways: - Implicitly + exporting the script trigger from the session whose script trigger is + not None - Configuring the other sessions that support the script + trigger for digital-edge script triggers with sources corresponding to + the exported script trigger - Setting + script_trigger_master_session to the session that is + exporting the trigger for all sessions that support script triggers If + the script triggers are configured for all sessions that support script + triggers, configure_for_homogeneous_triggers does not affect script + triggers. Script triggers are considered to be configured for all + sessions if either one or the other of the following conditions are + true: - No session has a script trigger that is None - One session has a + script trigger that is None and all other sessions have script triggers + other than None. The one session with the None trigger must have + script_trigger_master_session set to itself, indicating + that the session itself is the script trigger master Pause Triggers + configure_for_homogeneous_triggers configures generation sessions + that support pause triggers to share them, if the pause triggers are + None (no trigger configured) for all except one session. The pause + triggers are shared by: - Implicitly exporting the pause trigger from + the session whose script trigger is not None - Configuring the other + sessions that support the pause trigger for digital-edge pause triggers + with sources corresponding to the exported pause trigger - Setting + pause_trigger_master_session to the session that is + exporting the trigger for all sessions that support script triggers If + the pause triggers are configured for all generation sessions that + support pause triggers, configure_for_homogeneous_triggers does not + affect pause triggers. Pause triggers are considered to be configured + for all sessions if either one or the other of the following conditions + is true: - No session has a pause trigger that is None - One session has + a pause trigger that is None and all other sessions have pause triggers + other than None. The one session with the None trigger must have + pause_trigger_master_session set to itself, indicating + that the session itself is the pause trigger master Note: TClk + synchronization is not supported for pause triggers on acquisition + sessions. + + Args: + sessions (list of int): sessions is an array of sessions that are being synchronized. + + ''' + session_count_ctype = _visatype.ViUInt32(0 if sessions is None else len(sessions)) # case S160 + sessions_ctype = get_ctypes_pointer_for_buffer(value=_converters.convert_to_nitclk_session_num_list(sessions), library_type=_visatype.ViSession) # case B520 + error_code = self._library.niTClk_ConfigureForHomogeneousTriggers(session_count_ctype, sessions_ctype) + errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) + return + + def finish_sync_pulse_sender_synchronize(self, sessions, min_time): + r'''finish_sync_pulse_sender_synchronize + + TBD + + Args: + sessions (list of int): sessions is an array of sessions that are being synchronized. + + min_time (float): Minimal period of TClk, expressed in seconds. Supported values are + between 0.0 s and 0.050 s (50 ms). Minimal period for a single + chassis/PC is 200 ns. If the specified value is less than 200 ns, + NI-TClk automatically coerces minTime to 200 ns. For multichassis + synchronization, adjust this value to account for propagation delays + through the various devices and cables. + + ''' + session_count_ctype = _visatype.ViUInt32(0 if sessions is None else len(sessions)) # case S160 + sessions_ctype = get_ctypes_pointer_for_buffer(value=_converters.convert_to_nitclk_session_num_list(sessions), library_type=_visatype.ViSession) # case B520 + min_time_ctype = _visatype.ViReal64(min_time) # case S150 + error_code = self._library.niTClk_FinishSyncPulseSenderSynchronize(session_count_ctype, sessions_ctype, min_time_ctype) + errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) + return + + def _get_extended_error_info(self): + r'''_get_extended_error_info + + Reports extended error information for the most recent NI-TClk method + that returned an error. To establish the method that returned an + error, use the return values of the individual methods because once + _get_extended_error_info reports an errorString, it does not report + an empty string again. + ''' + error_string_ctype = None # case C050 + error_string_size_ctype = _visatype.ViUInt32() # case S170 + error_code = self._library.niTClk_GetExtendedErrorInfo(error_string_ctype, error_string_size_ctype) + errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=True) + error_string_size_ctype = _visatype.ViUInt32(error_code) # case S180 + error_string_ctype = (_visatype.ViChar * error_string_size_ctype.value)() # case C060 + error_code = self._library.niTClk_GetExtendedErrorInfo(error_string_ctype, error_string_size_ctype) + errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=True) + return error_string_ctype.value.decode(self._encoding) + + def init_for_documentation(self): + r'''init_for_documentation + + TBD + ''' + session_list_ctype = _visatype.ViSession(self._session_list) # case S110 + error_code = self._library.niTClk_InitForDocumentation(session_list_ctype) + errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) + return + + def initiate(self, sessions): + r'''initiate + + Initiates the acquisition or generation sessions specified, taking into + consideration any special requirements needed for synchronization. For + example, the session exporting the TClk-synchronized start trigger is + not initiated until after initiate initiates all the sessions + that import the TClk-synchronized start trigger. + + Args: + sessions (list of int): sessions is an array of sessions that are being synchronized. + + ''' + session_count_ctype = _visatype.ViUInt32(0 if sessions is None else len(sessions)) # case S160 + sessions_ctype = get_ctypes_pointer_for_buffer(value=_converters.convert_to_nitclk_session_num_list(sessions), library_type=_visatype.ViSession) # case B520 + error_code = self._library.niTClk_Initiate(session_count_ctype, sessions_ctype) + errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) + return + + def is_done(self, sessions): + r'''is_done + + Monitors the progress of the acquisitions and/or generations + corresponding to sessions. + + Args: + sessions (list of int): sessions is an array of sessions that are being synchronized. + + + Returns: + done (bool): Indicates that the operation is done. The operation is done when each + session has completed without any errors or when any one of the sessions + reports an error. + + ''' + session_count_ctype = _visatype.ViUInt32(0 if sessions is None else len(sessions)) # case S160 + sessions_ctype = get_ctypes_pointer_for_buffer(value=_converters.convert_to_nitclk_session_num_list(sessions), library_type=_visatype.ViSession) # case B520 + done_ctype = _visatype.ViBoolean() # case S220 + error_code = self._library.niTClk_IsDone(session_count_ctype, sessions_ctype, None if done_ctype is None else (ctypes.pointer(done_ctype))) + errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) + return bool(done_ctype.value) + + def setup_for_sync_pulse_sender_synchronize(self, sessions, min_time): + r'''setup_for_sync_pulse_sender_synchronize + + TBD + + Args: + sessions (list of int): sessions is an array of sessions that are being synchronized. + + min_time (float): Minimal period of TClk, expressed in seconds. Supported values are + between 0.0 s and 0.050 s (50 ms). Minimal period for a single + chassis/PC is 200 ns. If the specified value is less than 200 ns, + NI-TClk automatically coerces minTime to 200 ns. For multichassis + synchronization, adjust this value to account for propagation delays + through the various devices and cables. + + ''' + session_count_ctype = _visatype.ViUInt32(0 if sessions is None else len(sessions)) # case S160 + sessions_ctype = get_ctypes_pointer_for_buffer(value=_converters.convert_to_nitclk_session_num_list(sessions), library_type=_visatype.ViSession) # case B520 + min_time_ctype = _visatype.ViReal64(min_time) # case S150 + error_code = self._library.niTClk_SetupForSyncPulseSenderSynchronize(session_count_ctype, sessions_ctype, min_time_ctype) + errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) + return + + def synchronize(self, sessions, min_tclk_period=datetime.timedelta(seconds=0.0)): + r'''synchronize + + Synchronizes the TClk signals on the given sessions. After + synchronize executes, TClk signals from all sessions are + synchronized. Note: Before using this NI-TClk method, verify that your + system is configured as specified in the PXI Trigger Lines and RTSI + Lines topic of the NI-TClk Synchronization Help. You can locate this + help file at Start>>Programs>>National Instruments>>NI-TClk. + + Args: + sessions (list of int): sessions is an array of sessions that are being synchronized. + + min_tclk_period (float in seconds or datetime.timedelta): Minimal period of TClk, expressed in seconds. Supported values are + between 0.0 s and 0.050 s (50 ms). Minimal period for a single + chassis/PC is 200 ns. If the specified value is less than 200 ns, + NI-TClk automatically coerces minTime to 200 ns. For multichassis + synchronization, adjust this value to account for propagation delays + through the various devices and cables. + + ''' + session_count_ctype = _visatype.ViUInt32(0 if sessions is None else len(sessions)) # case S160 + sessions_ctype = get_ctypes_pointer_for_buffer(value=_converters.convert_to_nitclk_session_num_list(sessions), library_type=_visatype.ViSession) # case B520 + min_tclk_period_ctype = _converters.convert_timedelta_to_seconds(min_tclk_period, _visatype.ViReal64) # case S140 + error_code = self._library.niTClk_Synchronize(session_count_ctype, sessions_ctype, min_tclk_period_ctype) + errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) + return + + def synchronize_to_sync_pulse_sender(self, sessions, min_time): + r'''synchronize_to_sync_pulse_sender + + TBD + + Args: + sessions (list of int): sessions is an array of sessions that are being synchronized. + + min_time (float): Minimal period of TClk, expressed in seconds. Supported values are + between 0.0 s and 0.050 s (50 ms). Minimal period for a single + chassis/PC is 200 ns. If the specified value is less than 200 ns, + NI-TClk automatically coerces minTime to 200 ns. For multichassis + synchronization, adjust this value to account for propagation delays + through the various devices and cables. + + ''' + session_count_ctype = _visatype.ViUInt32(0 if sessions is None else len(sessions)) # case S160 + sessions_ctype = get_ctypes_pointer_for_buffer(value=_converters.convert_to_nitclk_session_num_list(sessions), library_type=_visatype.ViSession) # case B520 + min_time_ctype = _visatype.ViReal64(min_time) # case S150 + error_code = self._library.niTClk_SynchronizeToSyncPulseSender(session_count_ctype, sessions_ctype, min_time_ctype) + errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) + return + + def wait_until_done(self, sessions, timeout): + r'''wait_until_done + + Call this method to pause execution of your program until the + acquisitions and/or generations corresponding to sessions are done or + until the method returns a timeout error. wait_until_done is a + blocking method that periodically checks the operation status. It + returns control to the calling program if the operation completes + successfully or an error occurs (including a timeout error). This + method is most useful for finite data operations that you expect to + complete within a certain time. + + Args: + sessions (list of int): sessions is an array of sessions that are being synchronized. + + timeout (float): The amount of time in seconds that wait_until_done waits for the + sessions to complete. If timeout is exceeded, wait_until_done + returns an error. + + ''' + session_count_ctype = _visatype.ViUInt32(0 if sessions is None else len(sessions)) # case S160 + sessions_ctype = get_ctypes_pointer_for_buffer(value=_converters.convert_to_nitclk_session_num_list(sessions), library_type=_visatype.ViSession) # case B520 + timeout_ctype = _visatype.ViReal64(timeout) # case S150 + error_code = self._library.niTClk_WaitUntilDone(session_count_ctype, sessions_ctype, timeout_ctype) + errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) + return + + +def _get_session_class(): + '''Internal function to return session singleton''' + global _session_instance + global _session_instance_lock + + with _session_instance_lock: + if _session_instance is None: + _session_instance = _Session() + + return _session_instance + + +def configure_for_homogeneous_triggers(sessions): + '''configure_for_homogeneous_triggers + + Configures the properties commonly required for the TClk synchronization + of device sessions with homogeneous triggers in a single PXI chassis or + a single PC. Use configure_for_homogeneous_triggers to configure + the properties for the reference clocks, start triggers, reference + triggers, script triggers, and pause triggers. If + configure_for_homogeneous_triggers cannot perform all the steps + appropriate for the given sessions, it returns an error. If an error is + returned, use the instrument driver methods and properties for signal + routing, along with the following NI-TClk properties: + start_trigger_master_session + ref_trigger_master_session + script_trigger_master_session + pause_trigger_master_session + configure_for_homogeneous_triggers affects the following clocks and + triggers: - Reference clocks - Start triggers - Reference triggers - + Script triggers - Pause triggers Reference Clocks + configure_for_homogeneous_triggers configures the reference clocks + if they are needed. Specifically, if the internal sample clocks or + internal sample clock timebases are used, and the reference clock source + is not configured--or is set to None (no trigger + configured)--configure_for_homogeneous_triggers configures the + following: PXI--The reference clock source on all devices is set to be + the 10 MHz PXI backplane clock (PXI_CLK10). PCI--One of the devices + exports its 10 MHz onboard reference clock to RTSI 7. The reference + clock source on all devices is set to be RTSI 7. Note: If the reference + clock source is set to a value other than None, + configure_for_homogeneous_triggers cannot configure the reference + clock source. Start Triggers If the start trigger is set to None (no + trigger configured) for all sessions, the sessions are configured to + share the start trigger. The start trigger is shared by: - Implicitly + exporting the start trigger from one session - Configuring the other + sessions for digital edge start triggers with sources corresponding to + the exported start trigger - Setting + start_trigger_master_session to the session that is + exporting the trigger for all sessions If the start triggers are None + for all except one session, configure_for_homogeneous_triggers + configures the sessions to share the start trigger from the one excepted + session. The start trigger is shared by: - Implicitly exporting start + trigger from the session with the start trigger that is not None - + Configuring the other sessions for digital-edge start triggers with + sources corresponding to the exported start trigger - Setting + start_trigger_master_session to the session that is + exporting the trigger for all sessions If start triggers are configured + for all sessions, configure_for_homogeneous_triggers does not + affect the start triggers. Start triggers are considered to be + configured for all sessions if either of the following conditions is + true: - No session has a start trigger that is None - One session has a + start trigger that is None, and all other sessions have start triggers + other than None. The one session with the None trigger must have + start_trigger_master_session set to itself, indicating + that the session itself is the start trigger master Reference Triggers + configure_for_homogeneous_triggers configures sessions that support + reference triggers to share the reference triggers if the reference + triggers are None (no trigger configured) for all except one session. + The reference triggers are shared by: - Implicitly exporting the + reference trigger from the session whose reference trigger is not None - + Configuring the other sessions that support the reference trigger for + digital-edge reference triggers with sources corresponding to the + exported reference trigger - Setting + ref_trigger_master_session to the session that is + exporting the trigger for all sessions that support reference trigger If + the reference triggers are configured for all sessions that support + reference triggers, configure_for_homogeneous_triggers does not + affect the reference triggers. Reference triggers are considered to be + configured for all sessions if either one or the other of the following + conditions is true: - No session has a reference trigger that is None - + One session has a reference trigger that is None, and all other sessions + have reference triggers other than None. The one session with the None + trigger must have ref_trigger_master_session set to + itself, indicating that the session itself is the reference trigger + master Reference Trigger Holdoffs Acquisition sessions may be configured + with the reference trigger. For acquisition sessions, when the reference + trigger is shared, configure_for_homogeneous_triggers configures + the holdoff properties (which are instrument driver specific) on the + reference trigger master session so that the session does not recognize + the reference trigger before the other sessions are ready. This + condition is only relevant when the sample clock rates, sample clock + timebase rates, sample counts, holdoffs, and/or any delays for the + acquisitions are different. When the sample clock rates, sample clock + timebase rates, and/or the sample counts are different in acquisition + sessions sharing the reference trigger, you should also set the holdoff + properties for the reference trigger master using the instrument driver. + Script Triggers configure_for_homogeneous_triggers configures + sessions that support script triggers to share them, if the script + triggers are None (no trigger configured) for all except one session. + The script triggers are shared in the following ways: - Implicitly + exporting the script trigger from the session whose script trigger is + not None - Configuring the other sessions that support the script + trigger for digital-edge script triggers with sources corresponding to + the exported script trigger - Setting + script_trigger_master_session to the session that is + exporting the trigger for all sessions that support script triggers If + the script triggers are configured for all sessions that support script + triggers, configure_for_homogeneous_triggers does not affect script + triggers. Script triggers are considered to be configured for all + sessions if either one or the other of the following conditions are + true: - No session has a script trigger that is None - One session has a + script trigger that is None and all other sessions have script triggers + other than None. The one session with the None trigger must have + script_trigger_master_session set to itself, indicating + that the session itself is the script trigger master Pause Triggers + configure_for_homogeneous_triggers configures generation sessions + that support pause triggers to share them, if the pause triggers are + None (no trigger configured) for all except one session. The pause + triggers are shared by: - Implicitly exporting the pause trigger from + the session whose script trigger is not None - Configuring the other + sessions that support the pause trigger for digital-edge pause triggers + with sources corresponding to the exported pause trigger - Setting + pause_trigger_master_session to the session that is + exporting the trigger for all sessions that support script triggers If + the pause triggers are configured for all generation sessions that + support pause triggers, configure_for_homogeneous_triggers does not + affect pause triggers. Pause triggers are considered to be configured + for all sessions if either one or the other of the following conditions + is true: - No session has a pause trigger that is None - One session has + a pause trigger that is None and all other sessions have pause triggers + other than None. The one session with the None trigger must have + pause_trigger_master_session set to itself, indicating + that the session itself is the pause trigger master Note: TClk + synchronization is not supported for pause triggers on acquisition + sessions. + + Args: + sessions (list of int): sessions is an array of sessions that are being synchronized. + + ''' + return _get_session_class().configure_for_homogeneous_triggers(sessions) + + +def finish_sync_pulse_sender_synchronize(sessions, min_time): + '''finish_sync_pulse_sender_synchronize + + TBD + + Args: + sessions (list of int): sessions is an array of sessions that are being synchronized. + + min_time (float): Minimal period of TClk, expressed in seconds. Supported values are + between 0.0 s and 0.050 s (50 ms). Minimal period for a single + chassis/PC is 200 ns. If the specified value is less than 200 ns, + NI-TClk automatically coerces minTime to 200 ns. For multichassis + synchronization, adjust this value to account for propagation delays + through the various devices and cables. + + ''' + return _get_session_class().finish_sync_pulse_sender_synchronize(sessions, min_time) + + +def init_for_documentation(self): + '''init_for_documentation + + TBD + ''' + return _get_session_class().init_for_documentation(self) + + +def initiate(sessions): + '''initiate + + Initiates the acquisition or generation sessions specified, taking into + consideration any special requirements needed for synchronization. For + example, the session exporting the TClk-synchronized start trigger is + not initiated until after initiate initiates all the sessions + that import the TClk-synchronized start trigger. + + Args: + sessions (list of int): sessions is an array of sessions that are being synchronized. + + ''' + return _get_session_class().initiate(sessions) + + +def is_done(sessions): + '''is_done + + Monitors the progress of the acquisitions and/or generations + corresponding to sessions. + + Args: + sessions (list of int): sessions is an array of sessions that are being synchronized. + + + Returns: + done (bool): Indicates that the operation is done. The operation is done when each + session has completed without any errors or when any one of the sessions + reports an error. + + ''' + return _get_session_class().is_done(sessions) + + +def setup_for_sync_pulse_sender_synchronize(sessions, min_time): + '''setup_for_sync_pulse_sender_synchronize + + TBD + + Args: + sessions (list of int): sessions is an array of sessions that are being synchronized. + + min_time (float): Minimal period of TClk, expressed in seconds. Supported values are + between 0.0 s and 0.050 s (50 ms). Minimal period for a single + chassis/PC is 200 ns. If the specified value is less than 200 ns, + NI-TClk automatically coerces minTime to 200 ns. For multichassis + synchronization, adjust this value to account for propagation delays + through the various devices and cables. + + ''' + return _get_session_class().setup_for_sync_pulse_sender_synchronize(sessions, min_time) + + +def synchronize(sessions, min_tclk_period=datetime.timedelta(seconds=0.0)): + '''synchronize + + Synchronizes the TClk signals on the given sessions. After + synchronize executes, TClk signals from all sessions are + synchronized. Note: Before using this NI-TClk method, verify that your + system is configured as specified in the PXI Trigger Lines and RTSI + Lines topic of the NI-TClk Synchronization Help. You can locate this + help file at Start>>Programs>>National Instruments>>NI-TClk. + + Args: + sessions (list of int): sessions is an array of sessions that are being synchronized. + + min_tclk_period (float in seconds or datetime.timedelta): Minimal period of TClk, expressed in seconds. Supported values are + between 0.0 s and 0.050 s (50 ms). Minimal period for a single + chassis/PC is 200 ns. If the specified value is less than 200 ns, + NI-TClk automatically coerces minTime to 200 ns. For multichassis + synchronization, adjust this value to account for propagation delays + through the various devices and cables. + + ''' + return _get_session_class().synchronize(sessions, min_tclk_period=datetime.timedelta(seconds=0.0)) + + +def synchronize_to_sync_pulse_sender(sessions, min_time): + '''synchronize_to_sync_pulse_sender + + TBD + + Args: + sessions (list of int): sessions is an array of sessions that are being synchronized. + + min_time (float): Minimal period of TClk, expressed in seconds. Supported values are + between 0.0 s and 0.050 s (50 ms). Minimal period for a single + chassis/PC is 200 ns. If the specified value is less than 200 ns, + NI-TClk automatically coerces minTime to 200 ns. For multichassis + synchronization, adjust this value to account for propagation delays + through the various devices and cables. + + ''' + return _get_session_class().synchronize_to_sync_pulse_sender(sessions, min_time) + + +def wait_until_done(sessions, timeout): + '''wait_until_done + + Call this method to pause execution of your program until the + acquisitions and/or generations corresponding to sessions are done or + until the method returns a timeout error. wait_until_done is a + blocking method that periodically checks the operation status. It + returns control to the calling program if the operation completes + successfully or an error occurs (including a timeout error). This + method is most useful for finite data operations that you expect to + complete within a certain time. + + Args: + sessions (list of int): sessions is an array of sessions that are being synchronized. + + timeout (float): The amount of time in seconds that wait_until_done waits for the + sessions to complete. If timeout is exceeded, wait_until_done + returns an error. + + ''' + return _get_session_class().wait_until_done(sessions, timeout) + + + From 04bb37c9dc39f31edd4fa4040c9be276b9220e2f Mon Sep 17 00:00:00 2001 From: Mark Silva Date: Wed, 18 Sep 2019 15:22:50 -0500 Subject: [PATCH 45/56] Update generated files --- generated/nidcpower/_attributes.py | 1 + generated/nidigital/_attributes.py | 1 + generated/nidmm/_attributes.py | 1 + generated/nifake/_attributes.py | 1 + generated/nifgen/_attributes.py | 1 + generated/niscope/_attributes.py | 1 + generated/niswitch/_attributes.py | 1 + generated/nitclk/session.py | 14 ++++++++++++++ 8 files changed, 21 insertions(+) diff --git a/generated/nidcpower/_attributes.py b/generated/nidcpower/_attributes.py index 5c0a8362b..ae804ed50 100644 --- a/generated/nidcpower/_attributes.py +++ b/generated/nidcpower/_attributes.py @@ -122,3 +122,4 @@ def __set__(self, session, value): + diff --git a/generated/nidigital/_attributes.py b/generated/nidigital/_attributes.py index 6d61c6d3e..1ea524811 100644 --- a/generated/nidigital/_attributes.py +++ b/generated/nidigital/_attributes.py @@ -122,3 +122,4 @@ def __set__(self, session, value): + diff --git a/generated/nidmm/_attributes.py b/generated/nidmm/_attributes.py index 1c79d3308..fb191bafb 100644 --- a/generated/nidmm/_attributes.py +++ b/generated/nidmm/_attributes.py @@ -122,3 +122,4 @@ def __set__(self, session, value): + diff --git a/generated/nifake/_attributes.py b/generated/nifake/_attributes.py index 56f54e99f..af4779628 100644 --- a/generated/nifake/_attributes.py +++ b/generated/nifake/_attributes.py @@ -122,3 +122,4 @@ def __set__(self, session, value): + diff --git a/generated/nifgen/_attributes.py b/generated/nifgen/_attributes.py index 7d0cd3ae1..192b87ee1 100644 --- a/generated/nifgen/_attributes.py +++ b/generated/nifgen/_attributes.py @@ -122,3 +122,4 @@ def __set__(self, session, value): + diff --git a/generated/niscope/_attributes.py b/generated/niscope/_attributes.py index 3de0a5a14..d9dee841a 100644 --- a/generated/niscope/_attributes.py +++ b/generated/niscope/_attributes.py @@ -122,3 +122,4 @@ def __set__(self, session, value): + diff --git a/generated/niswitch/_attributes.py b/generated/niswitch/_attributes.py index 21d5a5dea..441944f36 100644 --- a/generated/niswitch/_attributes.py +++ b/generated/niswitch/_attributes.py @@ -122,3 +122,4 @@ def __set__(self, session, value): + diff --git a/generated/nitclk/session.py b/generated/nitclk/session.py index f7ddc117f..9d5974ca3 100644 --- a/generated/nitclk/session.py +++ b/generated/nitclk/session.py @@ -346,6 +346,13 @@ def _get_extended_error_info(self): error, use the return values of the individual methods because once _get_extended_error_info reports an errorString, it does not report an empty string again. + + Returns: + error_string (str): Extended error description. If errorString is NULL, then it is not large + enough to hold the entire error description. In this case, the return + value of _get_extended_error_info is the size that you should use + for _get_extended_error_info to return the full error string. + ''' error_string_ctype = None # case C050 error_string_size_ctype = _visatype.ViUInt32() # case S170 @@ -683,6 +690,13 @@ def _get_extended_error_info(self): error, use the return values of the individual methods because once _get_extended_error_info reports an errorString, it does not report an empty string again. + + Returns: + error_string (str): Extended error description. If errorString is NULL, then it is not large + enough to hold the entire error description. In this case, the return + value of _get_extended_error_info is the size that you should use + for _get_extended_error_info to return the full error string. + ''' error_string_ctype = None # case C050 error_string_size_ctype = _visatype.ViUInt32() # case S170 From 297a67e7df87793c6806466ce29368beda0b7c7a Mon Sep 17 00:00:00 2001 From: Mark Silva Date: Wed, 18 Sep 2019 15:24:29 -0500 Subject: [PATCH 46/56] Don't need the extra line --- .codecov.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.codecov.yml b/.codecov.yml index 21ed7c8c2..f44672112 100644 --- a/.codecov.yml +++ b/.codecov.yml @@ -13,4 +13,3 @@ coverage: target: 35% threshhold: 5 - From d22e85290494e79729c2ce7d8c308690650bcbff Mon Sep 17 00:00:00 2001 From: Mark Silva Date: Wed, 18 Sep 2019 15:24:39 -0500 Subject: [PATCH 47/56] Don't need the extra line --- build/templates/_attributes.py.mako | 1 - 1 file changed, 1 deletion(-) diff --git a/build/templates/_attributes.py.mako b/build/templates/_attributes.py.mako index b4a64b473..4bb6ddf5e 100644 --- a/build/templates/_attributes.py.mako +++ b/build/templates/_attributes.py.mako @@ -126,4 +126,3 @@ class AttributeViInt32SessionReference(Attribute): - From 3b4ce9bea7ba013ab0990e267f5df177b52eb617 Mon Sep 17 00:00:00 2001 From: Mark Silva Date: Wed, 18 Sep 2019 15:24:51 -0500 Subject: [PATCH 48/56] Update generated files --- generated/nidcpower/_attributes.py | 1 - generated/nidigital/_attributes.py | 1 - generated/nidmm/_attributes.py | 1 - generated/nifake/_attributes.py | 1 - generated/nifgen/_attributes.py | 1 - generated/niscope/_attributes.py | 1 - generated/niswitch/_attributes.py | 1 - generated/nitclk/_attributes.py | 1 - 8 files changed, 8 deletions(-) diff --git a/generated/nidcpower/_attributes.py b/generated/nidcpower/_attributes.py index ae804ed50..5c0a8362b 100644 --- a/generated/nidcpower/_attributes.py +++ b/generated/nidcpower/_attributes.py @@ -122,4 +122,3 @@ def __set__(self, session, value): - diff --git a/generated/nidigital/_attributes.py b/generated/nidigital/_attributes.py index 1ea524811..6d61c6d3e 100644 --- a/generated/nidigital/_attributes.py +++ b/generated/nidigital/_attributes.py @@ -122,4 +122,3 @@ def __set__(self, session, value): - diff --git a/generated/nidmm/_attributes.py b/generated/nidmm/_attributes.py index fb191bafb..1c79d3308 100644 --- a/generated/nidmm/_attributes.py +++ b/generated/nidmm/_attributes.py @@ -122,4 +122,3 @@ def __set__(self, session, value): - diff --git a/generated/nifake/_attributes.py b/generated/nifake/_attributes.py index af4779628..56f54e99f 100644 --- a/generated/nifake/_attributes.py +++ b/generated/nifake/_attributes.py @@ -122,4 +122,3 @@ def __set__(self, session, value): - diff --git a/generated/nifgen/_attributes.py b/generated/nifgen/_attributes.py index 192b87ee1..7d0cd3ae1 100644 --- a/generated/nifgen/_attributes.py +++ b/generated/nifgen/_attributes.py @@ -122,4 +122,3 @@ def __set__(self, session, value): - diff --git a/generated/niscope/_attributes.py b/generated/niscope/_attributes.py index d9dee841a..3de0a5a14 100644 --- a/generated/niscope/_attributes.py +++ b/generated/niscope/_attributes.py @@ -122,4 +122,3 @@ def __set__(self, session, value): - diff --git a/generated/niswitch/_attributes.py b/generated/niswitch/_attributes.py index 441944f36..21d5a5dea 100644 --- a/generated/niswitch/_attributes.py +++ b/generated/niswitch/_attributes.py @@ -122,4 +122,3 @@ def __set__(self, session, value): - diff --git a/generated/nitclk/_attributes.py b/generated/nitclk/_attributes.py index 0cc0a78cf..b3e911ce5 100644 --- a/generated/nitclk/_attributes.py +++ b/generated/nitclk/_attributes.py @@ -122,4 +122,3 @@ def __set__(self, session, value): - From 6417a884f4c50b503309720ad048d58817f82ee0 Mon Sep 17 00:00:00 2001 From: Mark Silva Date: Wed, 18 Sep 2019 16:55:51 -0500 Subject: [PATCH 49/56] get_session_number() is now private --- build/templates/_converters.py.mako | 4 ++-- src/nitclk/templates/session.py.mako | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/build/templates/_converters.py.mako b/build/templates/_converters.py.mako index 2e9cd2b16..4a0d1b6a6 100644 --- a/build/templates/_converters.py.mako +++ b/build/templates/_converters.py.mako @@ -225,12 +225,12 @@ def convert_to_nitclk_session_number(item): - NI-TClk Session Num ''' try: - return item.tclk.get_session_number() + return item.tclk._get_session_number() except KeyError: pass try: - return item.get_session_number() + return item._get_session_number() except KeyError: pass diff --git a/src/nitclk/templates/session.py.mako b/src/nitclk/templates/session.py.mako index ef4c1d2b5..6d67a73a2 100644 --- a/src/nitclk/templates/session.py.mako +++ b/src/nitclk/templates/session.py.mako @@ -115,7 +115,7 @@ helper.add_attribute_rep_cap_tip_docstring(attributes[attribute], config) except errors.Error: return "Failed to retrieve error description." - def get_session_number(self): + def _get_session_number(self): return self._${config['session_handle_parameter_name']} <% From 2c12924f18affce9325dc27a3cb20e4a23bd9405 Mon Sep 17 00:00:00 2001 From: Mark Silva Date: Wed, 18 Sep 2019 16:56:06 -0500 Subject: [PATCH 50/56] Remove repeated calabilities list --- src/nitclk/templates/session.py.mako | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/nitclk/templates/session.py.mako b/src/nitclk/templates/session.py.mako index 6d67a73a2..58c2075a5 100644 --- a/src/nitclk/templates/session.py.mako +++ b/src/nitclk/templates/session.py.mako @@ -75,9 +75,7 @@ helper.add_attribute_rep_cap_tip_docstring(attributes[attribute], config) % endif % endfor - def __init__(self, ${config['session_handle_parameter_name']}, repeated_capability_list='', encoding='windows-1251'): - self._repeated_capability_list = repeated_capability_list - self._repeated_capability = ','.join(repeated_capability_list) + def __init__(self, ${config['session_handle_parameter_name']}, encoding='windows-1251'): self._${config['session_handle_parameter_name']} = ${config['session_handle_parameter_name']} self._library = _library_singleton.get() self._encoding = encoding @@ -85,7 +83,6 @@ helper.add_attribute_rep_cap_tip_docstring(attributes[attribute], config) # Store the parameter list for later printing in __repr__ param_list = [] param_list.append("${config['session_handle_parameter_name']}=" + pp.pformat(${config['session_handle_parameter_name']})) - param_list.append("repeated_capability_list=" + pp.pformat(repeated_capability_list)) param_list.append("encoding=" + pp.pformat(encoding)) self._param_list = ', '.join(param_list) From fadd8b3e16714f07e23c5b0524b55f682cfef85a Mon Sep 17 00:00:00 2001 From: Mark Silva Date: Wed, 18 Sep 2019 16:56:24 -0500 Subject: [PATCH 51/56] Don't need if since we know tclk has attributes --- src/nitclk/templates/session.py.mako | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/nitclk/templates/session.py.mako b/src/nitclk/templates/session.py.mako index 58c2075a5..855be2810 100644 --- a/src/nitclk/templates/session.py.mako +++ b/src/nitclk/templates/session.py.mako @@ -17,9 +17,7 @@ import ctypes import datetime import threading -% if attributes: import ${module_name}._attributes as _attributes -% endif import ${module_name}._converters as _converters import ${module_name}._library_singleton as _library_singleton import ${module_name}._visatype as _visatype From c748a854ac24d3e91f05eba902eca8955f05e4f5 Mon Sep 17 00:00:00 2001 From: Mark Silva Date: Wed, 18 Sep 2019 16:56:37 -0500 Subject: [PATCH 52/56] Change session handle name --- src/nitclk/metadata/config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nitclk/metadata/config.py b/src/nitclk/metadata/config.py index d778110d1..eef74a255 100644 --- a/src/nitclk/metadata/config.py +++ b/src/nitclk/metadata/config.py @@ -30,5 +30,5 @@ 'module_name': 'nitclk', 'repeated_capabilities': [ ], - 'session_handle_parameter_name': 'session' + 'session_handle_parameter_name': 'session_number' } From bffda2a4689fe8dbfb0de79919128b3a8fedfdeb Mon Sep 17 00:00:00 2001 From: Mark Silva Date: Wed, 18 Sep 2019 16:56:46 -0500 Subject: [PATCH 53/56] Update generated files --- generated/nidcpower/_converters.py | 4 ++-- generated/nidigital/_converters.py | 4 ++-- generated/nidmm/_converters.py | 4 ++-- generated/nifake/_converters.py | 4 ++-- generated/nifgen/_converters.py | 4 ++-- generated/nimodinst/_converters.py | 4 ++-- generated/niscope/_converters.py | 4 ++-- generated/nise/_converters.py | 4 ++-- generated/niswitch/_converters.py | 4 ++-- generated/nitclk/_converters.py | 4 ++-- generated/nitclk/session.py | 13 +++++-------- 11 files changed, 25 insertions(+), 28 deletions(-) diff --git a/generated/nidcpower/_converters.py b/generated/nidcpower/_converters.py index de146c543..68240b924 100644 --- a/generated/nidcpower/_converters.py +++ b/generated/nidcpower/_converters.py @@ -221,12 +221,12 @@ def convert_to_nitclk_session_number(item): - NI-TClk Session Num ''' try: - return item.tclk.get_session_number() + return item.tclk._get_session_number() except KeyError: pass try: - return item.get_session_number() + return item._get_session_number() except KeyError: pass diff --git a/generated/nidigital/_converters.py b/generated/nidigital/_converters.py index 27912e548..9df296e8d 100644 --- a/generated/nidigital/_converters.py +++ b/generated/nidigital/_converters.py @@ -221,12 +221,12 @@ def convert_to_nitclk_session_number(item): - NI-TClk Session Num ''' try: - return item.tclk.get_session_number() + return item.tclk._get_session_number() except KeyError: pass try: - return item.get_session_number() + return item._get_session_number() except KeyError: pass diff --git a/generated/nidmm/_converters.py b/generated/nidmm/_converters.py index 5b4795c86..93015370b 100644 --- a/generated/nidmm/_converters.py +++ b/generated/nidmm/_converters.py @@ -221,12 +221,12 @@ def convert_to_nitclk_session_number(item): - NI-TClk Session Num ''' try: - return item.tclk.get_session_number() + return item.tclk._get_session_number() except KeyError: pass try: - return item.get_session_number() + return item._get_session_number() except KeyError: pass diff --git a/generated/nifake/_converters.py b/generated/nifake/_converters.py index 1e91c3a6d..7308090bf 100644 --- a/generated/nifake/_converters.py +++ b/generated/nifake/_converters.py @@ -221,12 +221,12 @@ def convert_to_nitclk_session_number(item): - NI-TClk Session Num ''' try: - return item.tclk.get_session_number() + return item.tclk._get_session_number() except KeyError: pass try: - return item.get_session_number() + return item._get_session_number() except KeyError: pass diff --git a/generated/nifgen/_converters.py b/generated/nifgen/_converters.py index 47269eb01..2f9212340 100644 --- a/generated/nifgen/_converters.py +++ b/generated/nifgen/_converters.py @@ -221,12 +221,12 @@ def convert_to_nitclk_session_number(item): - NI-TClk Session Num ''' try: - return item.tclk.get_session_number() + return item.tclk._get_session_number() except KeyError: pass try: - return item.get_session_number() + return item._get_session_number() except KeyError: pass diff --git a/generated/nimodinst/_converters.py b/generated/nimodinst/_converters.py index 2b418ad33..4fb2e6126 100644 --- a/generated/nimodinst/_converters.py +++ b/generated/nimodinst/_converters.py @@ -221,12 +221,12 @@ def convert_to_nitclk_session_number(item): - NI-TClk Session Num ''' try: - return item.tclk.get_session_number() + return item.tclk._get_session_number() except KeyError: pass try: - return item.get_session_number() + return item._get_session_number() except KeyError: pass diff --git a/generated/niscope/_converters.py b/generated/niscope/_converters.py index d4ec24b06..a8ce303cc 100644 --- a/generated/niscope/_converters.py +++ b/generated/niscope/_converters.py @@ -221,12 +221,12 @@ def convert_to_nitclk_session_number(item): - NI-TClk Session Num ''' try: - return item.tclk.get_session_number() + return item.tclk._get_session_number() except KeyError: pass try: - return item.get_session_number() + return item._get_session_number() except KeyError: pass diff --git a/generated/nise/_converters.py b/generated/nise/_converters.py index f56268b7c..6e399ee4c 100644 --- a/generated/nise/_converters.py +++ b/generated/nise/_converters.py @@ -221,12 +221,12 @@ def convert_to_nitclk_session_number(item): - NI-TClk Session Num ''' try: - return item.tclk.get_session_number() + return item.tclk._get_session_number() except KeyError: pass try: - return item.get_session_number() + return item._get_session_number() except KeyError: pass diff --git a/generated/niswitch/_converters.py b/generated/niswitch/_converters.py index 719c9da0b..ec4664482 100644 --- a/generated/niswitch/_converters.py +++ b/generated/niswitch/_converters.py @@ -221,12 +221,12 @@ def convert_to_nitclk_session_number(item): - NI-TClk Session Num ''' try: - return item.tclk.get_session_number() + return item.tclk._get_session_number() except KeyError: pass try: - return item.get_session_number() + return item._get_session_number() except KeyError: pass diff --git a/generated/nitclk/_converters.py b/generated/nitclk/_converters.py index c76bd4a4e..386884898 100644 --- a/generated/nitclk/_converters.py +++ b/generated/nitclk/_converters.py @@ -221,12 +221,12 @@ def convert_to_nitclk_session_number(item): - NI-TClk Session Num ''' try: - return item.tclk.get_session_number() + return item.tclk._get_session_number() except KeyError: pass try: - return item.get_session_number() + return item._get_session_number() except KeyError: pass diff --git a/generated/nitclk/session.py b/generated/nitclk/session.py index 9d5974ca3..65bd7d85e 100644 --- a/generated/nitclk/session.py +++ b/generated/nitclk/session.py @@ -159,17 +159,14 @@ class SessionReference(object): Indicates the computed TClk period that will be used during the acquisition. ''' - def __init__(self, session, repeated_capability_list='', encoding='windows-1251'): - self._repeated_capability_list = repeated_capability_list - self._repeated_capability = ','.join(repeated_capability_list) - self._session = session + def __init__(self, session_number, encoding='windows-1251'): + self._session_number = session_number self._library = _library_singleton.get() self._encoding = encoding # Store the parameter list for later printing in __repr__ param_list = [] - param_list.append("session=" + pp.pformat(session)) - param_list.append("repeated_capability_list=" + pp.pformat(repeated_capability_list)) + param_list.append("session_number=" + pp.pformat(session_number)) param_list.append("encoding=" + pp.pformat(encoding)) self._param_list = ', '.join(param_list) @@ -199,8 +196,8 @@ def _get_error_description(self, error_code): except errors.Error: return "Failed to retrieve error description." - def get_session_number(self): - return self._session + def _get_session_number(self): + return self._session_number def _get_attribute_vi_boolean(self, attribute_id): r'''_get_attribute_vi_boolean From b6906709854e54e0a925dca104933738bad7fce6 Mon Sep 17 00:00:00 2001 From: Mark Silva Date: Wed, 18 Sep 2019 17:00:07 -0500 Subject: [PATCH 54/56] Change attribute class name to remove ViInt32 --- build/templates/_attributes.py.mako | 2 +- src/nitclk/metadata/attributes.py | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/build/templates/_attributes.py.mako b/build/templates/_attributes.py.mako index 4bb6ddf5e..b02456f33 100644 --- a/build/templates/_attributes.py.mako +++ b/build/templates/_attributes.py.mako @@ -114,7 +114,7 @@ class AttributeEnum(object): # nitclk specific attribute type -class AttributeViInt32SessionReference(Attribute): +class AttributeSessionReference(Attribute): def __get__(self, session, session_type): # Import here to avoid a circular dependency when initial import happens diff --git a/src/nitclk/metadata/attributes.py b/src/nitclk/metadata/attributes.py index a7042a702..a23ceca32 100644 --- a/src/nitclk/metadata/attributes.py +++ b/src/nitclk/metadata/attributes.py @@ -25,7 +25,7 @@ }, 3: { 'access': 'read-write', - 'attribute_class': 'AttributeViInt32SessionReference', + 'attribute_class': 'AttributeSessionReference', 'channel_based': False, 'documentation': { 'description': '\nSpecifies the start trigger master session.\nFor external triggers, the session that originally receives the trigger. For None (no trigger configured) or software triggers, the session that originally generates the trigger.\n' @@ -38,7 +38,7 @@ }, 4: { 'access': 'read-write', - 'attribute_class': 'AttributeViInt32SessionReference', + 'attribute_class': 'AttributeSessionReference', 'channel_based': False, 'documentation': { 'description': '\nSpecifies the reference trigger master session.\nFor external triggers, the session that originally receives the trigger. For None (no trigger configured) or software triggers, the session that originally generates the trigger.\n' @@ -51,7 +51,7 @@ }, 5: { 'access': 'read-write', - 'attribute_class': 'AttributeViInt32SessionReference', + 'attribute_class': 'AttributeSessionReference', 'channel_based': False, 'documentation': { 'description': '\nSpecifies the script trigger master session.\nFor external triggers, the session that originally receives the trigger. For None (no trigger configured) or software triggers, the session that originally generates the trigger.\n' @@ -64,7 +64,7 @@ }, 6: { 'access': 'read-write', - 'attribute_class': 'AttributeViInt32SessionReference', + 'attribute_class': 'AttributeSessionReference', 'channel_based': False, 'documentation': { 'description': '\nSpecifies the pause trigger master session.\nFor external triggers, the session that originally receives the trigger. For None (no trigger configured) or software triggers, the session that originally generates the trigger.\n' @@ -133,7 +133,7 @@ }, 16: { 'access': 'read-write', - 'attribute_class': 'AttributeViInt32SessionReference', + 'attribute_class': 'AttributeSessionReference', 'channel_based': False, 'documentation': { 'description': '\nSpecifies the sequencer flag master session.\nFor external triggers, the session that originally receives the trigger.\nFor None (no trigger configured) or software triggers, the session that\noriginally generates the trigger.\n' From 124ea8448edcfe6350073da34715bd0d98719bc9 Mon Sep 17 00:00:00 2001 From: Mark Silva Date: Wed, 18 Sep 2019 17:00:15 -0500 Subject: [PATCH 55/56] Update generated files --- docs/conf.py | 2 +- generated/nidcpower/_attributes.py | 2 +- generated/nidigital/_attributes.py | 2 +- generated/nidmm/_attributes.py | 2 +- generated/nifake/_attributes.py | 2 +- generated/nifgen/_attributes.py | 2 +- generated/niscope/_attributes.py | 2 +- generated/niswitch/_attributes.py | 2 +- generated/nitclk/_attributes.py | 2 +- generated/nitclk/session.py | 10 +++++----- 10 files changed, 14 insertions(+), 14 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 34d368c9d..e6c48b141 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -63,7 +63,7 @@ # built documents. # # The full version, including alpha/beta/rc tags. -release = '1.1.3.dev0' +release = '0.1.0.dev0' # The short X.Y version. version = release[:3] diff --git a/generated/nidcpower/_attributes.py b/generated/nidcpower/_attributes.py index 5c0a8362b..54cf06430 100644 --- a/generated/nidcpower/_attributes.py +++ b/generated/nidcpower/_attributes.py @@ -110,7 +110,7 @@ def __set__(self, session, value): # nitclk specific attribute type -class AttributeViInt32SessionReference(Attribute): +class AttributeSessionReference(Attribute): def __get__(self, session, session_type): # Import here to avoid a circular dependency when initial import happens diff --git a/generated/nidigital/_attributes.py b/generated/nidigital/_attributes.py index 6d61c6d3e..2b44dc347 100644 --- a/generated/nidigital/_attributes.py +++ b/generated/nidigital/_attributes.py @@ -110,7 +110,7 @@ def __set__(self, session, value): # nitclk specific attribute type -class AttributeViInt32SessionReference(Attribute): +class AttributeSessionReference(Attribute): def __get__(self, session, session_type): # Import here to avoid a circular dependency when initial import happens diff --git a/generated/nidmm/_attributes.py b/generated/nidmm/_attributes.py index 1c79d3308..4105f7a97 100644 --- a/generated/nidmm/_attributes.py +++ b/generated/nidmm/_attributes.py @@ -110,7 +110,7 @@ def __set__(self, session, value): # nitclk specific attribute type -class AttributeViInt32SessionReference(Attribute): +class AttributeSessionReference(Attribute): def __get__(self, session, session_type): # Import here to avoid a circular dependency when initial import happens diff --git a/generated/nifake/_attributes.py b/generated/nifake/_attributes.py index 56f54e99f..5a42ef9e9 100644 --- a/generated/nifake/_attributes.py +++ b/generated/nifake/_attributes.py @@ -110,7 +110,7 @@ def __set__(self, session, value): # nitclk specific attribute type -class AttributeViInt32SessionReference(Attribute): +class AttributeSessionReference(Attribute): def __get__(self, session, session_type): # Import here to avoid a circular dependency when initial import happens diff --git a/generated/nifgen/_attributes.py b/generated/nifgen/_attributes.py index 7d0cd3ae1..bf2bc7596 100644 --- a/generated/nifgen/_attributes.py +++ b/generated/nifgen/_attributes.py @@ -110,7 +110,7 @@ def __set__(self, session, value): # nitclk specific attribute type -class AttributeViInt32SessionReference(Attribute): +class AttributeSessionReference(Attribute): def __get__(self, session, session_type): # Import here to avoid a circular dependency when initial import happens diff --git a/generated/niscope/_attributes.py b/generated/niscope/_attributes.py index 3de0a5a14..0b10d04d0 100644 --- a/generated/niscope/_attributes.py +++ b/generated/niscope/_attributes.py @@ -110,7 +110,7 @@ def __set__(self, session, value): # nitclk specific attribute type -class AttributeViInt32SessionReference(Attribute): +class AttributeSessionReference(Attribute): def __get__(self, session, session_type): # Import here to avoid a circular dependency when initial import happens diff --git a/generated/niswitch/_attributes.py b/generated/niswitch/_attributes.py index 21d5a5dea..7ed2b5962 100644 --- a/generated/niswitch/_attributes.py +++ b/generated/niswitch/_attributes.py @@ -110,7 +110,7 @@ def __set__(self, session, value): # nitclk specific attribute type -class AttributeViInt32SessionReference(Attribute): +class AttributeSessionReference(Attribute): def __get__(self, session, session_type): # Import here to avoid a circular dependency when initial import happens diff --git a/generated/nitclk/_attributes.py b/generated/nitclk/_attributes.py index b3e911ce5..362d5c393 100644 --- a/generated/nitclk/_attributes.py +++ b/generated/nitclk/_attributes.py @@ -110,7 +110,7 @@ def __set__(self, session, value): # nitclk specific attribute type -class AttributeViInt32SessionReference(Attribute): +class AttributeSessionReference(Attribute): def __get__(self, session, session_type): # Import here to avoid a circular dependency when initial import happens diff --git a/generated/nitclk/session.py b/generated/nitclk/session.py index 65bd7d85e..062c4662b 100644 --- a/generated/nitclk/session.py +++ b/generated/nitclk/session.py @@ -72,13 +72,13 @@ class SessionReference(object): - NI PXI-6551/6552 supports 'PFI0', 'PFI1', 'PFI2', and 'PFI3' Default Value is empty string ''' - pause_trigger_master_session = _attributes.AttributeViInt32SessionReference(6) + pause_trigger_master_session = _attributes.AttributeSessionReference(6) '''Type: nimi-python Session class, nitclk.SessionReference, NI-TClk Session Number Specifies the pause trigger master session. For external triggers, the session that originally receives the trigger. For None (no trigger configured) or software triggers, the session that originally generates the trigger. ''' - ref_trigger_master_session = _attributes.AttributeViInt32SessionReference(4) + ref_trigger_master_session = _attributes.AttributeSessionReference(4) '''Type: nimi-python Session class, nitclk.SessionReference, NI-TClk Session Number Specifies the reference trigger master session. @@ -96,13 +96,13 @@ class SessionReference(object): Note: Sample clock delay is supported for generation sessions only; it is ''' - script_trigger_master_session = _attributes.AttributeViInt32SessionReference(5) + script_trigger_master_session = _attributes.AttributeSessionReference(5) '''Type: nimi-python Session class, nitclk.SessionReference, NI-TClk Session Number Specifies the script trigger master session. For external triggers, the session that originally receives the trigger. For None (no trigger configured) or software triggers, the session that originally generates the trigger. ''' - sequencer_flag_master_session = _attributes.AttributeViInt32SessionReference(16) + sequencer_flag_master_session = _attributes.AttributeSessionReference(16) '''Type: nimi-python Session class, nitclk.SessionReference, NI-TClk Session Number Specifies the sequencer flag master session. @@ -110,7 +110,7 @@ class SessionReference(object): For None (no trigger configured) or software triggers, the session that originally generates the trigger. ''' - start_trigger_master_session = _attributes.AttributeViInt32SessionReference(3) + start_trigger_master_session = _attributes.AttributeSessionReference(3) '''Type: nimi-python Session class, nitclk.SessionReference, NI-TClk Session Number Specifies the start trigger master session. From be7d6080207a7f0caa2093d02b740ff4cb506039 Mon Sep 17 00:00:00 2001 From: Mark Silva Date: Wed, 18 Sep 2019 17:09:25 -0500 Subject: [PATCH 56/56] Update docstring --- generated/nitclk/session.py | 8 ++++++-- src/nitclk/templates/session.py.mako | 8 ++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/generated/nitclk/session.py b/generated/nitclk/session.py index 062c4662b..e1801c84b 100644 --- a/generated/nitclk/session.py +++ b/generated/nitclk/session.py @@ -489,10 +489,14 @@ def _set_attribute_vi_string(self, attribute_id, value): class _Session(object): - '''Hidden class for template reuse''' + '''Private class + + This class allows reusing function templates that are used in all other drivers. If + we don't do this, we would need new template(s) that the only difference is in the + indentation. + ''' def __init__(self): - '''Hidden class for template reuse''' self._library = _library_singleton.get() self._encoding = 'windows-1251' diff --git a/src/nitclk/templates/session.py.mako b/src/nitclk/templates/session.py.mako index 855be2810..222bbe8d5 100644 --- a/src/nitclk/templates/session.py.mako +++ b/src/nitclk/templates/session.py.mako @@ -128,10 +128,14 @@ functions['GetExtendedErrorInfo']['render_in_session_base'] = True # The main reason for having this class is to allow reusing the default method template. %>\ class _Session(object): - '''Hidden class for template reuse''' + '''Private class + + This class allows reusing function templates that are used in all other drivers. If + we don't do this, we would need new template(s) that the only difference is in the + indentation. + ''' def __init__(self): - '''Hidden class for template reuse''' self._library = _library_singleton.get() self._encoding = 'windows-1251'