diff --git a/.config/cspell.json b/.config/cspell.json new file mode 100644 index 000000000..387add681 --- /dev/null +++ b/.config/cspell.json @@ -0,0 +1,46 @@ +{ + "version": "0.2", + "globRoot": "${cwd}", + // Keep the following list of items in alphabetical order. + "dictionaryDefinitions": [ + { "name": "daqmx-api-elements", "path": "./cspell/daqmx-api-elements.txt", "noSuggest": true }, + { "name": "real-words", "path": "./cspell/real-words.txt", "noSuggest": false }, + { "name": "mako-keywords", "path": "./cspell/mako-keywords.txt", "noSuggest": true }, + { "name": "project-software-terms", "path": "./cspell/project-software-terms.txt", "noSuggest": true }, + { "name": "sphinx-directives", "path": "./cspell/sphinx-directives.txt", "noSuggest": true } + ], + "dictionaries": ["real-words", "daqmx-api-elements", "project-software-terms", "python"], + "useGitignore": true, + // Keep the following list of items in the order that they appear in VSCode + // Explorer (directories in alphabetical order, followed by top-level files + // in alphabetical order). + "ignorePaths": [ + ".config/cspell/**", // dictionary source files; words here are not prose + "docs/img/**", // binary image files + "docs/conf.py", // Sphinx config; extension names and config keys + "docs/make.bat", // Sphinx build script; not prose + "docs/Makefile", // Sphinx build script; not prose + "generated/nidaqmx/_stubs/**", // protobuf-generated stubs; too noisy to check + "tests/max_config/**", // NI MAX config files; NI-specific identifiers + "tests/test_assets/**", // test fixture files; not prose + "third_party/**", // third-party code we don't own or control + ".readthedocs.yml", // ReadTheDocs config + "poetry.lock", // auto-generated lock file; hashes and package URLs + "poetry.toml", // Poetry config + "tox.ini" // tox config + ], + "overrides": [ + { + "filename": "**/*.mako", + "dictionaries": ["real-words", "daqmx-api-elements", "python", "mako-keywords"] + }, + { + "filename": "**/*.rst", + "dictionaries": ["real-words", "daqmx-api-elements", "python", "sphinx-directives"] + }, + { + "filename": "**/CONTRIBUTING.md", + "dictionaries": ["real-words"] + } + ] +} diff --git a/.config/cspell/daqmx-api-elements.txt b/.config/cspell/daqmx-api-elements.txt new file mode 100644 index 000000000..d586c04e1 --- /dev/null +++ b/.config/cspell/daqmx-api-elements.txt @@ -0,0 +1,115 @@ +acceld # Deprecated; see attribute_helpers.py +ACRMS # unseparated initialisms; AC RMS +AHigh # unseparated words; A high +AIAC # unseparated initialisms; AI AC +AIADC # unseparated initialisms; AI ADC +AIDC # unseparated initialisms; AI DC +AIGnd # unseparated words; AI ground +AILVDT # unseparated initialisms; AI LVDT +AIRTD # unseparated initialisms; AI RTD +AIRTDA # unseparated initialisms; AI RTD A +AIRTDB # unseparated initialisms; AI RTD B +AIRTDC # unseparated initialisms; AI RTD C +AIRTDR0 # unseparated initialisms; AI RTD R0 +AIRVDT # unseparated initialisms; AI RVDT +AITEDS # unseparated initialisms; AI TEDS +anlg # abbreviation; analog +AODAC # unseparated initialisms; AO DAC +AOGnd # unseparated words; AO ground +AOHW # unseparated initialisms; AO HW +APFI # initialism; Analog Programmable Function Interface +asyn # abbreviation; asynchronous +atten # abbreviation; attenuation +attentuation # Typo; should be: attenuation +BBULK # Typo; should be USB_BULK instead of US_BBULK +BHigh # unseparated words; B high +calibrationInfo # unseparated words +CAPI # unseparated words; C API +certiticates # Typo; should be: certificates +cfgd # abbreviation; configured +cfgs # abbreviation; configurations +chans # abbreviation; channels +CIGPS # unseparated initialisms; CI GPS +CIHW # unseparated initialisms; CI HW +CITC # unseparated initialisms; CI TC +CIUTC # unseparated initialisms; CI UTC +clks # abbreviation; clocks +cmplt # abbreviation; complete +coeff # abbreviation; coefficient +coeffs # abbreviation; coefficients +COHW # unseparated initialisms; CO HW +COHWTSP # unseparated initialisms; CO HWTSP +compen # abbreviation; compensated / compensation +conv # abbreviation; convert +couldnt # abbreviation; couldn't +ctrs # abbreviation; counters +DAQError # unseparated words +descr # abbreviation; description +difft # abbreviation; different +doesnt # abbreviation; doesn't +DSTAR # for further research; stands for differential star (PXIe trigger), but we also use D_STAR +elec # abbreviation; electrical +excit # abbreviation; excitation +expir # abbreviation; expiration +exportSignal # unseparated words +fltr # abbreviation; filter +forceLb # unseparated words; force in pounds +freqOut # abbreviation; frequency output +frequencyWith # unseparated words +globalVirtualChannels # unseparated words; global virtual channels +hshk # abbreviation; handshake +HWTEDS # unseparated initialisms; HW TEDS +HWTSP # initialism; Hardware-Timed Single Point +hyst # abbreviation; hysteresis +hysts # abbreviation; hysteresis +immed # abbreviation; immediate +invalidc # Typo; should be: INVALID_CDAQ_SYNC_PORT_CONNECTION_FORMAT +IRIGB # initialism; IRIG-B +isoc # abbreviation; isochronous +lvls # abbreviation; levels +MIOAI # unseparated initialisms; MIO AI +mult # abbreviation; multiple +multiDevice # unseparated words +NIDAQ # initialism; NI-DAQ (legacy product name) +nidaqmx # NI-DAQmx package name +nonBuffered # unseparated words +notKnown # unseparated words +NRSE # initialism; Non-Referenced Single-Ended +nums # abbreviation; numbers +onbrd # abbreviation; onboard +outp # abbreviation; output +persistedChannel # unseparated words +persistedScale # unseparated words +persistedTask # unseparated words +physicalChannel # unseparated words +posssible # Typo; should be: possible +pretrig # abbreviation; pre-trigger +prpty # abbreviation; property +rangeWith # unseparated words +regen # abbreviation; regeneration +rngs # abbreviation; ranges +rqst # abbreviation; request +samp # abbreviation; sample +samps # abbreviation; samples +scanList # unseparated words +sensord # Deprecated; see attribute_helpers.py +sensitivit # Typo; should be: sensitivity +SMIO # initialism; Simultaneously-sampling Multifunction I/O +specd # abbreviation; specified +srcs # abbreviation; sources +subsytem # Typo; should be: subsystem +taskToCopy # unseparated words; task to copy +tcpip # initialism; TCP/IP +TEDSAI # unseparated initialisms; TEDS AI +TEDSAIRTD # unseparated initialisms; TEDS AI RTD +TEDSHWTEDS # unseparated initialisms; TEDS HWTEDS +thrmcpl # abbreviation; thermocouple +thrmstr # abbreviation; thermistor +timeTriggers # unseparated words +trigs # abbreviation; triggers +unavail # abbreviation; unavailable +USBDAQ # unseparated initialisms; USB DAQ +verif # abbreviation; verification +voltaged # Deprecated; see attribute_helpers.py +xfer # abbreviation; transfer +ZIdx # abbreviation; Z index diff --git a/.config/cspell/mako-keywords.txt b/.config/cspell/mako-keywords.txt new file mode 100644 index 000000000..9d9a013a2 --- /dev/null +++ b/.config/cspell/mako-keywords.txt @@ -0,0 +1,10 @@ +# Mako template closing keywords for control structures (% endXXX markers). +# Mako closes each % control block with a matching % end line. +# All seven closing keywords are included; they are all used in src/codegen/templates/. +endblock +enddef +endfor +endif +endtry +endwhile +endwith diff --git a/.config/cspell/project-software-terms.txt b/.config/cspell/project-software-terms.txt new file mode 100644 index 000000000..be59a74b4 --- /dev/null +++ b/.config/cspell/project-software-terms.txt @@ -0,0 +1,64 @@ +addoption # Dependency: pytest +allclose # Dependency: numpy +argtype # Standard library: ctypes +argtypes # Standard library: ctypes +ascontiguousarray # Dependency: numpy +autoinstall # Linux system tool names (external) +byref # Standard library: ctypes +callspec # Dependency: pytest +caplog # Dependency: pytest +cdecl # C calling convention name (used in codegen) +chkconfig # Linux system tool names (external) +codegen # codegen internals +ctypes # Standard library: ctypes +ctypeslib # Standard library: ctypes +CVICALLBACK # NI CVI calling convention macro (C interop comment) +docstrings # Python terminology +dotenv # Dependency: python-decouple / dotenv +dotenvpath # Typo - TODO - rename the files and make related changes +dpkg # Linux system tool names (external) +dtype # Dependency: numpy +fixturenames # Dependency: pytest +frombuffer # Dependency: numpy +getfixturevalue # Dependency: pytest +grpcdevice # NI package name; ni-grpcdevice +hightime # Dependency: hightime +htmlcov # Python tooling (directory/artifact names, not real words) +iinfo # Dependency: numpy +insserv # Linux system tool names (external) +installdriver # CLI command name and corresponding function +localzone # Dependency: tzlocal +matplotlib # Dependency: matplotlib +metafunc # Dependency: pytest +modifyitems # Dependency: pytest +nbytes # Dependency: numpy +ndarray # Dependency: numpy +ndpointer # Dependency: numpy +NISHAREDDIR # NI Linux install directory environment variable +nicai # NI-DAQmx C library filename (Windows DLL) +nicaiu # NI-DAQmx C library filename (Windows DLL, Unicode) +nidevice # NI package name; ni-device-grpc +nitypes # Dependency: nitypes +nptdms # Dependency: nptdms +numpy # Dependency: numpy +parametrizing # Dependency: pytest +printoptions # Dependency: numpy +protoc # Tool name: protobuf compiler +pycache # Python tooling (directory/artifact names, not real words) +pykka # Dependency: pykka +pyplot # Dependency: matplotlib +pytest # Dependency: pytest +rtol # Dependency: numpy +scrapigen # codegen internals +styleguide # ni-python-styleguide linting tool +sint # Protobuf type; signed integer +tobytes # Dependency: numpy +tolist # Dependency: numpy +typeshed # Python type stubs repository (mypy/pyright tooling) +unraisable # Dependency: pytest +unraisablehook # Dependency: pytest +ulonglong # C type: unsigned long long +varargs # Standard library: ctypes +venv # Python tooling (directory/artifact names, not real words) +xlabel # Dependency: matplotlib +ylabel # Dependency: matplotlib diff --git a/.config/cspell/real-words.txt b/.config/cspell/real-words.txt new file mode 100644 index 000000000..e4ff1545c --- /dev/null +++ b/.config/cspell/real-words.txt @@ -0,0 +1,76 @@ +autozero # Electronic instrumentation term +backplane # Digital electronics and computer engineering term +bandpass # Filter term +bitfield # Computing term; contiguous range of bits in a value +bitfields # Computing term; contiguous range of bits in a value +bitstream # Computing term; sequence of bits transmitted serially +brickwall # Filter term +Butterworth # Scientist name; Butterworth filter +cDAQ # CompactDAQ (NI hardware platform) +Callendar # Physicist name; Callendar-Van Dusen equation +CPLD # Complex Programmable Logic Device +DAQmx # Data Acquisition Measurement Extensions +deassert # Digital electronics and computer engineering term +deasserting # Digital electronics and computer engineering term +deasserts # Digital electronics and computer engineering term +deleters # Software term +DKMS # Dynamic Kernel Module Support +Dusen # Physicist name; Van Dusen of Callendar-Van Dusen equation +EEPROM # Electrically Erasable Programmable Read-Only Memory +HDOP # Horizontal Dilution of Precision (GPS) +highpass # Filter term +HWCU # Hardware Configuration Utility +IEPE # Integrated Electronics Piezo-Electric +IRIG # Inter-Range Instrumentation Group +jumpered # Electronics term +lowpass # Filter term +LVDT # Linear Variable Differential Transformer +LVTTL # Low Voltage Transistor-Transistor Logic +MBCS # Multi-Byte Character Set +MDNS # Multicast DNS +MeasurementLink # NI product name +micropascals # Unit of pressure +mioDAQ # NI product category +milli # SI prefix +multibyte # Computing term; character encoding using multiple bytes +NIELVIS # NI product name; NI ELVIS +nonprintable # Computing term +overcurrent # Electrical engineering term +overrange # Measurement term; signal exceeding the measurable range +overread # Data acquisition term +overtemperature # Electrical/safety term; exceeding a temperature limit +overvoltage # Electrical engineering term +PDOP # Position Dilution of Precision (GPS) +pico # SI prefix +powerline # Electrical engineering term +powerup # Electronics term +pseudodifferential # Electronics measurement term +PXIe # PCI eXtensions for Instrumentation, Express variant +ratiometric # Electronics measurement term +RDMA # Remote Direct Memory Access +readall # Software term; read all available data +reglitch # Electronics DAC term +reglitching # Electronics DAC term (gerund) +replug # Hardware term +retriggerable # Electronics term; able to be triggered again before previous cycle ends +RTSI # Real-Time System Integration +RVDT # Rotary Variable Differential Transformer +SCXI # Signal Conditioning eXtensions for Instrumentation +Steinhart # Physicist name; Steinhart-Hart thermistor equation +stopband # Filter term +subsecond # Time measurement term; less than one second +subseconds # Time measurement term; less than one second +TDMS # Technical Data Management Streaming +timebase # Electronics term; reference clock signal +timebases # Electronics term +tristated # Electronics term +tristates # Electronics term (verb/noun) +unflatten # Software term; deserialize/reconstruct nested data +unloadable # Computing term +unreserve # Software term; release a reserved resource +unreserves # Software term; release a reserved resource +VCXO # Voltage-Controlled Crystal Oscillator +VDOP # Vertical Dilution of Precision (GPS) +yoctosecond # Unit of time; SI prefix +yoctoseconds # Unit of time; SI prefix + diff --git a/.config/cspell/sphinx-directives.txt b/.config/cspell/sphinx-directives.txt new file mode 100644 index 000000000..db70ba503 --- /dev/null +++ b/.config/cspell/sphinx-directives.txt @@ -0,0 +1,11 @@ +# Sphinx directive names and option values flagged by cspell in this project's .rst files. +# This is not an exhaustive list of Sphinx directives — only words that cspell does not +# recognize from its built-in dictionaries and that appear in docs/ are included here. +automodule +backlinks +bysource +currentmodule +genindex +modindex +toctree +undoc diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 86db1c71d..8c06e6871 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -32,6 +32,11 @@ jobs: install-args: "--all-extras --with examples" - name: Run Bandit security checks run: poetry run bandit -c pyproject.toml -r generated/nidaqmx + - name: Run cspell + uses: streetsidesoftware/cspell-action@v8 + with: + incremental_files_only: false + check_dot_files: explicit - name: Generate ni-daqmx files if: ${{ runner.os == 'Linux' && matrix.python-version == env.codegen-python-version }} run: | diff --git a/CHANGELOG.md b/CHANGELOG.md index e1fa07af5..72523f9f9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,32 +29,30 @@ All notable changes to this project will be documented in this file. ## 1.5.0 * ### Merged Pull Requests - * [Full changelog: 1.4.1...1.5.0](https://github.com/ni/nidaqmx-python/compare/1.4.1...1.5.0) + * [Full changelog: 1.4.1...1.5.0](https://github.com/ni/nidaqmx-python/compare/1.4.1...1.5.0) * ### Resolved Issues * [936: New example voltage_acq_int_clk_plot_wfm.py does not behave as expected](https://github.com/ni/nidaqmx-python/issues/936) * ### Major Changes - * ... - + * [cspell](https://cspell.org/) is now used for spell checking. * ### Known Issues - * ... + * ... ## 1.4.1 * ### Merged Pull Requests - * [Full changelog: 1.4.0...1.4.1](https://github.com/ni/nidaqmx-python/compare/1.4.0...1.4.1) + * [Full changelog: 1.4.0...1.4.1](https://github.com/ni/nidaqmx-python/compare/1.4.0...1.4.1) * ### Resolved Issues * ... * ### Major Changes - * Update installer metadata using DAQmx version 26.0.0 - + * Update installer metadata using DAQmx version 26.0.0 * ### Known Issues - * ... - + * ... + ## 1.4.0 * ### Merged Pull Requests * [Full changelog: 1.3.0...1.4.0](https://github.com/ni/nidaqmx-python/compare/1.3.0...1.4.0) @@ -62,6 +60,7 @@ All notable changes to this project will be documented in this file. * ### Resolved Issues * [24: Support Waveform Reads/Writes](https://github.com/ni/nidaqmx-python/issues/24) * [820: Create a synchronization example for TDMS logging](https://github.com/ni/nidaqmx-python/issues/820) + * [862: docs tox env fails on rdss-nidaqmxbot-win-10-py32](https://github.com/ni/nidaqmx-python/issues/862) * ### Major Changes @@ -178,8 +177,10 @@ All notable changes to this project will be documented in this file. * Add support for DAQmx calibration info properties * Add support for WaitForValidTimestamp * Fix naming issues: + * Rename `ShuntCalSelect.AAND_B` to `A_AND_B`. * Automate Driver Install Experience within nidaqmx Module + * Update libtime to accept time before 1970 * ### Known Issues @@ -283,6 +284,7 @@ All notable changes to this project will be documented in this file. * ### Resolved Issues * [37: ai_raw example is bad](https://github.com/ni/nidaqmx-python/issues/37) * [54: Linux supported?](https://github.com/ni/nidaqmx-python/issues/54) + * [64: nidaqmx-python and pynidaqmx projects use the same package name](https://github.com/ni/nidaqmx-python/issues/64) * [65: ci_count_edges.py REQUIRES A START COMMAND](https://github.com/ni/nidaqmx-python/issues/65) * [100: How to clear task and create a new task with same name?](https://github.com/ni/nidaqmx-python/issues/100) @@ -367,9 +369,10 @@ All notable changes to this project will be documented in this file. ## 0.5.2 * Initial public release of nidaqmx * Update setup.py description and fix issues 2, 3, 5, and 6 raised by Ed Page. + * Splitting joined acronyms AIADC, AIDC, AILVDT, AIRVDT and CITC. * Adding link to LICENSE file. - * Updating README.rst file in source directory to eliminate Sphinx domaindirectives and add link to documentation on + * Updating README.rst file in source directory to eliminate Sphinx domain directives and add link to documentation on readthedocs. ## 0.5.0 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index fa0ede477..5dc934e38 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -3,6 +3,7 @@ Contributions to **nidaqmx** are welcome from all! **nidaqmx** is managed via [git](https://git-scm.com), with the canonical upstream repository hosted + on [GitHub](http://developercertificate.org/). **nidaqmx** follows a pull-request model for development. If you wish to contribute, you will need @@ -33,8 +34,10 @@ pass. 9. Run `poetry run ni-python-styleguide lint` to check that the updated code follows NI's Python coding conventions. If this reports errors, first run `poetry run ni-python-styleguide fix` in order to sort imports and format the code with Black, then manually fix any remaining errors. + 10. Run `poetry run mypy` to statically type-check the updated code. -11. Send a GitHub Pull Request to the main repository's master branch. GitHub Pull Requests are the +11. Run `npx cspell "**" --no-progress` to check for spelling errors. This requires [Node.js](https://nodejs.org/) to be installed. +12. Send a GitHub Pull Request to the main repository's master branch. GitHub Pull Requests are the expected method of code collaboration on this project. # Testing @@ -50,7 +53,7 @@ requirements: - You can still run the tests without a physical X Series DAQ device, but some tests will be skipped. Before running the regression tests, import the appropriate NI MAX configuration files: -- ``tests\max_config\nidaqmxMaxConfig.ini``: Contains custom scales, global channels, simulated devices, +- ``tests\max_config\nidaqmxMaxConfig.ini``: Contains custom scales, global channels, simulated devices, and tasks used by many regression tests. - **Note:** On Linux, use ``tests\max_config\linux\nidaqmxMaxConfig.ini`` to avoid importing an unsupported device. - ``tests\max_config\examplesMaxConfig.ini``: Contains simulated devices used by the example programs. @@ -72,7 +75,7 @@ commands in the root of the distribution: ```sh $ poetry run tox ``` - + This requires you to have all the Python interpreters supported by **nidaqmx** installed on your machine. @@ -109,7 +112,7 @@ $ poetry run sphinx-build -b html docs docs\_build # Branching Policy -Active development for the next release occurs on the `master` branch. +Active development for the next release occurs on the `master` branch. During finalization, we create a release branch (e.g. `releases/1.2`) in order to control which changes target the imminent release vs. the next release after that. Changes that are intended for both the imminent release and subsequent releases @@ -134,9 +137,11 @@ can be verified once that has been completed. * **Description:** Contents of the `CHANGELOG.md` for the version being released. Publishing a release automatically triggers the [publish.yml](./.github/workflows/publish.yml) + workflow, which checks and builds the package, requests approval to publish it using the `pypi` deployment environment, publishes the package to PyPI using [Trusted Publishing](https://docs.pypi.org/trusted-publishers/), and creates a PR to update the version of + **nidaqmx** in `pyproject.toml`. 6. GitHub contacts the approvers for the `pypi` deployment environment, who are currently the repo admins. One of them must approve the deployment for the publishing to proceed. diff --git a/examples/playrec.py b/examples/playrec.py index f1462d93c..b7a8bc57c 100644 --- a/examples/playrec.py +++ b/examples/playrec.py @@ -16,15 +16,15 @@ def query_devices(): print("Output channels:", [chan.name for chan in device.ao_physical_chans]) -def playrec(data, samplerate, input_mapping, output_mapping): +def play_record(data, sample_rate, input_mapping, output_mapping): """Simultaneous playback and recording though NI device. Parameters: ----------- - data: array_like, shape (nsamples, len(output_mapping)) + data: array_like, shape (num_samples, len(output_mapping)) Data to be send to output channels. - samplerate: int - Samplerate + sample_rate: int + Sample rate input_mapping: list of str Input device channels output_mapping: list of str @@ -32,33 +32,33 @@ def playrec(data, samplerate, input_mapping, output_mapping): Returns ------- - ndarray, shape (nsamples, len(input_mapping)) + ndarray, shape (num_samples, len(input_mapping)) Recorded data """ devices = nidaqmx.system.System.local().devices data = np.asarray(data).T - nsamples = data.shape[1] + num_samples = data.shape[1] with nidaqmx.Task() as read_task, nidaqmx.Task() as write_task: for i, o in enumerate(output_mapping): - aochan = write_task.ao_channels.add_ao_voltage_chan( + ao_channel = write_task.ao_channels.add_ao_voltage_chan( o, min_val=devices[o].ao_voltage_rngs[0], max_val=devices[o].ao_voltage_rngs[1], ) min_data, max_data = np.min(data[i]), np.max(data[i]) - if ((max_data > aochan.ao_max) | (min_data < aochan.ao_min)).any(): + if ((max_data > ao_channel.ao_max) | (min_data < ao_channel.ao_min)).any(): raise ValueError( f"Data range ({min_data:.2f}, {max_data:.2f}) exceeds output range of " - f"{o} ({aochan.ao_min:.2f}, {aochan.ao_max:.2f})." + f"{o} ({ao_channel.ao_min:.2f}, {ao_channel.ao_max:.2f})." ) for i in input_mapping: read_task.ai_channels.add_ai_voltage_chan(i) for task in (read_task, write_task): task.timing.cfg_samp_clk_timing( - rate=samplerate, source="OnboardClock", samps_per_chan=nsamples + rate=sample_rate, source="OnboardClock", samps_per_chan=num_samples ) # trigger write_task as soon as read_task starts @@ -70,9 +70,9 @@ def playrec(data, samplerate, input_mapping, output_mapping): # write_task doesn't start at read_task's start_trigger without this write_task.start() # do not time out for long inputs - indata = read_task.read(nsamples, timeout=WAIT_INFINITELY) + input_data = read_task.read(num_samples, timeout=WAIT_INFINITELY) - return np.asarray(indata).T + return np.asarray(input_data).T if __name__ == "__main__": @@ -84,9 +84,9 @@ def playrec(data, samplerate, input_mapping, output_mapping): # excite through one output and record at three inputs outdata = np.random.normal(size=(5000, 1)) * 0.01 - indata = playrec( + input_data = play_record( outdata, - samplerate=96000, + sample_rate=96000, input_mapping=["Dev2/ai0", "Dev2/ai1", "Dev2/ai2"], output_mapping=["Dev2/ao0"], ) diff --git a/generated/nidaqmx/_grpc_interpreter.py b/generated/nidaqmx/_grpc_interpreter.py index 688585276..38782fe17 100644 --- a/generated/nidaqmx/_grpc_interpreter.py +++ b/generated/nidaqmx/_grpc_interpreter.py @@ -3850,7 +3850,7 @@ def _assign_numpy_array(numpy_array, grpc_array): Assigns grpc array to numpy array maintaining the original shape. Checks for the instance of grpc_array with bytes, if validated to True, - the numpy array is assigned to a 1D array of the grpc arrray. + the numpy array is assigned to a 1D array of the grpc array. """ grpc_array_size = len(grpc_array) if isinstance(grpc_array, bytes): diff --git a/generated/nidaqmx/_install_daqmx.py b/generated/nidaqmx/_install_daqmx.py index 4a30e42c2..68ce913a7 100644 --- a/generated/nidaqmx/_install_daqmx.py +++ b/generated/nidaqmx/_install_daqmx.py @@ -302,7 +302,7 @@ def _install_daqmx_driver_linux_core(download_url: str, release: str) -> None: def _validate_download_url(download_url: str) -> None: - """Velidate that the download URL uses https and points to a trusted site.""" + """Validate that the download URL uses https and points to a trusted site.""" parsed_url = urlparse(download_url) if parsed_url.scheme != "https" or parsed_url.netloc != "download.ni.com": raise click.ClickException(f"Unsupported download URL: {download_url}") diff --git a/generated/nidaqmx/_lib.py b/generated/nidaqmx/_lib.py index 8fccba52b..87e390223 100644 --- a/generated/nidaqmx/_lib.py +++ b/generated/nidaqmx/_lib.py @@ -102,12 +102,12 @@ def __getattr__( # noqa: D105 - Missing docstring in magic method (auto-generat self, function ): try: - cfunc = getattr(self._library, function) - if not hasattr(cfunc, "arglock"): + c_func = getattr(self._library, function) + if not hasattr(c_func, "arg_lock"): with self._lib_lock: - if not hasattr(cfunc, "arglock"): - cfunc.arglock = threading.Lock() - return cfunc + if not hasattr(c_func, "arg_lock"): + c_func.arg_lock = threading.Lock() + return c_func except AttributeError: raise DaqFunctionNotSupportedError(_FUNCTION_NOT_SUPPORTED_MESSAGE.format(function)) @@ -188,9 +188,9 @@ def _import_lib(self): if sys.platform.startswith("win"): - def _load_lib(libname: str): - windll = ctypes.windll.LoadLibrary(libname) - cdll = ctypes.cdll.LoadLibrary(libname) + def _load_lib(library_name: str): + windll = ctypes.windll.LoadLibrary(library_name) + cdll = ctypes.cdll.LoadLibrary(library_name) return windll, cdll # Feature Toggle to load nicaiu.dll or nicai_utf8.dll diff --git a/generated/nidaqmx/_library_interpreter.py b/generated/nidaqmx/_library_interpreter.py index 344aa1f85..549d8b41f 100644 --- a/generated/nidaqmx/_library_interpreter.py +++ b/generated/nidaqmx/_library_interpreter.py @@ -105,43 +105,43 @@ def driver_version(self): def add_cdaq_sync_connection(self, port_list): - cfunc = lib_importer.windll.DAQmxAddCDAQSyncConnection - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxAddCDAQSyncConnection + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ ctypes_byte_str] - error_code = cfunc( + error_code = c_func( port_list) self.check_for_error(error_code) def add_global_chans_to_task(self, task, channel_names): - cfunc = lib_importer.windll.DAQmxAddGlobalChansToTask - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxAddGlobalChansToTask + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes_byte_str] - error_code = cfunc( + error_code = c_func( task, channel_names) self.check_for_error(error_code) def add_network_device( self, ip_address, device_name, attempt_reservation, timeout): - cfunc = lib_importer.windll.DAQmxAddNetworkDevice - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxAddNetworkDevice + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ ctypes_byte_str, ctypes_byte_str, c_bool32, ctypes.c_double, ctypes.c_char_p, ctypes.c_uint] temp_size = 0 while True: device_name_out = ctypes.create_string_buffer(temp_size) - size_or_code = cfunc( + size_or_code = c_func( ip_address, device_name, attempt_reservation, timeout, device_name_out, temp_size) if is_string_buffer_too_small(size_or_code): @@ -159,15 +159,15 @@ def are_configured_cdaq_sync_ports_disconnected( self, chassis_devices_ports, timeout): disconnected_ports_exist = c_bool32() - cfunc = lib_importer.windll.DAQmxAreConfiguredCDAQSyncPortsDisconnected - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxAreConfiguredCDAQSyncPortsDisconnected + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ ctypes_byte_str, ctypes.c_double, ctypes.POINTER(c_bool32)] - error_code = cfunc( + error_code = c_func( chassis_devices_ports, timeout, ctypes.byref(disconnected_ports_exist)) self.check_for_error(error_code) @@ -175,14 +175,14 @@ def are_configured_cdaq_sync_ports_disconnected( def auto_configure_cdaq_sync_connections( self, chassis_devices_ports, timeout): - cfunc = lib_importer.windll.DAQmxAutoConfigureCDAQSyncConnections - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxAutoConfigureCDAQSyncConnections + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ ctypes_byte_str, ctypes.c_double] - error_code = cfunc( + error_code = c_func( chassis_devices_ports, timeout) self.check_for_error(error_code) @@ -192,18 +192,18 @@ def calculate_reverse_poly_coeff( size = len(forward_coeffs) if reverse_poly_order < 0 else reverse_poly_order + 1 reverse_coeffs = numpy.zeros(size, dtype=numpy.float64) - cfunc = lib_importer.windll.DAQmxCalculateReversePolyCoeff - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxCalculateReversePolyCoeff + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ wrapped_ndpointer(dtype=numpy.float64, flags=('C')), ctypes.c_uint, ctypes.c_double, ctypes.c_double, ctypes.c_int, ctypes.c_int, wrapped_ndpointer(dtype=numpy.float64, flags=('C','W'))] - error_code = cfunc( + error_code = c_func( forward_coeffs, len(forward_coeffs), min_val_x, max_val_x, num_points_to_compute, reverse_poly_order, reverse_coeffs) self.check_for_error(error_code) @@ -212,47 +212,47 @@ def calculate_reverse_poly_coeff( def cfg_anlg_edge_ref_trig( self, task, trigger_source, pretrigger_samples, trigger_slope, trigger_level): - cfunc = lib_importer.windll.DAQmxCfgAnlgEdgeRefTrig - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxCfgAnlgEdgeRefTrig + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes_byte_str, ctypes.c_int, ctypes.c_double, ctypes.c_uint] - error_code = cfunc( + error_code = c_func( task, trigger_source, trigger_slope, trigger_level, pretrigger_samples) self.check_for_error(error_code) def cfg_anlg_edge_start_trig( self, task, trigger_source, trigger_slope, trigger_level): - cfunc = lib_importer.windll.DAQmxCfgAnlgEdgeStartTrig - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxCfgAnlgEdgeStartTrig + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes_byte_str, ctypes.c_int, ctypes.c_double] - error_code = cfunc( + error_code = c_func( task, trigger_source, trigger_slope, trigger_level) self.check_for_error(error_code) def cfg_anlg_multi_edge_ref_trig( self, task, trigger_sources, pretrigger_samples, trigger_slope_array, trigger_level_array): - cfunc = lib_importer.windll.DAQmxCfgAnlgMultiEdgeRefTrig - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxCfgAnlgMultiEdgeRefTrig + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes_byte_str, wrapped_ndpointer(dtype=numpy.int32, flags=('C')), wrapped_ndpointer(dtype=numpy.float64, flags=('C')), ctypes.c_uint32, ctypes.c_uint] - error_code = cfunc( + error_code = c_func( task, trigger_sources, trigger_slope_array, trigger_level_array, pretrigger_samples, len(trigger_level_array)) self.check_for_error(error_code) @@ -260,17 +260,17 @@ def cfg_anlg_multi_edge_ref_trig( def cfg_anlg_multi_edge_start_trig( self, task, trigger_sources, trigger_slope_array, trigger_level_array): - cfunc = lib_importer.windll.DAQmxCfgAnlgMultiEdgeStartTrig - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxCfgAnlgMultiEdgeStartTrig + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes_byte_str, wrapped_ndpointer(dtype=numpy.int32, flags=('C')), wrapped_ndpointer(dtype=numpy.float64, flags=('C')), ctypes.c_uint] - error_code = cfunc( + error_code = c_func( task, trigger_sources, trigger_slope_array, trigger_level_array, len(trigger_level_array)) self.check_for_error(error_code) @@ -278,16 +278,16 @@ def cfg_anlg_multi_edge_start_trig( def cfg_anlg_window_ref_trig( self, task, trigger_source, window_top, window_bottom, pretrigger_samples, trigger_when): - cfunc = lib_importer.windll.DAQmxCfgAnlgWindowRefTrig - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxCfgAnlgWindowRefTrig + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes_byte_str, ctypes.c_int, ctypes.c_double, ctypes.c_double, ctypes.c_uint] - error_code = cfunc( + error_code = c_func( task, trigger_source, trigger_when, window_top, window_bottom, pretrigger_samples) self.check_for_error(error_code) @@ -295,15 +295,15 @@ def cfg_anlg_window_ref_trig( def cfg_anlg_window_start_trig( self, task, window_top, window_bottom, trigger_source, trigger_when): - cfunc = lib_importer.windll.DAQmxCfgAnlgWindowStartTrig - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxCfgAnlgWindowStartTrig + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes_byte_str, ctypes.c_int, ctypes.c_double, ctypes.c_double] - error_code = cfunc( + error_code = c_func( task, trigger_source, trigger_when, window_top, window_bottom) self.check_for_error(error_code) @@ -311,16 +311,16 @@ def cfg_burst_handshaking_timing_export_clock( self, task, sample_clk_rate, sample_clk_outp_term, sample_mode, samps_per_chan, sample_clk_pulse_polarity, pause_when, ready_event_active_level): - cfunc = lib_importer.windll.DAQmxCfgBurstHandshakingTimingExportClock - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxCfgBurstHandshakingTimingExportClock + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes.c_int, ctypes.c_ulonglong, ctypes.c_double, ctypes_byte_str, ctypes.c_int, ctypes.c_int, ctypes.c_int] - error_code = cfunc( + error_code = c_func( task, sample_mode, samps_per_chan, sample_clk_rate, sample_clk_outp_term, sample_clk_pulse_polarity, pause_when, ready_event_active_level) @@ -330,16 +330,16 @@ def cfg_burst_handshaking_timing_import_clock( self, task, sample_clk_rate, sample_clk_src, sample_mode, samps_per_chan, sample_clk_active_edge, pause_when, ready_event_active_level): - cfunc = lib_importer.windll.DAQmxCfgBurstHandshakingTimingImportClock - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxCfgBurstHandshakingTimingImportClock + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes.c_int, ctypes.c_ulonglong, ctypes.c_double, ctypes_byte_str, ctypes.c_int, ctypes.c_int, ctypes.c_int] - error_code = cfunc( + error_code = c_func( task, sample_mode, samps_per_chan, sample_clk_rate, sample_clk_src, sample_clk_active_edge, pause_when, ready_event_active_level) @@ -348,265 +348,265 @@ def cfg_burst_handshaking_timing_import_clock( def cfg_change_detection_timing( self, task, rising_edge_chan, falling_edge_chan, sample_mode, samps_per_chan): - cfunc = lib_importer.windll.DAQmxCfgChangeDetectionTiming - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxCfgChangeDetectionTiming + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes_byte_str, ctypes_byte_str, ctypes.c_int, ctypes.c_ulonglong] - error_code = cfunc( + error_code = c_func( task, rising_edge_chan, falling_edge_chan, sample_mode, samps_per_chan) self.check_for_error(error_code) def cfg_dig_edge_ref_trig( self, task, trigger_source, pretrigger_samples, trigger_edge): - cfunc = lib_importer.windll.DAQmxCfgDigEdgeRefTrig - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxCfgDigEdgeRefTrig + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes_byte_str, ctypes.c_int, ctypes.c_uint] - error_code = cfunc( + error_code = c_func( task, trigger_source, trigger_edge, pretrigger_samples) self.check_for_error(error_code) def cfg_dig_edge_start_trig(self, task, trigger_source, trigger_edge): - cfunc = lib_importer.windll.DAQmxCfgDigEdgeStartTrig - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxCfgDigEdgeStartTrig + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes_byte_str, ctypes.c_int] - error_code = cfunc( + error_code = c_func( task, trigger_source, trigger_edge) self.check_for_error(error_code) def cfg_dig_pattern_ref_trig( self, task, trigger_source, trigger_pattern, pretrigger_samples, trigger_when): - cfunc = lib_importer.windll.DAQmxCfgDigPatternRefTrig - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxCfgDigPatternRefTrig + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes_byte_str, ctypes_byte_str, ctypes.c_int, ctypes.c_uint] - error_code = cfunc( + error_code = c_func( task, trigger_source, trigger_pattern, trigger_when, pretrigger_samples) self.check_for_error(error_code) def cfg_dig_pattern_start_trig( self, task, trigger_source, trigger_pattern, trigger_when): - cfunc = lib_importer.windll.DAQmxCfgDigPatternStartTrig - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxCfgDigPatternStartTrig + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes_byte_str, ctypes_byte_str, ctypes.c_int] - error_code = cfunc( + error_code = c_func( task, trigger_source, trigger_pattern, trigger_when) self.check_for_error(error_code) def cfg_handshaking_timing(self, task, sample_mode, samps_per_chan): - cfunc = lib_importer.windll.DAQmxCfgHandshakingTiming - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxCfgHandshakingTiming + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes.c_int, ctypes.c_ulonglong] - error_code = cfunc( + error_code = c_func( task, sample_mode, samps_per_chan) self.check_for_error(error_code) def cfg_implicit_timing(self, task, sample_mode, samps_per_chan): - cfunc = lib_importer.windll.DAQmxCfgImplicitTiming - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxCfgImplicitTiming + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes.c_int, ctypes.c_ulonglong] - error_code = cfunc( + error_code = c_func( task, sample_mode, samps_per_chan) self.check_for_error(error_code) def cfg_pipelined_samp_clk_timing( self, task, rate, source, active_edge, sample_mode, samps_per_chan): - cfunc = lib_importer.windll.DAQmxCfgPipelinedSampClkTiming - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxCfgPipelinedSampClkTiming + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes_byte_str, ctypes.c_double, ctypes.c_int, ctypes.c_int, ctypes.c_ulonglong] - error_code = cfunc( + error_code = c_func( task, source, rate, active_edge, sample_mode, samps_per_chan) self.check_for_error(error_code) def cfg_samp_clk_timing( self, task, rate, source, active_edge, sample_mode, samps_per_chan): - cfunc = lib_importer.windll.DAQmxCfgSampClkTiming - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxCfgSampClkTiming + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes_byte_str, ctypes.c_double, ctypes.c_int, ctypes.c_int, ctypes.c_ulonglong] - error_code = cfunc( + error_code = c_func( task, source, rate, active_edge, sample_mode, samps_per_chan) self.check_for_error(error_code) def cfg_time_start_trig(self, task, when, timescale): - cfunc = lib_importer.windll.DAQmxCfgTimeStartTrig - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxCfgTimeStartTrig + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, AbsoluteTime, ctypes.c_int] - error_code = cfunc( + error_code = c_func( task, AbsoluteTime.from_datetime(when), timescale) self.check_for_error(error_code) def cfg_watchdog_ao_expir_states( self, task, channel_names, expir_state_array, output_type_array): - cfunc = lib_importer.windll.DAQmxCfgWatchdogAOExpirStates - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxCfgWatchdogAOExpirStates + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes_byte_str, wrapped_ndpointer(dtype=numpy.float64, flags=('C')), wrapped_ndpointer(dtype=numpy.int32, flags=('C')), ctypes.c_uint] - error_code = cfunc( + error_code = c_func( task, channel_names, expir_state_array, output_type_array, len(output_type_array)) self.check_for_error(error_code) def cfg_watchdog_co_expir_states( self, task, channel_names, expir_state_array): - cfunc = lib_importer.windll.DAQmxCfgWatchdogCOExpirStates - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxCfgWatchdogCOExpirStates + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes_byte_str, wrapped_ndpointer(dtype=numpy.int32, flags=('C')), ctypes.c_uint] - error_code = cfunc( + error_code = c_func( task, channel_names, expir_state_array, len(expir_state_array)) self.check_for_error(error_code) def cfg_watchdog_do_expir_states( self, task, channel_names, expir_state_array): - cfunc = lib_importer.windll.DAQmxCfgWatchdogDOExpirStates - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxCfgWatchdogDOExpirStates + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes_byte_str, wrapped_ndpointer(dtype=numpy.int32, flags=('C')), ctypes.c_uint] - error_code = cfunc( + error_code = c_func( task, channel_names, expir_state_array, len(expir_state_array)) self.check_for_error(error_code) def clear_task(self, task): - cfunc = lib_importer.windll.DAQmxClearTask - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxClearTask + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle] - error_code = cfunc( + error_code = c_func( task) self.check_for_error(error_code) def clear_teds(self, physical_channel): - cfunc = lib_importer.windll.DAQmxClearTEDS - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxClearTEDS + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ ctypes_byte_str] - error_code = cfunc( + error_code = c_func( physical_channel) self.check_for_error(error_code) def configure_logging( self, task, file_path, logging_mode, group_name, operation): - cfunc = lib_importer.windll.DAQmxConfigureLogging - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxConfigureLogging + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes_byte_str, ctypes.c_int, ctypes_byte_str, ctypes.c_int] - error_code = cfunc( + error_code = c_func( task, file_path, logging_mode, group_name, operation) self.check_for_error(error_code) def configure_teds(self, physical_channel, file_path): - cfunc = lib_importer.windll.DAQmxConfigureTEDS - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxConfigureTEDS + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ ctypes_byte_str, ctypes_byte_str] - error_code = cfunc( + error_code = c_func( physical_channel, file_path) self.check_for_error(error_code) def connect_terms( self, source_terminal, destination_terminal, signal_modifiers): - cfunc = lib_importer.windll.DAQmxConnectTerms - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxConnectTerms + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ ctypes_byte_str, ctypes_byte_str, ctypes.c_int] - error_code = cfunc( + error_code = c_func( source_terminal, destination_terminal, signal_modifiers) self.check_for_error(error_code) def control_watchdog_task(self, task, action): - cfunc = lib_importer.windll.DAQmxControlWatchdogTask - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxControlWatchdogTask + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes.c_int] - error_code = cfunc( + error_code = c_func( task, action) self.check_for_error(error_code) @@ -615,18 +615,18 @@ def create_ai_accel4_wire_dc_voltage_chan( terminal_config, min_val, max_val, units, sensitivity, sensitivity_units, voltage_excit_source, voltage_excit_val, use_excit_for_scaling, custom_scale_name): - cfunc = lib_importer.windll.DAQmxCreateAIAccel4WireDCVoltageChan - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxCreateAIAccel4WireDCVoltageChan + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes_byte_str, ctypes_byte_str, ctypes.c_int, ctypes.c_double, ctypes.c_double, ctypes.c_int, ctypes.c_double, ctypes.c_int, ctypes.c_int, ctypes.c_double, c_bool32, ctypes_byte_str] - error_code = cfunc( + error_code = c_func( task, physical_channel, name_to_assign_to_channel, terminal_config, min_val, max_val, units, sensitivity, sensitivity_units, voltage_excit_source, voltage_excit_val, @@ -638,18 +638,18 @@ def create_ai_accel_chan( terminal_config, min_val, max_val, units, sensitivity, sensitivity_units, current_excit_source, current_excit_val, custom_scale_name): - cfunc = lib_importer.windll.DAQmxCreateAIAccelChan - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxCreateAIAccelChan + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes_byte_str, ctypes_byte_str, ctypes.c_int, ctypes.c_double, ctypes.c_double, ctypes.c_int, ctypes.c_double, ctypes.c_int, ctypes.c_int, ctypes.c_double, ctypes_byte_str] - error_code = cfunc( + error_code = c_func( task, physical_channel, name_to_assign_to_channel, terminal_config, min_val, max_val, units, sensitivity, sensitivity_units, current_excit_source, current_excit_val, @@ -660,17 +660,17 @@ def create_ai_accel_charge_chan( self, task, physical_channel, name_to_assign_to_channel, terminal_config, min_val, max_val, units, sensitivity, sensitivity_units, custom_scale_name): - cfunc = lib_importer.windll.DAQmxCreateAIAccelChargeChan - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxCreateAIAccelChargeChan + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes_byte_str, ctypes_byte_str, ctypes.c_int, ctypes.c_double, ctypes.c_double, ctypes.c_int, ctypes.c_double, ctypes.c_int, ctypes_byte_str] - error_code = cfunc( + error_code = c_func( task, physical_channel, name_to_assign_to_channel, terminal_config, min_val, max_val, units, sensitivity, sensitivity_units, custom_scale_name) @@ -680,17 +680,17 @@ def create_ai_bridge_chan( self, task, physical_channel, name_to_assign_to_channel, min_val, max_val, units, bridge_config, voltage_excit_source, voltage_excit_val, nominal_bridge_resistance, custom_scale_name): - cfunc = lib_importer.windll.DAQmxCreateAIBridgeChan - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxCreateAIBridgeChan + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes_byte_str, ctypes_byte_str, ctypes.c_double, ctypes.c_double, ctypes.c_int, ctypes.c_int, ctypes.c_int, ctypes.c_double, ctypes.c_double, ctypes_byte_str] - error_code = cfunc( + error_code = c_func( task, physical_channel, name_to_assign_to_channel, min_val, max_val, units, bridge_config, voltage_excit_source, voltage_excit_val, nominal_bridge_resistance, custom_scale_name) @@ -701,18 +701,18 @@ def create_ai_calculated_power_chan( name_to_assign_to_channel, terminal_config, voltage_min_val, voltage_max_val, current_min_val, current_max_val, units, shunt_resistor_loc, ext_shunt_resistor_val, custom_scale_name): - cfunc = lib_importer.windll.DAQmxCreateAICalculatedPowerChan - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxCreateAICalculatedPowerChan + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes_byte_str, ctypes_byte_str, ctypes_byte_str, ctypes.c_int, ctypes.c_double, ctypes.c_double, ctypes.c_double, ctypes.c_double, ctypes.c_int, ctypes.c_int, ctypes.c_double, ctypes_byte_str] - error_code = cfunc( + error_code = c_func( task, voltage_physical_channel, current_physical_channel, name_to_assign_to_channel, terminal_config, voltage_min_val, voltage_max_val, current_min_val, current_max_val, units, @@ -722,16 +722,16 @@ def create_ai_calculated_power_chan( def create_ai_charge_chan( self, task, physical_channel, name_to_assign_to_channel, terminal_config, min_val, max_val, units, custom_scale_name): - cfunc = lib_importer.windll.DAQmxCreateAIChargeChan - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxCreateAIChargeChan + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes_byte_str, ctypes_byte_str, ctypes.c_int, ctypes.c_double, ctypes.c_double, ctypes.c_int, ctypes_byte_str] - error_code = cfunc( + error_code = c_func( task, physical_channel, name_to_assign_to_channel, terminal_config, min_val, max_val, units, custom_scale_name) self.check_for_error(error_code) @@ -740,17 +740,17 @@ def create_ai_current_chan( self, task, physical_channel, name_to_assign_to_channel, terminal_config, min_val, max_val, units, shunt_resistor_loc, ext_shunt_resistor_val, custom_scale_name): - cfunc = lib_importer.windll.DAQmxCreateAICurrentChan - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxCreateAICurrentChan + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes_byte_str, ctypes_byte_str, ctypes.c_int, ctypes.c_double, ctypes.c_double, ctypes.c_int, ctypes.c_int, ctypes.c_double, ctypes_byte_str] - error_code = cfunc( + error_code = c_func( task, physical_channel, name_to_assign_to_channel, terminal_config, min_val, max_val, units, shunt_resistor_loc, ext_shunt_resistor_val, custom_scale_name) @@ -760,17 +760,17 @@ def create_ai_current_rms_chan( self, task, physical_channel, name_to_assign_to_channel, terminal_config, min_val, max_val, units, shunt_resistor_loc, ext_shunt_resistor_val, custom_scale_name): - cfunc = lib_importer.windll.DAQmxCreateAICurrentRMSChan - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxCreateAICurrentRMSChan + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes_byte_str, ctypes_byte_str, ctypes.c_int, ctypes.c_double, ctypes.c_double, ctypes.c_int, ctypes.c_int, ctypes.c_double, ctypes_byte_str] - error_code = cfunc( + error_code = c_func( task, physical_channel, name_to_assign_to_channel, terminal_config, min_val, max_val, units, shunt_resistor_loc, ext_shunt_resistor_val, custom_scale_name) @@ -782,11 +782,11 @@ def create_ai_force_bridge_polynomial_chan( voltage_excit_val, nominal_bridge_resistance, forward_coeffs, reverse_coeffs, electrical_units, physical_units, custom_scale_name): - cfunc = lib_importer.windll.DAQmxCreateAIForceBridgePolynomialChan - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxCreateAIForceBridgePolynomialChan + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes_byte_str, ctypes_byte_str, ctypes.c_double, ctypes.c_double, ctypes.c_int, ctypes.c_int, ctypes.c_int, @@ -796,7 +796,7 @@ def create_ai_force_bridge_polynomial_chan( flags=('C')), ctypes.c_uint, ctypes.c_int, ctypes.c_int, ctypes_byte_str] - error_code = cfunc( + error_code = c_func( task, physical_channel, name_to_assign_to_channel, min_val, max_val, units, bridge_config, voltage_excit_source, voltage_excit_val, nominal_bridge_resistance, forward_coeffs, @@ -810,11 +810,11 @@ def create_ai_force_bridge_table_chan( voltage_excit_val, nominal_bridge_resistance, electrical_vals, electrical_units, physical_vals, physical_units, custom_scale_name): - cfunc = lib_importer.windll.DAQmxCreateAIForceBridgeTableChan - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxCreateAIForceBridgeTableChan + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes_byte_str, ctypes_byte_str, ctypes.c_double, ctypes.c_double, ctypes.c_int, ctypes.c_int, ctypes.c_int, @@ -824,7 +824,7 @@ def create_ai_force_bridge_table_chan( wrapped_ndpointer(dtype=numpy.float64, flags=('C')), ctypes.c_uint, ctypes.c_int, ctypes_byte_str] - error_code = cfunc( + error_code = c_func( task, physical_channel, name_to_assign_to_channel, min_val, max_val, units, bridge_config, voltage_excit_source, voltage_excit_val, nominal_bridge_resistance, electrical_vals, @@ -839,11 +839,11 @@ def create_ai_force_bridge_two_point_lin_chan( first_electrical_val, second_electrical_val, electrical_units, first_physical_val, second_physical_val, physical_units, custom_scale_name): - cfunc = lib_importer.windll.DAQmxCreateAIForceBridgeTwoPointLinChan - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxCreateAIForceBridgeTwoPointLinChan + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes_byte_str, ctypes_byte_str, ctypes.c_double, ctypes.c_double, ctypes.c_int, ctypes.c_int, ctypes.c_int, @@ -851,7 +851,7 @@ def create_ai_force_bridge_two_point_lin_chan( ctypes.c_double, ctypes.c_int, ctypes.c_double, ctypes.c_double, ctypes.c_int, ctypes_byte_str] - error_code = cfunc( + error_code = c_func( task, physical_channel, name_to_assign_to_channel, min_val, max_val, units, bridge_config, voltage_excit_source, voltage_excit_val, nominal_bridge_resistance, @@ -865,18 +865,18 @@ def create_ai_force_iepe_chan( terminal_config, min_val, max_val, units, sensitivity, sensitivity_units, current_excit_source, current_excit_val, custom_scale_name): - cfunc = lib_importer.windll.DAQmxCreateAIForceIEPEChan - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxCreateAIForceIEPEChan + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes_byte_str, ctypes_byte_str, ctypes.c_int, ctypes.c_double, ctypes.c_double, ctypes.c_int, ctypes.c_double, ctypes.c_int, ctypes.c_int, ctypes.c_double, ctypes_byte_str] - error_code = cfunc( + error_code = c_func( task, physical_channel, name_to_assign_to_channel, terminal_config, min_val, max_val, units, sensitivity, sensitivity_units, current_excit_source, current_excit_val, @@ -886,17 +886,17 @@ def create_ai_force_iepe_chan( def create_ai_freq_voltage_chan( self, task, physical_channel, name_to_assign_to_channel, min_val, max_val, units, threshold_level, hysteresis, custom_scale_name): - cfunc = lib_importer.windll.DAQmxCreateAIFreqVoltageChan - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxCreateAIFreqVoltageChan + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes_byte_str, ctypes_byte_str, ctypes.c_double, ctypes.c_double, ctypes.c_int, ctypes.c_double, ctypes.c_double, ctypes_byte_str] - error_code = cfunc( + error_code = c_func( task, physical_channel, name_to_assign_to_channel, min_val, max_val, units, threshold_level, hysteresis, custom_scale_name) self.check_for_error(error_code) @@ -905,17 +905,17 @@ def create_ai_microphone_chan( self, task, physical_channel, name_to_assign_to_channel, terminal_config, units, mic_sensitivity, max_snd_press_level, current_excit_source, current_excit_val, custom_scale_name): - cfunc = lib_importer.windll.DAQmxCreateAIMicrophoneChan - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxCreateAIMicrophoneChan + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes_byte_str, ctypes_byte_str, ctypes.c_int, ctypes.c_int, ctypes.c_double, ctypes.c_double, ctypes.c_int, ctypes.c_double, ctypes_byte_str] - error_code = cfunc( + error_code = c_func( task, physical_channel, name_to_assign_to_channel, terminal_config, units, mic_sensitivity, max_snd_press_level, current_excit_source, current_excit_val, custom_scale_name) @@ -925,17 +925,17 @@ def create_ai_pos_eddy_curr_prox_probe_chan( self, task, physical_channel, name_to_assign_to_channel, min_val, max_val, units, sensitivity, sensitivity_units, custom_scale_name): - cfunc = lib_importer.windll.DAQmxCreateAIPosEddyCurrProxProbeChan - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxCreateAIPosEddyCurrProxProbeChan + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes_byte_str, ctypes_byte_str, ctypes.c_double, ctypes.c_double, ctypes.c_int, ctypes.c_double, ctypes.c_int, ctypes_byte_str] - error_code = cfunc( + error_code = c_func( task, physical_channel, name_to_assign_to_channel, min_val, max_val, units, sensitivity, sensitivity_units, custom_scale_name) self.check_for_error(error_code) @@ -945,18 +945,18 @@ def create_ai_pos_lvdt_chan( max_val, units, sensitivity, sensitivity_units, voltage_excit_source, voltage_excit_val, voltage_excit_freq, ac_excit_wire_mode, custom_scale_name): - cfunc = lib_importer.windll.DAQmxCreateAIPosLVDTChan - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxCreateAIPosLVDTChan + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes_byte_str, ctypes_byte_str, ctypes.c_double, ctypes.c_double, ctypes.c_int, ctypes.c_double, ctypes.c_int, ctypes.c_int, ctypes.c_double, ctypes.c_double, ctypes.c_int, ctypes_byte_str] - error_code = cfunc( + error_code = c_func( task, physical_channel, name_to_assign_to_channel, min_val, max_val, units, sensitivity, sensitivity_units, voltage_excit_source, voltage_excit_val, voltage_excit_freq, @@ -968,18 +968,18 @@ def create_ai_pos_rvdt_chan( max_val, units, sensitivity, sensitivity_units, voltage_excit_source, voltage_excit_val, voltage_excit_freq, ac_excit_wire_mode, custom_scale_name): - cfunc = lib_importer.windll.DAQmxCreateAIPosRVDTChan - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxCreateAIPosRVDTChan + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes_byte_str, ctypes_byte_str, ctypes.c_double, ctypes.c_double, ctypes.c_int, ctypes.c_double, ctypes.c_int, ctypes.c_int, ctypes.c_double, ctypes.c_double, ctypes.c_int, ctypes_byte_str] - error_code = cfunc( + error_code = c_func( task, physical_channel, name_to_assign_to_channel, min_val, max_val, units, sensitivity, sensitivity_units, voltage_excit_source, voltage_excit_val, voltage_excit_freq, @@ -989,16 +989,16 @@ def create_ai_pos_rvdt_chan( def create_ai_power_chan( self, task, physical_channel, voltage_setpoint, current_setpoint, output_enable, name_to_assign_to_channel): - cfunc = lib_importer.windll.DAQmxCreateAIPowerChan - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxCreateAIPowerChan + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes_byte_str, ctypes_byte_str, ctypes.c_double, ctypes.c_double, c_bool32] - error_code = cfunc( + error_code = c_func( task, physical_channel, name_to_assign_to_channel, voltage_setpoint, current_setpoint, output_enable) self.check_for_error(error_code) @@ -1009,11 +1009,11 @@ def create_ai_pressure_bridge_polynomial_chan( voltage_excit_val, nominal_bridge_resistance, forward_coeffs, reverse_coeffs, electrical_units, physical_units, custom_scale_name): - cfunc = lib_importer.windll.DAQmxCreateAIPressureBridgePolynomialChan - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxCreateAIPressureBridgePolynomialChan + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes_byte_str, ctypes_byte_str, ctypes.c_double, ctypes.c_double, ctypes.c_int, ctypes.c_int, ctypes.c_int, @@ -1023,7 +1023,7 @@ def create_ai_pressure_bridge_polynomial_chan( flags=('C')), ctypes.c_uint, ctypes.c_int, ctypes.c_int, ctypes_byte_str] - error_code = cfunc( + error_code = c_func( task, physical_channel, name_to_assign_to_channel, min_val, max_val, units, bridge_config, voltage_excit_source, voltage_excit_val, nominal_bridge_resistance, forward_coeffs, @@ -1037,11 +1037,11 @@ def create_ai_pressure_bridge_table_chan( voltage_excit_val, nominal_bridge_resistance, electrical_vals, electrical_units, physical_vals, physical_units, custom_scale_name): - cfunc = lib_importer.windll.DAQmxCreateAIPressureBridgeTableChan - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxCreateAIPressureBridgeTableChan + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes_byte_str, ctypes_byte_str, ctypes.c_double, ctypes.c_double, ctypes.c_int, ctypes.c_int, ctypes.c_int, @@ -1051,7 +1051,7 @@ def create_ai_pressure_bridge_table_chan( wrapped_ndpointer(dtype=numpy.float64, flags=('C')), ctypes.c_uint, ctypes.c_int, ctypes_byte_str] - error_code = cfunc( + error_code = c_func( task, physical_channel, name_to_assign_to_channel, min_val, max_val, units, bridge_config, voltage_excit_source, voltage_excit_val, nominal_bridge_resistance, electrical_vals, @@ -1066,11 +1066,11 @@ def create_ai_pressure_bridge_two_point_lin_chan( first_electrical_val, second_electrical_val, electrical_units, first_physical_val, second_physical_val, physical_units, custom_scale_name): - cfunc = lib_importer.windll.DAQmxCreateAIPressureBridgeTwoPointLinChan - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxCreateAIPressureBridgeTwoPointLinChan + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes_byte_str, ctypes_byte_str, ctypes.c_double, ctypes.c_double, ctypes.c_int, ctypes.c_int, ctypes.c_int, @@ -1078,7 +1078,7 @@ def create_ai_pressure_bridge_two_point_lin_chan( ctypes.c_double, ctypes.c_int, ctypes.c_double, ctypes.c_double, ctypes.c_int, ctypes_byte_str] - error_code = cfunc( + error_code = c_func( task, physical_channel, name_to_assign_to_channel, min_val, max_val, units, bridge_config, voltage_excit_source, voltage_excit_val, nominal_bridge_resistance, @@ -1091,17 +1091,17 @@ def create_ai_resistance_chan( self, task, physical_channel, name_to_assign_to_channel, min_val, max_val, units, resistance_config, current_excit_source, current_excit_val, custom_scale_name): - cfunc = lib_importer.windll.DAQmxCreateAIResistanceChan - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxCreateAIResistanceChan + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes_byte_str, ctypes_byte_str, ctypes.c_double, ctypes.c_double, ctypes.c_int, ctypes.c_int, ctypes.c_int, ctypes.c_double, ctypes_byte_str] - error_code = cfunc( + error_code = c_func( task, physical_channel, name_to_assign_to_channel, min_val, max_val, units, resistance_config, current_excit_source, current_excit_val, custom_scale_name) @@ -1113,11 +1113,11 @@ def create_ai_rosette_strain_gage_chan( strain_config, voltage_excit_source, voltage_excit_val, gage_factor, nominal_gage_resistance, poisson_ratio, lead_wire_resistance): - cfunc = lib_importer.windll.DAQmxCreateAIRosetteStrainGageChan - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxCreateAIRosetteStrainGageChan + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes_byte_str, ctypes_byte_str, ctypes.c_double, ctypes.c_double, ctypes.c_int, ctypes.c_double, @@ -1126,7 +1126,7 @@ def create_ai_rosette_strain_gage_chan( ctypes.c_double, ctypes.c_double, ctypes.c_double, ctypes.c_double, ctypes.c_double] - error_code = cfunc( + error_code = c_func( task, physical_channel, name_to_assign_to_channel, min_val, max_val, rosette_type, gage_orientation, rosette_meas_types, len(rosette_meas_types), strain_config, voltage_excit_source, @@ -1140,11 +1140,11 @@ def create_ai_strain_gage_chan( voltage_excit_val, gage_factor, initial_bridge_voltage, nominal_gage_resistance, poisson_ratio, lead_wire_resistance, custom_scale_name): - cfunc = lib_importer.windll.DAQmxCreateAIStrainGageChan - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxCreateAIStrainGageChan + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes_byte_str, ctypes_byte_str, ctypes.c_double, ctypes.c_double, ctypes.c_int, ctypes.c_int, ctypes.c_int, @@ -1152,7 +1152,7 @@ def create_ai_strain_gage_chan( ctypes.c_double, ctypes.c_double, ctypes.c_double, ctypes_byte_str] - error_code = cfunc( + error_code = c_func( task, physical_channel, name_to_assign_to_channel, min_val, max_val, units, strain_config, voltage_excit_source, voltage_excit_val, gage_factor, initial_bridge_voltage, @@ -1162,15 +1162,15 @@ def create_ai_strain_gage_chan( def create_ai_temp_built_in_sensor_chan( self, task, physical_channel, name_to_assign_to_channel, units): - cfunc = lib_importer.windll.DAQmxCreateAITempBuiltInSensorChan - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxCreateAITempBuiltInSensorChan + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes_byte_str, ctypes_byte_str, ctypes.c_int] - error_code = cfunc( + error_code = c_func( task, physical_channel, name_to_assign_to_channel, units) self.check_for_error(error_code) @@ -1178,17 +1178,17 @@ def create_ai_thrmcpl_chan( self, task, physical_channel, name_to_assign_to_channel, min_val, max_val, units, thermocouple_type, cjc_source, cjc_val, cjc_channel): - cfunc = lib_importer.windll.DAQmxCreateAIThrmcplChan - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxCreateAIThrmcplChan + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes_byte_str, ctypes_byte_str, ctypes.c_double, ctypes.c_double, ctypes.c_int, ctypes.c_int, ctypes.c_int, ctypes.c_double, ctypes_byte_str] - error_code = cfunc( + error_code = c_func( task, physical_channel, name_to_assign_to_channel, min_val, max_val, units, thermocouple_type, cjc_source, cjc_val, cjc_channel) @@ -1198,18 +1198,18 @@ def create_ai_thrmstr_chan_iex( self, task, physical_channel, name_to_assign_to_channel, min_val, max_val, units, resistance_config, current_excit_source, current_excit_val, a, b, c): - cfunc = lib_importer.windll.DAQmxCreateAIThrmstrChanIex - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxCreateAIThrmstrChanIex + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes_byte_str, ctypes_byte_str, ctypes.c_double, ctypes.c_double, ctypes.c_int, ctypes.c_int, ctypes.c_int, ctypes.c_double, ctypes.c_double, ctypes.c_double, ctypes.c_double] - error_code = cfunc( + error_code = c_func( task, physical_channel, name_to_assign_to_channel, min_val, max_val, units, resistance_config, current_excit_source, current_excit_val, a, b, c) @@ -1219,18 +1219,18 @@ def create_ai_thrmstr_chan_vex( self, task, physical_channel, name_to_assign_to_channel, min_val, max_val, units, resistance_config, voltage_excit_source, voltage_excit_val, a, b, c, r_1): - cfunc = lib_importer.windll.DAQmxCreateAIThrmstrChanVex - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxCreateAIThrmstrChanVex + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes_byte_str, ctypes_byte_str, ctypes.c_double, ctypes.c_double, ctypes.c_int, ctypes.c_int, ctypes.c_int, ctypes.c_double, ctypes.c_double, ctypes.c_double, ctypes.c_double, ctypes.c_double] - error_code = cfunc( + error_code = c_func( task, physical_channel, name_to_assign_to_channel, min_val, max_val, units, resistance_config, voltage_excit_source, voltage_excit_val, a, b, c, r_1) @@ -1242,11 +1242,11 @@ def create_ai_torque_bridge_polynomial_chan( voltage_excit_val, nominal_bridge_resistance, forward_coeffs, reverse_coeffs, electrical_units, physical_units, custom_scale_name): - cfunc = lib_importer.windll.DAQmxCreateAITorqueBridgePolynomialChan - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxCreateAITorqueBridgePolynomialChan + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes_byte_str, ctypes_byte_str, ctypes.c_double, ctypes.c_double, ctypes.c_int, ctypes.c_int, ctypes.c_int, @@ -1256,7 +1256,7 @@ def create_ai_torque_bridge_polynomial_chan( flags=('C')), ctypes.c_uint, ctypes.c_int, ctypes.c_int, ctypes_byte_str] - error_code = cfunc( + error_code = c_func( task, physical_channel, name_to_assign_to_channel, min_val, max_val, units, bridge_config, voltage_excit_source, voltage_excit_val, nominal_bridge_resistance, forward_coeffs, @@ -1270,11 +1270,11 @@ def create_ai_torque_bridge_table_chan( voltage_excit_val, nominal_bridge_resistance, electrical_vals, electrical_units, physical_vals, physical_units, custom_scale_name): - cfunc = lib_importer.windll.DAQmxCreateAITorqueBridgeTableChan - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxCreateAITorqueBridgeTableChan + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes_byte_str, ctypes_byte_str, ctypes.c_double, ctypes.c_double, ctypes.c_int, ctypes.c_int, ctypes.c_int, @@ -1284,7 +1284,7 @@ def create_ai_torque_bridge_table_chan( wrapped_ndpointer(dtype=numpy.float64, flags=('C')), ctypes.c_uint, ctypes.c_int, ctypes_byte_str] - error_code = cfunc( + error_code = c_func( task, physical_channel, name_to_assign_to_channel, min_val, max_val, units, bridge_config, voltage_excit_source, voltage_excit_val, nominal_bridge_resistance, electrical_vals, @@ -1299,11 +1299,11 @@ def create_ai_torque_bridge_two_point_lin_chan( first_electrical_val, second_electrical_val, electrical_units, first_physical_val, second_physical_val, physical_units, custom_scale_name): - cfunc = lib_importer.windll.DAQmxCreateAITorqueBridgeTwoPointLinChan - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxCreateAITorqueBridgeTwoPointLinChan + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes_byte_str, ctypes_byte_str, ctypes.c_double, ctypes.c_double, ctypes.c_int, ctypes.c_int, ctypes.c_int, @@ -1311,7 +1311,7 @@ def create_ai_torque_bridge_two_point_lin_chan( ctypes.c_double, ctypes.c_int, ctypes.c_double, ctypes.c_double, ctypes.c_int, ctypes_byte_str] - error_code = cfunc( + error_code = c_func( task, physical_channel, name_to_assign_to_channel, min_val, max_val, units, bridge_config, voltage_excit_source, voltage_excit_val, nominal_bridge_resistance, @@ -1325,18 +1325,18 @@ def create_ai_velocity_iepe_chan( terminal_config, min_val, max_val, units, sensitivity, sensitivity_units, current_excit_source, current_excit_val, custom_scale_name): - cfunc = lib_importer.windll.DAQmxCreateAIVelocityIEPEChan - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxCreateAIVelocityIEPEChan + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes_byte_str, ctypes_byte_str, ctypes.c_int, ctypes.c_double, ctypes.c_double, ctypes.c_int, ctypes.c_double, ctypes.c_int, ctypes.c_int, ctypes.c_double, ctypes_byte_str] - error_code = cfunc( + error_code = c_func( task, physical_channel, name_to_assign_to_channel, terminal_config, min_val, max_val, units, sensitivity, sensitivity_units, current_excit_source, current_excit_val, @@ -1346,16 +1346,16 @@ def create_ai_velocity_iepe_chan( def create_ai_voltage_chan( self, task, physical_channel, name_to_assign_to_channel, terminal_config, min_val, max_val, units, custom_scale_name): - cfunc = lib_importer.windll.DAQmxCreateAIVoltageChan - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxCreateAIVoltageChan + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes_byte_str, ctypes_byte_str, ctypes.c_int, ctypes.c_double, ctypes.c_double, ctypes.c_int, ctypes_byte_str] - error_code = cfunc( + error_code = c_func( task, physical_channel, name_to_assign_to_channel, terminal_config, min_val, max_val, units, custom_scale_name) self.check_for_error(error_code) @@ -1365,18 +1365,18 @@ def create_ai_voltage_chan_with_excit( terminal_config, min_val, max_val, units, bridge_config, voltage_excit_source, voltage_excit_val, use_excit_for_scaling, custom_scale_name): - cfunc = lib_importer.windll.DAQmxCreateAIVoltageChanWithExcit - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxCreateAIVoltageChanWithExcit + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes_byte_str, ctypes_byte_str, ctypes.c_int, ctypes.c_double, ctypes.c_double, ctypes.c_int, ctypes.c_int, ctypes.c_int, ctypes.c_double, c_bool32, ctypes_byte_str] - error_code = cfunc( + error_code = c_func( task, physical_channel, name_to_assign_to_channel, terminal_config, min_val, max_val, units, bridge_config, voltage_excit_source, voltage_excit_val, use_excit_for_scaling, @@ -1386,16 +1386,16 @@ def create_ai_voltage_chan_with_excit( def create_ai_voltage_rms_chan( self, task, physical_channel, name_to_assign_to_channel, terminal_config, min_val, max_val, units, custom_scale_name): - cfunc = lib_importer.windll.DAQmxCreateAIVoltageRMSChan - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxCreateAIVoltageRMSChan + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes_byte_str, ctypes_byte_str, ctypes.c_int, ctypes.c_double, ctypes.c_double, ctypes.c_int, ctypes_byte_str] - error_code = cfunc( + error_code = c_func( task, physical_channel, name_to_assign_to_channel, terminal_config, min_val, max_val, units, custom_scale_name) self.check_for_error(error_code) @@ -1404,17 +1404,17 @@ def create_airtd_chan( self, task, physical_channel, name_to_assign_to_channel, min_val, max_val, units, rtd_type, resistance_config, current_excit_source, current_excit_val, r_0): - cfunc = lib_importer.windll.DAQmxCreateAIRTDChan - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxCreateAIRTDChan + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes_byte_str, ctypes_byte_str, ctypes.c_double, ctypes.c_double, ctypes.c_int, ctypes.c_int, ctypes.c_int, ctypes.c_int, ctypes.c_double, ctypes.c_double] - error_code = cfunc( + error_code = c_func( task, physical_channel, name_to_assign_to_channel, min_val, max_val, units, rtd_type, resistance_config, current_excit_source, current_excit_val, r_0) @@ -1423,16 +1423,16 @@ def create_airtd_chan( def create_ao_current_chan( self, task, physical_channel, name_to_assign_to_channel, min_val, max_val, units, custom_scale_name): - cfunc = lib_importer.windll.DAQmxCreateAOCurrentChan - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxCreateAOCurrentChan + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes_byte_str, ctypes_byte_str, ctypes.c_double, ctypes.c_double, ctypes.c_int, ctypes_byte_str] - error_code = cfunc( + error_code = c_func( task, physical_channel, name_to_assign_to_channel, min_val, max_val, units, custom_scale_name) self.check_for_error(error_code) @@ -1440,16 +1440,16 @@ def create_ao_current_chan( def create_ao_func_gen_chan( self, task, physical_channel, name_to_assign_to_channel, type, freq, amplitude, offset): - cfunc = lib_importer.windll.DAQmxCreateAOFuncGenChan - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxCreateAOFuncGenChan + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes_byte_str, ctypes_byte_str, ctypes.c_int, ctypes.c_double, ctypes.c_double, ctypes.c_double] - error_code = cfunc( + error_code = c_func( task, physical_channel, name_to_assign_to_channel, type, freq, amplitude, offset) self.check_for_error(error_code) @@ -1457,16 +1457,16 @@ def create_ao_func_gen_chan( def create_ao_voltage_chan( self, task, physical_channel, name_to_assign_to_channel, min_val, max_val, units, custom_scale_name): - cfunc = lib_importer.windll.DAQmxCreateAOVoltageChan - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxCreateAOVoltageChan + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes_byte_str, ctypes_byte_str, ctypes.c_double, ctypes.c_double, ctypes.c_int, ctypes_byte_str] - error_code = cfunc( + error_code = c_func( task, physical_channel, name_to_assign_to_channel, min_val, max_val, units, custom_scale_name) self.check_for_error(error_code) @@ -1475,17 +1475,17 @@ def create_ci_ang_encoder_chan( self, task, counter, name_to_assign_to_channel, decoding_type, zidx_enable, zidx_val, zidx_phase, units, pulses_per_rev, initial_angle, custom_scale_name): - cfunc = lib_importer.windll.DAQmxCreateCIAngEncoderChan - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxCreateCIAngEncoderChan + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes_byte_str, ctypes_byte_str, ctypes.c_int, c_bool32, ctypes.c_double, ctypes.c_int, ctypes.c_int, ctypes.c_uint, ctypes.c_double, ctypes_byte_str] - error_code = cfunc( + error_code = c_func( task, counter, name_to_assign_to_channel, decoding_type, zidx_enable, zidx_val, zidx_phase, units, pulses_per_rev, initial_angle, custom_scale_name) @@ -1494,17 +1494,17 @@ def create_ci_ang_encoder_chan( def create_ci_ang_velocity_chan( self, task, counter, name_to_assign_to_channel, min_val, max_val, decoding_type, units, pulses_per_rev, custom_scale_name): - cfunc = lib_importer.windll.DAQmxCreateCIAngVelocityChan - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxCreateCIAngVelocityChan + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes_byte_str, ctypes_byte_str, ctypes.c_double, ctypes.c_double, ctypes.c_int, ctypes.c_int, ctypes.c_uint, ctypes_byte_str] - error_code = cfunc( + error_code = c_func( task, counter, name_to_assign_to_channel, min_val, max_val, decoding_type, units, pulses_per_rev, custom_scale_name) self.check_for_error(error_code) @@ -1512,16 +1512,16 @@ def create_ci_ang_velocity_chan( def create_ci_count_edges_chan( self, task, counter, name_to_assign_to_channel, edge, initial_count, count_direction): - cfunc = lib_importer.windll.DAQmxCreateCICountEdgesChan - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxCreateCICountEdgesChan + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes_byte_str, ctypes_byte_str, ctypes.c_int, ctypes.c_uint, ctypes.c_int] - error_code = cfunc( + error_code = c_func( task, counter, name_to_assign_to_channel, edge, initial_count, count_direction) self.check_for_error(error_code) @@ -1529,16 +1529,16 @@ def create_ci_count_edges_chan( def create_ci_duty_cycle_chan( self, task, counter, name_to_assign_to_channel, min_freq, max_freq, edge, custom_scale_name): - cfunc = lib_importer.windll.DAQmxCreateCIDutyCycleChan - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxCreateCIDutyCycleChan + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes_byte_str, ctypes_byte_str, ctypes.c_double, ctypes.c_double, ctypes.c_int, ctypes_byte_str] - error_code = cfunc( + error_code = c_func( task, counter, name_to_assign_to_channel, min_freq, max_freq, edge, custom_scale_name) self.check_for_error(error_code) @@ -1546,17 +1546,17 @@ def create_ci_duty_cycle_chan( def create_ci_freq_chan( self, task, counter, name_to_assign_to_channel, min_val, max_val, units, edge, meas_method, meas_time, divisor, custom_scale_name): - cfunc = lib_importer.windll.DAQmxCreateCIFreqChan - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxCreateCIFreqChan + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes_byte_str, ctypes_byte_str, ctypes.c_double, ctypes.c_double, ctypes.c_int, ctypes.c_int, ctypes.c_int, ctypes.c_double, ctypes.c_uint, ctypes_byte_str] - error_code = cfunc( + error_code = c_func( task, counter, name_to_assign_to_channel, min_val, max_val, units, edge, meas_method, meas_time, divisor, custom_scale_name) self.check_for_error(error_code) @@ -1565,17 +1565,17 @@ def create_ci_lin_encoder_chan( self, task, counter, name_to_assign_to_channel, decoding_type, zidx_enable, zidx_val, zidx_phase, units, dist_per_pulse, initial_pos, custom_scale_name): - cfunc = lib_importer.windll.DAQmxCreateCILinEncoderChan - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxCreateCILinEncoderChan + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes_byte_str, ctypes_byte_str, ctypes.c_int, c_bool32, ctypes.c_double, ctypes.c_int, ctypes.c_int, ctypes.c_double, ctypes.c_double, ctypes_byte_str] - error_code = cfunc( + error_code = c_func( task, counter, name_to_assign_to_channel, decoding_type, zidx_enable, zidx_val, zidx_phase, units, dist_per_pulse, initial_pos, custom_scale_name) @@ -1584,17 +1584,17 @@ def create_ci_lin_encoder_chan( def create_ci_lin_velocity_chan( self, task, counter, name_to_assign_to_channel, min_val, max_val, decoding_type, units, dist_per_pulse, custom_scale_name): - cfunc = lib_importer.windll.DAQmxCreateCILinVelocityChan - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxCreateCILinVelocityChan + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes_byte_str, ctypes_byte_str, ctypes.c_double, ctypes.c_double, ctypes.c_int, ctypes.c_int, ctypes.c_double, ctypes_byte_str] - error_code = cfunc( + error_code = c_func( task, counter, name_to_assign_to_channel, min_val, max_val, decoding_type, units, dist_per_pulse, custom_scale_name) self.check_for_error(error_code) @@ -1602,17 +1602,17 @@ def create_ci_lin_velocity_chan( def create_ci_period_chan( self, task, counter, name_to_assign_to_channel, min_val, max_val, units, edge, meas_method, meas_time, divisor, custom_scale_name): - cfunc = lib_importer.windll.DAQmxCreateCIPeriodChan - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxCreateCIPeriodChan + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes_byte_str, ctypes_byte_str, ctypes.c_double, ctypes.c_double, ctypes.c_int, ctypes.c_int, ctypes.c_int, ctypes.c_double, ctypes.c_uint, ctypes_byte_str] - error_code = cfunc( + error_code = c_func( task, counter, name_to_assign_to_channel, min_val, max_val, units, edge, meas_method, meas_time, divisor, custom_scale_name) self.check_for_error(error_code) @@ -1620,32 +1620,32 @@ def create_ci_period_chan( def create_ci_pulse_chan_freq( self, task, counter, name_to_assign_to_channel, min_val, max_val, units): - cfunc = lib_importer.windll.DAQmxCreateCIPulseChanFreq - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxCreateCIPulseChanFreq + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes_byte_str, ctypes_byte_str, ctypes.c_double, ctypes.c_double, ctypes.c_int] - error_code = cfunc( + error_code = c_func( task, counter, name_to_assign_to_channel, min_val, max_val, units) self.check_for_error(error_code) def create_ci_pulse_chan_ticks( self, task, counter, name_to_assign_to_channel, source_terminal, min_val, max_val): - cfunc = lib_importer.windll.DAQmxCreateCIPulseChanTicks - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxCreateCIPulseChanTicks + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes_byte_str, ctypes_byte_str, ctypes_byte_str, ctypes.c_double, ctypes.c_double] - error_code = cfunc( + error_code = c_func( task, counter, name_to_assign_to_channel, source_terminal, min_val, max_val) self.check_for_error(error_code) @@ -1653,32 +1653,32 @@ def create_ci_pulse_chan_ticks( def create_ci_pulse_chan_time( self, task, counter, name_to_assign_to_channel, min_val, max_val, units): - cfunc = lib_importer.windll.DAQmxCreateCIPulseChanTime - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxCreateCIPulseChanTime + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes_byte_str, ctypes_byte_str, ctypes.c_double, ctypes.c_double, ctypes.c_int] - error_code = cfunc( + error_code = c_func( task, counter, name_to_assign_to_channel, min_val, max_val, units) self.check_for_error(error_code) def create_ci_pulse_width_chan( self, task, counter, name_to_assign_to_channel, min_val, max_val, units, starting_edge, custom_scale_name): - cfunc = lib_importer.windll.DAQmxCreateCIPulseWidthChan - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxCreateCIPulseWidthChan + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes_byte_str, ctypes_byte_str, ctypes.c_double, ctypes.c_double, ctypes.c_int, ctypes.c_int, ctypes_byte_str] - error_code = cfunc( + error_code = c_func( task, counter, name_to_assign_to_channel, min_val, max_val, units, starting_edge, custom_scale_name) self.check_for_error(error_code) @@ -1686,16 +1686,16 @@ def create_ci_pulse_width_chan( def create_ci_semi_period_chan( self, task, counter, name_to_assign_to_channel, min_val, max_val, units, custom_scale_name): - cfunc = lib_importer.windll.DAQmxCreateCISemiPeriodChan - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxCreateCISemiPeriodChan + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes_byte_str, ctypes_byte_str, ctypes.c_double, ctypes.c_double, ctypes.c_int, ctypes_byte_str] - error_code = cfunc( + error_code = c_func( task, counter, name_to_assign_to_channel, min_val, max_val, units, custom_scale_name) self.check_for_error(error_code) @@ -1703,17 +1703,17 @@ def create_ci_semi_period_chan( def create_ci_two_edge_sep_chan( self, task, counter, name_to_assign_to_channel, min_val, max_val, units, first_edge, second_edge, custom_scale_name): - cfunc = lib_importer.windll.DAQmxCreateCITwoEdgeSepChan - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxCreateCITwoEdgeSepChan + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes_byte_str, ctypes_byte_str, ctypes.c_double, ctypes.c_double, ctypes.c_int, ctypes.c_int, ctypes.c_int, ctypes_byte_str] - error_code = cfunc( + error_code = c_func( task, counter, name_to_assign_to_channel, min_val, max_val, units, first_edge, second_edge, custom_scale_name) self.check_for_error(error_code) @@ -1721,16 +1721,16 @@ def create_ci_two_edge_sep_chan( def create_cigps_timestamp_chan( self, task, counter, name_to_assign_to_channel, units, sync_method, custom_scale_name): - cfunc = lib_importer.windll.DAQmxCreateCIGPSTimestampChan - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxCreateCIGPSTimestampChan + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes_byte_str, ctypes_byte_str, ctypes.c_int, ctypes.c_int, ctypes_byte_str] - error_code = cfunc( + error_code = c_func( task, counter, name_to_assign_to_channel, units, sync_method, custom_scale_name) self.check_for_error(error_code) @@ -1738,16 +1738,16 @@ def create_cigps_timestamp_chan( def create_co_pulse_chan_freq( self, task, counter, name_to_assign_to_channel, units, idle_state, initial_delay, freq, duty_cycle): - cfunc = lib_importer.windll.DAQmxCreateCOPulseChanFreq - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxCreateCOPulseChanFreq + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes_byte_str, ctypes_byte_str, ctypes.c_int, ctypes.c_int, ctypes.c_double, ctypes.c_double, ctypes.c_double] - error_code = cfunc( + error_code = c_func( task, counter, name_to_assign_to_channel, units, idle_state, initial_delay, freq, duty_cycle) self.check_for_error(error_code) @@ -1755,16 +1755,16 @@ def create_co_pulse_chan_freq( def create_co_pulse_chan_ticks( self, task, counter, source_terminal, name_to_assign_to_channel, idle_state, initial_delay, low_ticks, high_ticks): - cfunc = lib_importer.windll.DAQmxCreateCOPulseChanTicks - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxCreateCOPulseChanTicks + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes_byte_str, ctypes_byte_str, ctypes_byte_str, ctypes.c_int, ctypes.c_int, ctypes.c_int, ctypes.c_int] - error_code = cfunc( + error_code = c_func( task, counter, name_to_assign_to_channel, source_terminal, idle_state, initial_delay, low_ticks, high_ticks) self.check_for_error(error_code) @@ -1772,75 +1772,75 @@ def create_co_pulse_chan_ticks( def create_co_pulse_chan_time( self, task, counter, name_to_assign_to_channel, units, idle_state, initial_delay, low_time, high_time): - cfunc = lib_importer.windll.DAQmxCreateCOPulseChanTime - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxCreateCOPulseChanTime + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes_byte_str, ctypes_byte_str, ctypes.c_int, ctypes.c_int, ctypes.c_double, ctypes.c_double, ctypes.c_double] - error_code = cfunc( + error_code = c_func( task, counter, name_to_assign_to_channel, units, idle_state, initial_delay, low_time, high_time) self.check_for_error(error_code) def create_di_chan( self, task, lines, name_to_assign_to_lines, line_grouping): - cfunc = lib_importer.windll.DAQmxCreateDIChan - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxCreateDIChan + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes_byte_str, ctypes_byte_str, ctypes.c_int] - error_code = cfunc( + error_code = c_func( task, lines, name_to_assign_to_lines, line_grouping) self.check_for_error(error_code) def create_do_chan( self, task, lines, name_to_assign_to_lines, line_grouping): - cfunc = lib_importer.windll.DAQmxCreateDOChan - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxCreateDOChan + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes_byte_str, ctypes_byte_str, ctypes.c_int] - error_code = cfunc( + error_code = c_func( task, lines, name_to_assign_to_lines, line_grouping) self.check_for_error(error_code) def create_lin_scale( self, name, slope, y_intercept, pre_scaled_units, scaled_units): - cfunc = lib_importer.windll.DAQmxCreateLinScale - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxCreateLinScale + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ ctypes_byte_str, ctypes.c_double, ctypes.c_double, ctypes.c_int, ctypes_byte_str] - error_code = cfunc( + error_code = c_func( name, slope, y_intercept, pre_scaled_units, scaled_units) self.check_for_error(error_code) def create_map_scale( self, name, prescaled_min, prescaled_max, scaled_min, scaled_max, pre_scaled_units, scaled_units): - cfunc = lib_importer.windll.DAQmxCreateMapScale - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxCreateMapScale + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ ctypes_byte_str, ctypes.c_double, ctypes.c_double, ctypes.c_double, ctypes.c_double, ctypes.c_int, ctypes_byte_str] - error_code = cfunc( + error_code = c_func( name, prescaled_min, prescaled_max, scaled_min, scaled_max, pre_scaled_units, scaled_units) self.check_for_error(error_code) @@ -1848,18 +1848,18 @@ def create_map_scale( def create_polynomial_scale( self, name, forward_coeffs, reverse_coeffs, pre_scaled_units, scaled_units): - cfunc = lib_importer.windll.DAQmxCreatePolynomialScale - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxCreatePolynomialScale + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ ctypes_byte_str, wrapped_ndpointer(dtype=numpy.float64, flags=('C')), ctypes.c_uint, wrapped_ndpointer(dtype=numpy.float64, flags=('C')), ctypes.c_uint, ctypes.c_int, ctypes_byte_str] - error_code = cfunc( + error_code = c_func( name, forward_coeffs, len(forward_coeffs), reverse_coeffs, len(reverse_coeffs), pre_scaled_units, scaled_units) self.check_for_error(error_code) @@ -1867,18 +1867,18 @@ def create_polynomial_scale( def create_table_scale( self, name, prescaled_vals, scaled_vals, pre_scaled_units, scaled_units): - cfunc = lib_importer.windll.DAQmxCreateTableScale - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxCreateTableScale + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ ctypes_byte_str, wrapped_ndpointer(dtype=numpy.float64, flags=('C')), ctypes.c_uint, wrapped_ndpointer(dtype=numpy.float64, flags=('C')), ctypes.c_uint, ctypes.c_int, ctypes_byte_str] - error_code = cfunc( + error_code = c_func( name, prescaled_vals, len(prescaled_vals), scaled_vals, len(scaled_vals), pre_scaled_units, scaled_units) self.check_for_error(error_code) @@ -1887,15 +1887,15 @@ def create_task(self, session_name): new_session_initialized = True task = lib_importer.task_handle(0) - cfunc = lib_importer.windll.DAQmxCreateTask - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxCreateTask + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ ctypes_byte_str, ctypes.POINTER(lib_importer.task_handle)] - error_code = cfunc( + error_code = c_func( session_name, ctypes.byref(task)) self.check_for_error(error_code) return task, new_session_initialized @@ -1904,17 +1904,17 @@ def create_tedsai_accel_chan( self, task, physical_channel, name_to_assign_to_channel, terminal_config, min_val, max_val, units, current_excit_source, current_excit_val, custom_scale_name): - cfunc = lib_importer.windll.DAQmxCreateTEDSAIAccelChan - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxCreateTEDSAIAccelChan + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes_byte_str, ctypes_byte_str, ctypes.c_int, ctypes.c_double, ctypes.c_double, ctypes.c_int, ctypes.c_int, ctypes.c_double, ctypes_byte_str] - error_code = cfunc( + error_code = c_func( task, physical_channel, name_to_assign_to_channel, terminal_config, min_val, max_val, units, current_excit_source, current_excit_val, custom_scale_name) @@ -1924,17 +1924,17 @@ def create_tedsai_bridge_chan( self, task, physical_channel, name_to_assign_to_channel, min_val, max_val, units, voltage_excit_source, voltage_excit_val, custom_scale_name): - cfunc = lib_importer.windll.DAQmxCreateTEDSAIBridgeChan - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxCreateTEDSAIBridgeChan + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes_byte_str, ctypes_byte_str, ctypes.c_double, ctypes.c_double, ctypes.c_int, ctypes.c_int, ctypes.c_double, ctypes_byte_str] - error_code = cfunc( + error_code = c_func( task, physical_channel, name_to_assign_to_channel, min_val, max_val, units, voltage_excit_source, voltage_excit_val, custom_scale_name) @@ -1944,17 +1944,17 @@ def create_tedsai_current_chan( self, task, physical_channel, name_to_assign_to_channel, terminal_config, min_val, max_val, units, shunt_resistor_loc, ext_shunt_resistor_val, custom_scale_name): - cfunc = lib_importer.windll.DAQmxCreateTEDSAICurrentChan - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxCreateTEDSAICurrentChan + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes_byte_str, ctypes_byte_str, ctypes.c_int, ctypes.c_double, ctypes.c_double, ctypes.c_int, ctypes.c_int, ctypes.c_double, ctypes_byte_str] - error_code = cfunc( + error_code = c_func( task, physical_channel, name_to_assign_to_channel, terminal_config, min_val, max_val, units, shunt_resistor_loc, ext_shunt_resistor_val, custom_scale_name) @@ -1964,17 +1964,17 @@ def create_tedsai_force_bridge_chan( self, task, physical_channel, name_to_assign_to_channel, min_val, max_val, units, voltage_excit_source, voltage_excit_val, custom_scale_name): - cfunc = lib_importer.windll.DAQmxCreateTEDSAIForceBridgeChan - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxCreateTEDSAIForceBridgeChan + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes_byte_str, ctypes_byte_str, ctypes.c_double, ctypes.c_double, ctypes.c_int, ctypes.c_int, ctypes.c_double, ctypes_byte_str] - error_code = cfunc( + error_code = c_func( task, physical_channel, name_to_assign_to_channel, min_val, max_val, units, voltage_excit_source, voltage_excit_val, custom_scale_name) @@ -1984,17 +1984,17 @@ def create_tedsai_force_iepe_chan( self, task, physical_channel, name_to_assign_to_channel, terminal_config, min_val, max_val, units, current_excit_source, current_excit_val, custom_scale_name): - cfunc = lib_importer.windll.DAQmxCreateTEDSAIForceIEPEChan - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxCreateTEDSAIForceIEPEChan + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes_byte_str, ctypes_byte_str, ctypes.c_int, ctypes.c_double, ctypes.c_double, ctypes.c_int, ctypes.c_int, ctypes.c_double, ctypes_byte_str] - error_code = cfunc( + error_code = c_func( task, physical_channel, name_to_assign_to_channel, terminal_config, min_val, max_val, units, current_excit_source, current_excit_val, custom_scale_name) @@ -2004,17 +2004,17 @@ def create_tedsai_microphone_chan( self, task, physical_channel, name_to_assign_to_channel, terminal_config, units, max_snd_press_level, current_excit_source, current_excit_val, custom_scale_name): - cfunc = lib_importer.windll.DAQmxCreateTEDSAIMicrophoneChan - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxCreateTEDSAIMicrophoneChan + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes_byte_str, ctypes_byte_str, ctypes.c_int, ctypes.c_int, ctypes.c_double, ctypes.c_int, ctypes.c_double, ctypes_byte_str] - error_code = cfunc( + error_code = c_func( task, physical_channel, name_to_assign_to_channel, terminal_config, units, max_snd_press_level, current_excit_source, current_excit_val, custom_scale_name) @@ -2024,17 +2024,17 @@ def create_tedsai_pos_lvdt_chan( self, task, physical_channel, name_to_assign_to_channel, min_val, max_val, units, voltage_excit_source, voltage_excit_val, voltage_excit_freq, ac_excit_wire_mode, custom_scale_name): - cfunc = lib_importer.windll.DAQmxCreateTEDSAIPosLVDTChan - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxCreateTEDSAIPosLVDTChan + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes_byte_str, ctypes_byte_str, ctypes.c_double, ctypes.c_double, ctypes.c_int, ctypes.c_int, ctypes.c_double, ctypes.c_double, ctypes.c_int, ctypes_byte_str] - error_code = cfunc( + error_code = c_func( task, physical_channel, name_to_assign_to_channel, min_val, max_val, units, voltage_excit_source, voltage_excit_val, voltage_excit_freq, ac_excit_wire_mode, custom_scale_name) @@ -2044,17 +2044,17 @@ def create_tedsai_pos_rvdt_chan( self, task, physical_channel, name_to_assign_to_channel, min_val, max_val, units, voltage_excit_source, voltage_excit_val, voltage_excit_freq, ac_excit_wire_mode, custom_scale_name): - cfunc = lib_importer.windll.DAQmxCreateTEDSAIPosRVDTChan - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxCreateTEDSAIPosRVDTChan + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes_byte_str, ctypes_byte_str, ctypes.c_double, ctypes.c_double, ctypes.c_int, ctypes.c_int, ctypes.c_double, ctypes.c_double, ctypes.c_int, ctypes_byte_str] - error_code = cfunc( + error_code = c_func( task, physical_channel, name_to_assign_to_channel, min_val, max_val, units, voltage_excit_source, voltage_excit_val, voltage_excit_freq, ac_excit_wire_mode, custom_scale_name) @@ -2064,17 +2064,17 @@ def create_tedsai_pressure_bridge_chan( self, task, physical_channel, name_to_assign_to_channel, min_val, max_val, units, voltage_excit_source, voltage_excit_val, custom_scale_name): - cfunc = lib_importer.windll.DAQmxCreateTEDSAIPressureBridgeChan - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxCreateTEDSAIPressureBridgeChan + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes_byte_str, ctypes_byte_str, ctypes.c_double, ctypes.c_double, ctypes.c_int, ctypes.c_int, ctypes.c_double, ctypes_byte_str] - error_code = cfunc( + error_code = c_func( task, physical_channel, name_to_assign_to_channel, min_val, max_val, units, voltage_excit_source, voltage_excit_val, custom_scale_name) @@ -2084,17 +2084,17 @@ def create_tedsai_resistance_chan( self, task, physical_channel, name_to_assign_to_channel, min_val, max_val, units, resistance_config, current_excit_source, current_excit_val, custom_scale_name): - cfunc = lib_importer.windll.DAQmxCreateTEDSAIResistanceChan - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxCreateTEDSAIResistanceChan + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes_byte_str, ctypes_byte_str, ctypes.c_double, ctypes.c_double, ctypes.c_int, ctypes.c_int, ctypes.c_int, ctypes.c_double, ctypes_byte_str] - error_code = cfunc( + error_code = c_func( task, physical_channel, name_to_assign_to_channel, min_val, max_val, units, resistance_config, current_excit_source, current_excit_val, custom_scale_name) @@ -2104,17 +2104,17 @@ def create_tedsai_strain_gage_chan( self, task, physical_channel, name_to_assign_to_channel, min_val, max_val, units, voltage_excit_source, voltage_excit_val, initial_bridge_voltage, lead_wire_resistance, custom_scale_name): - cfunc = lib_importer.windll.DAQmxCreateTEDSAIStrainGageChan - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxCreateTEDSAIStrainGageChan + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes_byte_str, ctypes_byte_str, ctypes.c_double, ctypes.c_double, ctypes.c_int, ctypes.c_int, ctypes.c_double, ctypes.c_double, ctypes.c_double, ctypes_byte_str] - error_code = cfunc( + error_code = c_func( task, physical_channel, name_to_assign_to_channel, min_val, max_val, units, voltage_excit_source, voltage_excit_val, initial_bridge_voltage, lead_wire_resistance, custom_scale_name) @@ -2123,17 +2123,17 @@ def create_tedsai_strain_gage_chan( def create_tedsai_thrmcpl_chan( self, task, physical_channel, name_to_assign_to_channel, min_val, max_val, units, cjc_source, cjc_val, cjc_channel): - cfunc = lib_importer.windll.DAQmxCreateTEDSAIThrmcplChan - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxCreateTEDSAIThrmcplChan + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes_byte_str, ctypes_byte_str, ctypes.c_double, ctypes.c_double, ctypes.c_int, ctypes.c_int, ctypes.c_double, ctypes_byte_str] - error_code = cfunc( + error_code = c_func( task, physical_channel, name_to_assign_to_channel, min_val, max_val, units, cjc_source, cjc_val, cjc_channel) self.check_for_error(error_code) @@ -2142,17 +2142,17 @@ def create_tedsai_thrmstr_chan_iex( self, task, physical_channel, name_to_assign_to_channel, min_val, max_val, units, resistance_config, current_excit_source, current_excit_val): - cfunc = lib_importer.windll.DAQmxCreateTEDSAIThrmstrChanIex - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxCreateTEDSAIThrmstrChanIex + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes_byte_str, ctypes_byte_str, ctypes.c_double, ctypes.c_double, ctypes.c_int, ctypes.c_int, ctypes.c_int, ctypes.c_double] - error_code = cfunc( + error_code = c_func( task, physical_channel, name_to_assign_to_channel, min_val, max_val, units, resistance_config, current_excit_source, current_excit_val) @@ -2162,17 +2162,17 @@ def create_tedsai_thrmstr_chan_vex( self, task, physical_channel, name_to_assign_to_channel, min_val, max_val, units, resistance_config, voltage_excit_source, voltage_excit_val, r_1): - cfunc = lib_importer.windll.DAQmxCreateTEDSAIThrmstrChanVex - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxCreateTEDSAIThrmstrChanVex + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes_byte_str, ctypes_byte_str, ctypes.c_double, ctypes.c_double, ctypes.c_int, ctypes.c_int, ctypes.c_int, ctypes.c_double, ctypes.c_double] - error_code = cfunc( + error_code = c_func( task, physical_channel, name_to_assign_to_channel, min_val, max_val, units, resistance_config, voltage_excit_source, voltage_excit_val, r_1) @@ -2182,17 +2182,17 @@ def create_tedsai_torque_bridge_chan( self, task, physical_channel, name_to_assign_to_channel, min_val, max_val, units, voltage_excit_source, voltage_excit_val, custom_scale_name): - cfunc = lib_importer.windll.DAQmxCreateTEDSAITorqueBridgeChan - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxCreateTEDSAITorqueBridgeChan + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes_byte_str, ctypes_byte_str, ctypes.c_double, ctypes.c_double, ctypes.c_int, ctypes.c_int, ctypes.c_double, ctypes_byte_str] - error_code = cfunc( + error_code = c_func( task, physical_channel, name_to_assign_to_channel, min_val, max_val, units, voltage_excit_source, voltage_excit_val, custom_scale_name) @@ -2201,16 +2201,16 @@ def create_tedsai_torque_bridge_chan( def create_tedsai_voltage_chan( self, task, physical_channel, name_to_assign_to_channel, terminal_config, min_val, max_val, units, custom_scale_name): - cfunc = lib_importer.windll.DAQmxCreateTEDSAIVoltageChan - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxCreateTEDSAIVoltageChan + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes_byte_str, ctypes_byte_str, ctypes.c_int, ctypes.c_double, ctypes.c_double, ctypes.c_int, ctypes_byte_str] - error_code = cfunc( + error_code = c_func( task, physical_channel, name_to_assign_to_channel, terminal_config, min_val, max_val, units, custom_scale_name) self.check_for_error(error_code) @@ -2219,17 +2219,17 @@ def create_tedsai_voltage_chan_with_excit( self, task, physical_channel, name_to_assign_to_channel, terminal_config, min_val, max_val, units, voltage_excit_source, voltage_excit_val, custom_scale_name): - cfunc = lib_importer.windll.DAQmxCreateTEDSAIVoltageChanWithExcit - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxCreateTEDSAIVoltageChanWithExcit + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes_byte_str, ctypes_byte_str, ctypes.c_int, ctypes.c_double, ctypes.c_double, ctypes.c_int, ctypes.c_int, ctypes.c_double, ctypes_byte_str] - error_code = cfunc( + error_code = c_func( task, physical_channel, name_to_assign_to_channel, terminal_config, min_val, max_val, units, voltage_excit_source, voltage_excit_val, custom_scale_name) @@ -2239,17 +2239,17 @@ def create_tedsairtd_chan( self, task, physical_channel, name_to_assign_to_channel, min_val, max_val, units, resistance_config, current_excit_source, current_excit_val): - cfunc = lib_importer.windll.DAQmxCreateTEDSAIRTDChan - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxCreateTEDSAIRTDChan + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes_byte_str, ctypes_byte_str, ctypes.c_double, ctypes.c_double, ctypes.c_int, ctypes.c_int, ctypes.c_int, ctypes.c_double] - error_code = cfunc( + error_code = c_func( task, physical_channel, name_to_assign_to_channel, min_val, max_val, units, resistance_config, current_excit_source, current_excit_val) @@ -2260,129 +2260,129 @@ def create_watchdog_timer_task_ex( new_session_initialized = True task = lib_importer.task_handle(0) - cfunc = lib_importer.windll.DAQmxCreateWatchdogTimerTaskEx - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxCreateWatchdogTimerTaskEx + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ ctypes_byte_str, ctypes_byte_str, ctypes.POINTER(lib_importer.task_handle), ctypes.c_double] - error_code = cfunc( + error_code = c_func( device_name, session_name, ctypes.byref(task), timeout) self.check_for_error(error_code) return task, new_session_initialized def delete_network_device(self, device_name): - cfunc = lib_importer.windll.DAQmxDeleteNetworkDevice - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxDeleteNetworkDevice + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ ctypes_byte_str] - error_code = cfunc( + error_code = c_func( device_name) self.check_for_error(error_code) def delete_saved_global_chan(self, channel_name): - cfunc = lib_importer.windll.DAQmxDeleteSavedGlobalChan - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxDeleteSavedGlobalChan + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ ctypes_byte_str] - error_code = cfunc( + error_code = c_func( channel_name) self.check_for_error(error_code) def delete_saved_scale(self, scale_name): - cfunc = lib_importer.windll.DAQmxDeleteSavedScale - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxDeleteSavedScale + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ ctypes_byte_str] - error_code = cfunc( + error_code = c_func( scale_name) self.check_for_error(error_code) def delete_saved_task(self, task_name): - cfunc = lib_importer.windll.DAQmxDeleteSavedTask - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxDeleteSavedTask + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ ctypes_byte_str] - error_code = cfunc( + error_code = c_func( task_name) self.check_for_error(error_code) def device_supports_cal(self, device_name): cal_supported = c_bool32() - cfunc = lib_importer.windll.DAQmxDeviceSupportsCal - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxDeviceSupportsCal + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ ctypes_byte_str, ctypes.POINTER(c_bool32)] - error_code = cfunc( + error_code = c_func( device_name, ctypes.byref(cal_supported)) self.check_for_error(error_code) return cal_supported.value def disable_ref_trig(self, task): - cfunc = lib_importer.windll.DAQmxDisableRefTrig - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxDisableRefTrig + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle] - error_code = cfunc( + error_code = c_func( task) self.check_for_error(error_code) def disable_start_trig(self, task): - cfunc = lib_importer.windll.DAQmxDisableStartTrig - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxDisableStartTrig + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle] - error_code = cfunc( + error_code = c_func( task) self.check_for_error(error_code) def disconnect_terms(self, source_terminal, destination_terminal): - cfunc = lib_importer.windll.DAQmxDisconnectTerms - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxDisconnectTerms + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ ctypes_byte_str, ctypes_byte_str] - error_code = cfunc( + error_code = c_func( source_terminal, destination_terminal) self.check_for_error(error_code) def export_signal(self, task, signal_id, output_terminal): - cfunc = lib_importer.windll.DAQmxExportSignal - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxExportSignal + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes.c_int, ctypes_byte_str] - error_code = cfunc( + error_code = c_func( task, signal_id, output_terminal) self.check_for_error(error_code) @@ -2392,34 +2392,34 @@ def get_analog_power_up_states_with_output_type( channel_type_array = numpy.zeros(array_size, dtype=numpy.int32) array_size = ctypes.c_uint32(array_size) - cfunc = lib_importer.cdll.DAQmxGetAnalogPowerUpStatesWithOutputType - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxGetAnalogPowerUpStatesWithOutputType + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ ctypes_byte_str, wrapped_ndpointer(dtype=numpy.float64, flags=('C','W')), wrapped_ndpointer(dtype=numpy.int32, flags=('C','W')), ctypes.POINTER(ctypes.c_uint)] - error_code = cfunc( + error_code = c_func( channel_names, state_array, channel_type_array, ctypes.byref(array_size)) self.check_for_error(error_code) return state_array.tolist(), channel_type_array.tolist() def get_auto_configured_cdaq_sync_connections(self): - cfunc = lib_importer.windll.DAQmxGetAutoConfiguredCDAQSyncConnections - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxGetAutoConfiguredCDAQSyncConnections + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ ctypes.c_char_p, ctypes.c_uint] temp_size = 0 while True: port_list = ctypes.create_string_buffer(temp_size) - size_or_code = cfunc( + size_or_code = c_func( port_list, temp_size) if is_string_buffer_too_small(size_or_code): # Buffer size must have changed between calls; check again. @@ -2435,14 +2435,14 @@ def get_auto_configured_cdaq_sync_connections(self): def get_buffer_attribute_uint32(self, task, attribute): value = ctypes.c_uint32() - cfunc = lib_importer.cdll.DAQmxGetBufferAttribute - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxGetBufferAttribute + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes.c_int32] - error_code = cfunc( + error_code = c_func( task, attribute, ctypes.byref(value)) self.check_for_error(error_code) return value.value @@ -2450,14 +2450,14 @@ def get_buffer_attribute_uint32(self, task, attribute): def get_cal_info_attribute_bool(self, device_name, attribute): value = c_bool32() - cfunc = lib_importer.cdll.DAQmxGetCalInfoAttribute - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxGetCalInfoAttribute + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ ctypes_byte_str, ctypes.c_int32] - error_code = cfunc( + error_code = c_func( device_name, attribute, ctypes.byref(value)) self.check_for_error(error_code) return value.value @@ -2465,30 +2465,30 @@ def get_cal_info_attribute_bool(self, device_name, attribute): def get_cal_info_attribute_double(self, device_name, attribute): value = ctypes.c_double() - cfunc = lib_importer.cdll.DAQmxGetCalInfoAttribute - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxGetCalInfoAttribute + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ ctypes_byte_str, ctypes.c_int32] - error_code = cfunc( + error_code = c_func( device_name, attribute, ctypes.byref(value)) self.check_for_error(error_code) return value.value def get_cal_info_attribute_string(self, device_name, attribute): - cfunc = lib_importer.cdll.DAQmxGetCalInfoAttribute - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxGetCalInfoAttribute + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ ctypes_byte_str, ctypes.c_int32] temp_size = 0 while True: value = ctypes.create_string_buffer(temp_size) - size_or_code = cfunc( + size_or_code = c_func( device_name, attribute, value, temp_size) if is_string_buffer_too_small(size_or_code): # Buffer size must have changed between calls; check again. @@ -2504,14 +2504,14 @@ def get_cal_info_attribute_string(self, device_name, attribute): def get_cal_info_attribute_uint32(self, device_name, attribute): value = ctypes.c_uint32() - cfunc = lib_importer.cdll.DAQmxGetCalInfoAttribute - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxGetCalInfoAttribute + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ ctypes_byte_str, ctypes.c_int32] - error_code = cfunc( + error_code = c_func( device_name, attribute, ctypes.byref(value)) self.check_for_error(error_code) return value.value @@ -2519,15 +2519,15 @@ def get_cal_info_attribute_uint32(self, device_name, attribute): def get_chan_attribute_bool(self, task, channel, attribute): value = c_bool32() - cfunc = lib_importer.cdll.DAQmxGetChanAttribute - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxGetChanAttribute + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes_byte_str, ctypes.c_int32] - error_code = cfunc( + error_code = c_func( task, channel, attribute, ctypes.byref(value)) self.check_for_error(error_code) return value.value @@ -2535,32 +2535,32 @@ def get_chan_attribute_bool(self, task, channel, attribute): def get_chan_attribute_double(self, task, channel, attribute): value = ctypes.c_double() - cfunc = lib_importer.cdll.DAQmxGetChanAttribute - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxGetChanAttribute + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes_byte_str, ctypes.c_int32] - error_code = cfunc( + error_code = c_func( task, channel, attribute, ctypes.byref(value)) self.check_for_error(error_code) return value.value def get_chan_attribute_double_array(self, task, channel, attribute): - cfunc = lib_importer.cdll.DAQmxGetChanAttribute - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxGetChanAttribute + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes_byte_str, ctypes.c_int32] temp_size = 0 while True: value = numpy.zeros(temp_size, dtype=numpy.float64) - size_or_code = cfunc( + size_or_code = c_func( task, channel, attribute, value.ctypes.data_as(ctypes.c_void_p), temp_size) if is_array_buffer_too_small(size_or_code): @@ -2577,32 +2577,32 @@ def get_chan_attribute_double_array(self, task, channel, attribute): def get_chan_attribute_int32(self, task, channel, attribute): value = ctypes.c_int32() - cfunc = lib_importer.cdll.DAQmxGetChanAttribute - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxGetChanAttribute + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes_byte_str, ctypes.c_int32] - error_code = cfunc( + error_code = c_func( task, channel, attribute, ctypes.byref(value)) self.check_for_error(error_code) return value.value def get_chan_attribute_string(self, task, channel, attribute): - cfunc = lib_importer.cdll.DAQmxGetChanAttribute - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxGetChanAttribute + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes_byte_str, ctypes.c_int32] temp_size = 0 while True: value = ctypes.create_string_buffer(temp_size) - size_or_code = cfunc( + size_or_code = c_func( task, channel, attribute, value, temp_size) if is_string_buffer_too_small(size_or_code): # Buffer size must have changed between calls; check again. @@ -2618,15 +2618,15 @@ def get_chan_attribute_string(self, task, channel, attribute): def get_chan_attribute_uint32(self, task, channel, attribute): value = ctypes.c_uint32() - cfunc = lib_importer.cdll.DAQmxGetChanAttribute - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxGetChanAttribute + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes_byte_str, ctypes.c_int32] - error_code = cfunc( + error_code = c_func( task, channel, attribute, ctypes.byref(value)) self.check_for_error(error_code) return value.value @@ -2634,14 +2634,14 @@ def get_chan_attribute_uint32(self, task, channel, attribute): def get_device_attribute_bool(self, device_name, attribute): value = c_bool32() - cfunc = lib_importer.cdll.DAQmxGetDeviceAttribute - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxGetDeviceAttribute + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ ctypes_byte_str, ctypes.c_int32] - error_code = cfunc( + error_code = c_func( device_name, attribute, ctypes.byref(value)) self.check_for_error(error_code) return value.value @@ -2649,30 +2649,30 @@ def get_device_attribute_bool(self, device_name, attribute): def get_device_attribute_double(self, device_name, attribute): value = ctypes.c_double() - cfunc = lib_importer.cdll.DAQmxGetDeviceAttribute - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxGetDeviceAttribute + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ ctypes_byte_str, ctypes.c_int32] - error_code = cfunc( + error_code = c_func( device_name, attribute, ctypes.byref(value)) self.check_for_error(error_code) return value.value def get_device_attribute_double_array(self, device_name, attribute): - cfunc = lib_importer.cdll.DAQmxGetDeviceAttribute - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxGetDeviceAttribute + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ ctypes_byte_str, ctypes.c_int32] temp_size = 0 while True: value = numpy.zeros(temp_size, dtype=numpy.float64) - size_or_code = cfunc( + size_or_code = c_func( device_name, attribute, value.ctypes.data_as(ctypes.c_void_p), temp_size) if is_array_buffer_too_small(size_or_code): @@ -2689,30 +2689,30 @@ def get_device_attribute_double_array(self, device_name, attribute): def get_device_attribute_int32(self, device_name, attribute): value = ctypes.c_int32() - cfunc = lib_importer.cdll.DAQmxGetDeviceAttribute - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxGetDeviceAttribute + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ ctypes_byte_str, ctypes.c_int32] - error_code = cfunc( + error_code = c_func( device_name, attribute, ctypes.byref(value)) self.check_for_error(error_code) return value.value def get_device_attribute_int32_array(self, device_name, attribute): - cfunc = lib_importer.cdll.DAQmxGetDeviceAttribute - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxGetDeviceAttribute + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ ctypes_byte_str, ctypes.c_int32] temp_size = 0 while True: value = numpy.zeros(temp_size, dtype=numpy.int32) - size_or_code = cfunc( + size_or_code = c_func( device_name, attribute, value.ctypes.data_as(ctypes.c_void_p), temp_size) if is_array_buffer_too_small(size_or_code): @@ -2727,17 +2727,17 @@ def get_device_attribute_int32_array(self, device_name, attribute): return value.tolist() def get_device_attribute_string(self, device_name, attribute): - cfunc = lib_importer.cdll.DAQmxGetDeviceAttribute - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxGetDeviceAttribute + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ ctypes_byte_str, ctypes.c_int32] temp_size = 0 while True: value = ctypes.create_string_buffer(temp_size) - size_or_code = cfunc( + size_or_code = c_func( device_name, attribute, value, temp_size) if is_string_buffer_too_small(size_or_code): # Buffer size must have changed between calls; check again. @@ -2753,30 +2753,30 @@ def get_device_attribute_string(self, device_name, attribute): def get_device_attribute_uint32(self, device_name, attribute): value = ctypes.c_uint32() - cfunc = lib_importer.cdll.DAQmxGetDeviceAttribute - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxGetDeviceAttribute + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ ctypes_byte_str, ctypes.c_int32] - error_code = cfunc( + error_code = c_func( device_name, attribute, ctypes.byref(value)) self.check_for_error(error_code) return value.value def get_device_attribute_uint32_array(self, device_name, attribute): - cfunc = lib_importer.cdll.DAQmxGetDeviceAttribute - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxGetDeviceAttribute + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ ctypes_byte_str, ctypes.c_int32] temp_size = 0 while True: value = numpy.zeros(temp_size, dtype=numpy.uint32) - size_or_code = cfunc( + size_or_code = c_func( device_name, attribute, value.ctypes.data_as(ctypes.c_void_p), temp_size) if is_array_buffer_too_small(size_or_code): @@ -2793,14 +2793,14 @@ def get_device_attribute_uint32_array(self, device_name, attribute): def get_digital_logic_family_power_up_state(self, device_name): logic_family = ctypes.c_int() - cfunc = lib_importer.windll.DAQmxGetDigitalLogicFamilyPowerUpState - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxGetDigitalLogicFamilyPowerUpState + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ ctypes_byte_str, ctypes.POINTER(ctypes.c_int)] - error_code = cfunc( + error_code = c_func( device_name, ctypes.byref(logic_family)) self.check_for_error(error_code) return logic_family.value @@ -2824,10 +2824,10 @@ def get_digital_power_up_states(self, device_name, channel_name): args.append(None) argtypes.append(ctypes.c_void_p) - cfunc = lib_importer.cdll.DAQmxGetDigitalPowerUpStates - with cfunc.arglock: - cfunc.argtypes = argtypes - error_code = cfunc(*args) + c_func = lib_importer.cdll.DAQmxGetDigitalPowerUpStates + with c_func.arg_lock: + c_func.argtypes = argtypes + error_code = c_func(*args) self.check_for_error(error_code) return [state_element.value for state_element in state] @@ -2850,25 +2850,25 @@ def get_digital_pull_up_pull_down_states(self, device_name, channel_name): args.append(None) argtypes.append(ctypes.c_void_p) - cfunc = lib_importer.cdll.DAQmxGetDigitalPullUpPullDownStates - with cfunc.arglock: - cfunc.argtypes = argtypes - error_code = cfunc(*args) + c_func = lib_importer.cdll.DAQmxGetDigitalPullUpPullDownStates + with c_func.arg_lock: + c_func.argtypes = argtypes + error_code = c_func(*args) self.check_for_error(error_code) return [state_element.value for state_element in state] def get_disconnected_cdaq_sync_ports(self): - cfunc = lib_importer.windll.DAQmxGetDisconnectedCDAQSyncPorts - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxGetDisconnectedCDAQSyncPorts + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ ctypes.c_char_p, ctypes.c_uint] temp_size = 0 while True: port_list = ctypes.create_string_buffer(temp_size) - size_or_code = cfunc( + size_or_code = c_func( port_list, temp_size) if is_string_buffer_too_small(size_or_code): # Buffer size must have changed between calls; check again. @@ -2884,14 +2884,14 @@ def get_disconnected_cdaq_sync_ports(self): def get_exported_signal_attribute_bool(self, task, attribute): value = c_bool32() - cfunc = lib_importer.cdll.DAQmxGetExportedSignalAttribute - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxGetExportedSignalAttribute + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes.c_int32] - error_code = cfunc( + error_code = c_func( task, attribute, ctypes.byref(value)) self.check_for_error(error_code) return value.value @@ -2899,14 +2899,14 @@ def get_exported_signal_attribute_bool(self, task, attribute): def get_exported_signal_attribute_double(self, task, attribute): value = ctypes.c_double() - cfunc = lib_importer.cdll.DAQmxGetExportedSignalAttribute - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxGetExportedSignalAttribute + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes.c_int32] - error_code = cfunc( + error_code = c_func( task, attribute, ctypes.byref(value)) self.check_for_error(error_code) return value.value @@ -2914,30 +2914,30 @@ def get_exported_signal_attribute_double(self, task, attribute): def get_exported_signal_attribute_int32(self, task, attribute): value = ctypes.c_int32() - cfunc = lib_importer.cdll.DAQmxGetExportedSignalAttribute - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxGetExportedSignalAttribute + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes.c_int32] - error_code = cfunc( + error_code = c_func( task, attribute, ctypes.byref(value)) self.check_for_error(error_code) return value.value def get_exported_signal_attribute_string(self, task, attribute): - cfunc = lib_importer.cdll.DAQmxGetExportedSignalAttribute - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxGetExportedSignalAttribute + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes.c_int32] temp_size = 0 while True: value = ctypes.create_string_buffer(temp_size) - size_or_code = cfunc( + size_or_code = c_func( task, attribute, value, temp_size) if is_string_buffer_too_small(size_or_code): # Buffer size must have changed between calls; check again. @@ -2953,14 +2953,14 @@ def get_exported_signal_attribute_string(self, task, attribute): def get_exported_signal_attribute_uint32(self, task, attribute): value = ctypes.c_uint32() - cfunc = lib_importer.cdll.DAQmxGetExportedSignalAttribute - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxGetExportedSignalAttribute + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes.c_int32] - error_code = cfunc( + error_code = c_func( task, attribute, ctypes.byref(value)) self.check_for_error(error_code) return value.value @@ -2972,18 +2972,18 @@ def get_ext_cal_last_date_and_time(self, device_name): hour = ctypes.c_uint() minute = ctypes.c_uint() - cfunc = lib_importer.windll.DAQmxGetExtCalLastDateAndTime - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxGetExtCalLastDateAndTime + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ ctypes_byte_str, ctypes.POINTER(ctypes.c_uint), ctypes.POINTER(ctypes.c_uint), ctypes.POINTER(ctypes.c_uint), ctypes.POINTER(ctypes.c_uint), ctypes.POINTER(ctypes.c_uint)] - error_code = cfunc( + error_code = c_func( device_name, ctypes.byref(year), ctypes.byref(month), ctypes.byref(day), ctypes.byref(hour), ctypes.byref(minute)) self.check_for_error(error_code) @@ -2992,30 +2992,30 @@ def get_ext_cal_last_date_and_time(self, device_name): def get_persisted_chan_attribute_bool(self, channel, attribute): value = c_bool32() - cfunc = lib_importer.cdll.DAQmxGetPersistedChanAttribute - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxGetPersistedChanAttribute + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ ctypes_byte_str, ctypes.c_int32] - error_code = cfunc( + error_code = c_func( channel, attribute, ctypes.byref(value)) self.check_for_error(error_code) return value.value def get_persisted_chan_attribute_string(self, channel, attribute): - cfunc = lib_importer.cdll.DAQmxGetPersistedChanAttribute - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxGetPersistedChanAttribute + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ ctypes_byte_str, ctypes.c_int32] temp_size = 0 while True: value = ctypes.create_string_buffer(temp_size) - size_or_code = cfunc( + size_or_code = c_func( channel, attribute, value, temp_size) if is_string_buffer_too_small(size_or_code): # Buffer size must have changed between calls; check again. @@ -3031,30 +3031,30 @@ def get_persisted_chan_attribute_string(self, channel, attribute): def get_persisted_scale_attribute_bool(self, scale_name, attribute): value = c_bool32() - cfunc = lib_importer.cdll.DAQmxGetPersistedScaleAttribute - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxGetPersistedScaleAttribute + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ ctypes_byte_str, ctypes.c_int32] - error_code = cfunc( + error_code = c_func( scale_name, attribute, ctypes.byref(value)) self.check_for_error(error_code) return value.value def get_persisted_scale_attribute_string(self, scale_name, attribute): - cfunc = lib_importer.cdll.DAQmxGetPersistedScaleAttribute - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxGetPersistedScaleAttribute + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ ctypes_byte_str, ctypes.c_int32] temp_size = 0 while True: value = ctypes.create_string_buffer(temp_size) - size_or_code = cfunc( + size_or_code = c_func( scale_name, attribute, value, temp_size) if is_string_buffer_too_small(size_or_code): # Buffer size must have changed between calls; check again. @@ -3070,30 +3070,30 @@ def get_persisted_scale_attribute_string(self, scale_name, attribute): def get_persisted_task_attribute_bool(self, task_name, attribute): value = c_bool32() - cfunc = lib_importer.cdll.DAQmxGetPersistedTaskAttribute - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxGetPersistedTaskAttribute + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ ctypes_byte_str, ctypes.c_int32] - error_code = cfunc( + error_code = c_func( task_name, attribute, ctypes.byref(value)) self.check_for_error(error_code) return value.value def get_persisted_task_attribute_string(self, task_name, attribute): - cfunc = lib_importer.cdll.DAQmxGetPersistedTaskAttribute - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxGetPersistedTaskAttribute + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ ctypes_byte_str, ctypes.c_int32] temp_size = 0 while True: value = ctypes.create_string_buffer(temp_size) - size_or_code = cfunc( + size_or_code = c_func( task_name, attribute, value, temp_size) if is_string_buffer_too_small(size_or_code): # Buffer size must have changed between calls; check again. @@ -3109,30 +3109,30 @@ def get_persisted_task_attribute_string(self, task_name, attribute): def get_physical_chan_attribute_bool(self, physical_channel, attribute): value = c_bool32() - cfunc = lib_importer.cdll.DAQmxGetPhysicalChanAttribute - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxGetPhysicalChanAttribute + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ ctypes_byte_str, ctypes.c_int32] - error_code = cfunc( + error_code = c_func( physical_channel, attribute, ctypes.byref(value)) self.check_for_error(error_code) return value.value def get_physical_chan_attribute_bytes(self, physical_channel, attribute): - cfunc = lib_importer.cdll.DAQmxGetPhysicalChanAttribute - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxGetPhysicalChanAttribute + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ ctypes_byte_str, ctypes.c_int32] temp_size = 0 while True: value = numpy.zeros(temp_size, dtype=numpy.uint8) - size_or_code = cfunc( + size_or_code = c_func( physical_channel, attribute, value.ctypes.data_as(ctypes.c_void_p), temp_size) if is_array_buffer_too_small(size_or_code): @@ -3149,31 +3149,31 @@ def get_physical_chan_attribute_bytes(self, physical_channel, attribute): def get_physical_chan_attribute_double(self, physical_channel, attribute): value = ctypes.c_double() - cfunc = lib_importer.cdll.DAQmxGetPhysicalChanAttribute - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxGetPhysicalChanAttribute + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ ctypes_byte_str, ctypes.c_int32] - error_code = cfunc( + error_code = c_func( physical_channel, attribute, ctypes.byref(value)) self.check_for_error(error_code) return value.value def get_physical_chan_attribute_double_array( self, physical_channel, attribute): - cfunc = lib_importer.cdll.DAQmxGetPhysicalChanAttribute - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxGetPhysicalChanAttribute + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ ctypes_byte_str, ctypes.c_int32] temp_size = 0 while True: value = numpy.zeros(temp_size, dtype=numpy.float64) - size_or_code = cfunc( + size_or_code = c_func( physical_channel, attribute, value.ctypes.data_as(ctypes.c_void_p), temp_size) if is_array_buffer_too_small(size_or_code): @@ -3190,31 +3190,31 @@ def get_physical_chan_attribute_double_array( def get_physical_chan_attribute_int32(self, physical_channel, attribute): value = ctypes.c_int32() - cfunc = lib_importer.cdll.DAQmxGetPhysicalChanAttribute - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxGetPhysicalChanAttribute + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ ctypes_byte_str, ctypes.c_int32] - error_code = cfunc( + error_code = c_func( physical_channel, attribute, ctypes.byref(value)) self.check_for_error(error_code) return value.value def get_physical_chan_attribute_int32_array( self, physical_channel, attribute): - cfunc = lib_importer.cdll.DAQmxGetPhysicalChanAttribute - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxGetPhysicalChanAttribute + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ ctypes_byte_str, ctypes.c_int32] temp_size = 0 while True: value = numpy.zeros(temp_size, dtype=numpy.int32) - size_or_code = cfunc( + size_or_code = c_func( physical_channel, attribute, value.ctypes.data_as(ctypes.c_void_p), temp_size) if is_array_buffer_too_small(size_or_code): @@ -3229,17 +3229,17 @@ def get_physical_chan_attribute_int32_array( return value.tolist() def get_physical_chan_attribute_string(self, physical_channel, attribute): - cfunc = lib_importer.cdll.DAQmxGetPhysicalChanAttribute - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxGetPhysicalChanAttribute + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ ctypes_byte_str, ctypes.c_int32] temp_size = 0 while True: value = ctypes.create_string_buffer(temp_size) - size_or_code = cfunc( + size_or_code = c_func( physical_channel, attribute, value, temp_size) if is_string_buffer_too_small(size_or_code): # Buffer size must have changed between calls; check again. @@ -3255,31 +3255,31 @@ def get_physical_chan_attribute_string(self, physical_channel, attribute): def get_physical_chan_attribute_uint32(self, physical_channel, attribute): value = ctypes.c_uint32() - cfunc = lib_importer.cdll.DAQmxGetPhysicalChanAttribute - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxGetPhysicalChanAttribute + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ ctypes_byte_str, ctypes.c_int32] - error_code = cfunc( + error_code = c_func( physical_channel, attribute, ctypes.byref(value)) self.check_for_error(error_code) return value.value def get_physical_chan_attribute_uint32_array( self, physical_channel, attribute): - cfunc = lib_importer.cdll.DAQmxGetPhysicalChanAttribute - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxGetPhysicalChanAttribute + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ ctypes_byte_str, ctypes.c_int32] temp_size = 0 while True: value = numpy.zeros(temp_size, dtype=numpy.uint32) - size_or_code = cfunc( + size_or_code = c_func( physical_channel, attribute, value.ctypes.data_as(ctypes.c_void_p), temp_size) if is_array_buffer_too_small(size_or_code): @@ -3296,14 +3296,14 @@ def get_physical_chan_attribute_uint32_array( def get_read_attribute_bool(self, task, attribute): value = c_bool32() - cfunc = lib_importer.cdll.DAQmxGetReadAttribute - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxGetReadAttribute + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes.c_int32] - error_code = cfunc( + error_code = c_func( task, attribute, ctypes.byref(value)) self.check_for_error(error_code) return value.value @@ -3311,14 +3311,14 @@ def get_read_attribute_bool(self, task, attribute): def get_read_attribute_double(self, task, attribute): value = ctypes.c_double() - cfunc = lib_importer.cdll.DAQmxGetReadAttribute - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxGetReadAttribute + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes.c_int32] - error_code = cfunc( + error_code = c_func( task, attribute, ctypes.byref(value)) self.check_for_error(error_code) return value.value @@ -3326,30 +3326,30 @@ def get_read_attribute_double(self, task, attribute): def get_read_attribute_int32(self, task, attribute): value = ctypes.c_int32() - cfunc = lib_importer.cdll.DAQmxGetReadAttribute - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxGetReadAttribute + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes.c_int32] - error_code = cfunc( + error_code = c_func( task, attribute, ctypes.byref(value)) self.check_for_error(error_code) return value.value def get_read_attribute_string(self, task, attribute, size_hint=0): - cfunc = lib_importer.cdll.DAQmxGetReadAttribute - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxGetReadAttribute + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes.c_int32] temp_size = size_hint while True: value = ctypes.create_string_buffer(temp_size) - size_or_code = cfunc( + size_or_code = c_func( task, attribute, value, temp_size) if is_string_buffer_too_small(size_or_code): # Buffer size must have changed between calls; check again. @@ -3365,14 +3365,14 @@ def get_read_attribute_string(self, task, attribute, size_hint=0): def get_read_attribute_uint32(self, task, attribute): value = ctypes.c_uint32() - cfunc = lib_importer.cdll.DAQmxGetReadAttribute - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxGetReadAttribute + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes.c_int32] - error_code = cfunc( + error_code = c_func( task, attribute, ctypes.byref(value)) self.check_for_error(error_code) return value.value @@ -3380,14 +3380,14 @@ def get_read_attribute_uint32(self, task, attribute): def get_read_attribute_uint64(self, task, attribute): value = ctypes.c_uint64() - cfunc = lib_importer.cdll.DAQmxGetReadAttribute - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxGetReadAttribute + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes.c_int32] - error_code = cfunc( + error_code = c_func( task, attribute, ctypes.byref(value)) self.check_for_error(error_code) return value.value @@ -3395,30 +3395,30 @@ def get_read_attribute_uint64(self, task, attribute): def get_scale_attribute_double(self, scale_name, attribute): value = ctypes.c_double() - cfunc = lib_importer.cdll.DAQmxGetScaleAttribute - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxGetScaleAttribute + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ ctypes_byte_str, ctypes.c_int32] - error_code = cfunc( + error_code = c_func( scale_name, attribute, ctypes.byref(value)) self.check_for_error(error_code) return value.value def get_scale_attribute_double_array(self, scale_name, attribute): - cfunc = lib_importer.cdll.DAQmxGetScaleAttribute - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxGetScaleAttribute + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ ctypes_byte_str, ctypes.c_int32] temp_size = 0 while True: value = numpy.zeros(temp_size, dtype=numpy.float64) - size_or_code = cfunc( + size_or_code = c_func( scale_name, attribute, value.ctypes.data_as(ctypes.c_void_p), temp_size) if is_array_buffer_too_small(size_or_code): @@ -3435,30 +3435,30 @@ def get_scale_attribute_double_array(self, scale_name, attribute): def get_scale_attribute_int32(self, scale_name, attribute): value = ctypes.c_int32() - cfunc = lib_importer.cdll.DAQmxGetScaleAttribute - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxGetScaleAttribute + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ ctypes_byte_str, ctypes.c_int32] - error_code = cfunc( + error_code = c_func( scale_name, attribute, ctypes.byref(value)) self.check_for_error(error_code) return value.value def get_scale_attribute_string(self, scale_name, attribute): - cfunc = lib_importer.cdll.DAQmxGetScaleAttribute - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxGetScaleAttribute + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ ctypes_byte_str, ctypes.c_int32] temp_size = 0 while True: value = ctypes.create_string_buffer(temp_size) - size_or_code = cfunc( + size_or_code = c_func( scale_name, attribute, value, temp_size) if is_string_buffer_too_small(size_or_code): # Buffer size must have changed between calls; check again. @@ -3478,35 +3478,35 @@ def get_self_cal_last_date_and_time(self, device_name): hour = ctypes.c_uint() minute = ctypes.c_uint() - cfunc = lib_importer.windll.DAQmxGetSelfCalLastDateAndTime - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxGetSelfCalLastDateAndTime + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ ctypes_byte_str, ctypes.POINTER(ctypes.c_uint), ctypes.POINTER(ctypes.c_uint), ctypes.POINTER(ctypes.c_uint), ctypes.POINTER(ctypes.c_uint), ctypes.POINTER(ctypes.c_uint)] - error_code = cfunc( + error_code = c_func( device_name, ctypes.byref(year), ctypes.byref(month), ctypes.byref(day), ctypes.byref(hour), ctypes.byref(minute)) self.check_for_error(error_code) return year.value, month.value, day.value, hour.value, minute.value def get_system_info_attribute_string(self, attribute): - cfunc = lib_importer.cdll.DAQmxGetSystemInfoAttribute - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxGetSystemInfoAttribute + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ ctypes.c_int32] temp_size = 0 while True: value = ctypes.create_string_buffer(temp_size) - size_or_code = cfunc( + size_or_code = c_func( attribute, value, temp_size) if is_string_buffer_too_small(size_or_code): # Buffer size must have changed between calls; check again. @@ -3522,14 +3522,14 @@ def get_system_info_attribute_string(self, attribute): def get_system_info_attribute_uint32(self, attribute): value = ctypes.c_uint32() - cfunc = lib_importer.cdll.DAQmxGetSystemInfoAttribute - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxGetSystemInfoAttribute + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ ctypes.c_int32] - error_code = cfunc( + error_code = c_func( attribute, ctypes.byref(value)) self.check_for_error(error_code) return value.value @@ -3537,30 +3537,30 @@ def get_system_info_attribute_uint32(self, attribute): def get_task_attribute_bool(self, task, attribute): value = c_bool32() - cfunc = lib_importer.cdll.DAQmxGetTaskAttribute - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxGetTaskAttribute + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes.c_int32] - error_code = cfunc( + error_code = c_func( task, attribute, ctypes.byref(value)) self.check_for_error(error_code) return value.value def get_task_attribute_string(self, task, attribute): - cfunc = lib_importer.cdll.DAQmxGetTaskAttribute - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxGetTaskAttribute + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes.c_int32] temp_size = 0 while True: value = ctypes.create_string_buffer(temp_size) - size_or_code = cfunc( + size_or_code = c_func( task, attribute, value, temp_size) if is_string_buffer_too_small(size_or_code): # Buffer size must have changed between calls; check again. @@ -3576,14 +3576,14 @@ def get_task_attribute_string(self, task, attribute): def get_task_attribute_uint32(self, task, attribute): value = ctypes.c_uint32() - cfunc = lib_importer.cdll.DAQmxGetTaskAttribute - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxGetTaskAttribute + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes.c_int32] - error_code = cfunc( + error_code = c_func( task, attribute, ctypes.byref(value)) self.check_for_error(error_code) return value.value @@ -3591,14 +3591,14 @@ def get_task_attribute_uint32(self, task, attribute): def get_timing_attribute_bool(self, task, attribute): value = c_bool32() - cfunc = lib_importer.cdll.DAQmxGetTimingAttribute - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxGetTimingAttribute + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes.c_int32] - error_code = cfunc( + error_code = c_func( task, attribute, ctypes.byref(value)) self.check_for_error(error_code) return value.value @@ -3606,14 +3606,14 @@ def get_timing_attribute_bool(self, task, attribute): def get_timing_attribute_double(self, task, attribute): value = ctypes.c_double() - cfunc = lib_importer.cdll.DAQmxGetTimingAttribute - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxGetTimingAttribute + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes.c_int32] - error_code = cfunc( + error_code = c_func( task, attribute, ctypes.byref(value)) self.check_for_error(error_code) return value.value @@ -3621,15 +3621,15 @@ def get_timing_attribute_double(self, task, attribute): def get_timing_attribute_ex_bool(self, task, device_names, attribute): value = c_bool32() - cfunc = lib_importer.cdll.DAQmxGetTimingAttributeEx - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxGetTimingAttributeEx + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes_byte_str, ctypes.c_int32] - error_code = cfunc( + error_code = c_func( task, device_names, attribute, ctypes.byref(value)) self.check_for_error(error_code) return value.value @@ -3637,15 +3637,15 @@ def get_timing_attribute_ex_bool(self, task, device_names, attribute): def get_timing_attribute_ex_double(self, task, device_names, attribute): value = ctypes.c_double() - cfunc = lib_importer.cdll.DAQmxGetTimingAttributeEx - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxGetTimingAttributeEx + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes_byte_str, ctypes.c_int32] - error_code = cfunc( + error_code = c_func( task, device_names, attribute, ctypes.byref(value)) self.check_for_error(error_code) return value.value @@ -3653,32 +3653,32 @@ def get_timing_attribute_ex_double(self, task, device_names, attribute): def get_timing_attribute_ex_int32(self, task, device_names, attribute): value = ctypes.c_int32() - cfunc = lib_importer.cdll.DAQmxGetTimingAttributeEx - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxGetTimingAttributeEx + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes_byte_str, ctypes.c_int32] - error_code = cfunc( + error_code = c_func( task, device_names, attribute, ctypes.byref(value)) self.check_for_error(error_code) return value.value def get_timing_attribute_ex_string(self, task, device_names, attribute): - cfunc = lib_importer.cdll.DAQmxGetTimingAttributeEx - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxGetTimingAttributeEx + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes_byte_str, ctypes.c_int32] temp_size = 0 while True: value = ctypes.create_string_buffer(temp_size) - size_or_code = cfunc( + size_or_code = c_func( task, device_names, attribute, value, temp_size) if is_string_buffer_too_small(size_or_code): # Buffer size must have changed between calls; check again. @@ -3694,15 +3694,15 @@ def get_timing_attribute_ex_string(self, task, device_names, attribute): def get_timing_attribute_ex_uint32(self, task, device_names, attribute): value = ctypes.c_uint32() - cfunc = lib_importer.cdll.DAQmxGetTimingAttributeEx - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxGetTimingAttributeEx + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes_byte_str, ctypes.c_int32] - error_code = cfunc( + error_code = c_func( task, device_names, attribute, ctypes.byref(value)) self.check_for_error(error_code) return value.value @@ -3710,15 +3710,15 @@ def get_timing_attribute_ex_uint32(self, task, device_names, attribute): def get_timing_attribute_ex_uint64(self, task, device_names, attribute): value = ctypes.c_uint64() - cfunc = lib_importer.cdll.DAQmxGetTimingAttributeEx - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxGetTimingAttributeEx + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes_byte_str, ctypes.c_int32] - error_code = cfunc( + error_code = c_func( task, device_names, attribute, ctypes.byref(value)) self.check_for_error(error_code) return value.value @@ -3726,30 +3726,30 @@ def get_timing_attribute_ex_uint64(self, task, device_names, attribute): def get_timing_attribute_int32(self, task, attribute): value = ctypes.c_int32() - cfunc = lib_importer.cdll.DAQmxGetTimingAttribute - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxGetTimingAttribute + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes.c_int32] - error_code = cfunc( + error_code = c_func( task, attribute, ctypes.byref(value)) self.check_for_error(error_code) return value.value def get_timing_attribute_string(self, task, attribute): - cfunc = lib_importer.cdll.DAQmxGetTimingAttribute - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxGetTimingAttribute + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes.c_int32] temp_size = 0 while True: value = ctypes.create_string_buffer(temp_size) - size_or_code = cfunc( + size_or_code = c_func( task, attribute, value, temp_size) if is_string_buffer_too_small(size_or_code): # Buffer size must have changed between calls; check again. @@ -3765,14 +3765,14 @@ def get_timing_attribute_string(self, task, attribute): def get_timing_attribute_timestamp(self, task, attribute): value = AbsoluteTime() - cfunc = lib_importer.cdll.DAQmxGetTimingAttribute - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxGetTimingAttribute + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes.c_int32] - error_code = cfunc( + error_code = c_func( task, attribute, ctypes.byref(value)) self.check_for_error(error_code) return value.to_datetime() @@ -3780,14 +3780,14 @@ def get_timing_attribute_timestamp(self, task, attribute): def get_timing_attribute_uint32(self, task, attribute): value = ctypes.c_uint32() - cfunc = lib_importer.cdll.DAQmxGetTimingAttribute - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxGetTimingAttribute + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes.c_int32] - error_code = cfunc( + error_code = c_func( task, attribute, ctypes.byref(value)) self.check_for_error(error_code) return value.value @@ -3795,14 +3795,14 @@ def get_timing_attribute_uint32(self, task, attribute): def get_timing_attribute_uint64(self, task, attribute): value = ctypes.c_uint64() - cfunc = lib_importer.cdll.DAQmxGetTimingAttribute - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxGetTimingAttribute + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes.c_int32] - error_code = cfunc( + error_code = c_func( task, attribute, ctypes.byref(value)) self.check_for_error(error_code) return value.value @@ -3810,14 +3810,14 @@ def get_timing_attribute_uint64(self, task, attribute): def get_trig_attribute_bool(self, task, attribute): value = c_bool32() - cfunc = lib_importer.cdll.DAQmxGetTrigAttribute - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxGetTrigAttribute + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes.c_int32] - error_code = cfunc( + error_code = c_func( task, attribute, ctypes.byref(value)) self.check_for_error(error_code) return value.value @@ -3825,30 +3825,30 @@ def get_trig_attribute_bool(self, task, attribute): def get_trig_attribute_double(self, task, attribute): value = ctypes.c_double() - cfunc = lib_importer.cdll.DAQmxGetTrigAttribute - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxGetTrigAttribute + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes.c_int32] - error_code = cfunc( + error_code = c_func( task, attribute, ctypes.byref(value)) self.check_for_error(error_code) return value.value def get_trig_attribute_double_array(self, task, attribute): - cfunc = lib_importer.cdll.DAQmxGetTrigAttribute - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxGetTrigAttribute + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes.c_int32] temp_size = 0 while True: value = numpy.zeros(temp_size, dtype=numpy.float64) - size_or_code = cfunc( + size_or_code = c_func( task, attribute, value.ctypes.data_as(ctypes.c_void_p), temp_size) if is_array_buffer_too_small(size_or_code): @@ -3865,30 +3865,30 @@ def get_trig_attribute_double_array(self, task, attribute): def get_trig_attribute_int32(self, task, attribute): value = ctypes.c_int32() - cfunc = lib_importer.cdll.DAQmxGetTrigAttribute - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxGetTrigAttribute + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes.c_int32] - error_code = cfunc( + error_code = c_func( task, attribute, ctypes.byref(value)) self.check_for_error(error_code) return value.value def get_trig_attribute_int32_array(self, task, attribute): - cfunc = lib_importer.cdll.DAQmxGetTrigAttribute - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxGetTrigAttribute + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes.c_int32] temp_size = 0 while True: value = numpy.zeros(temp_size, dtype=numpy.int32) - size_or_code = cfunc( + size_or_code = c_func( task, attribute, value.ctypes.data_as(ctypes.c_void_p), temp_size) if is_array_buffer_too_small(size_or_code): @@ -3903,17 +3903,17 @@ def get_trig_attribute_int32_array(self, task, attribute): return value.tolist() def get_trig_attribute_string(self, task, attribute): - cfunc = lib_importer.cdll.DAQmxGetTrigAttribute - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxGetTrigAttribute + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes.c_int32] temp_size = 0 while True: value = ctypes.create_string_buffer(temp_size) - size_or_code = cfunc( + size_or_code = c_func( task, attribute, value, temp_size) if is_string_buffer_too_small(size_or_code): # Buffer size must have changed between calls; check again. @@ -3929,14 +3929,14 @@ def get_trig_attribute_string(self, task, attribute): def get_trig_attribute_timestamp(self, task, attribute): value = AbsoluteTime() - cfunc = lib_importer.cdll.DAQmxGetTrigAttribute - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxGetTrigAttribute + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes.c_int32] - error_code = cfunc( + error_code = c_func( task, attribute, ctypes.byref(value)) self.check_for_error(error_code) return value.to_datetime() @@ -3944,14 +3944,14 @@ def get_trig_attribute_timestamp(self, task, attribute): def get_trig_attribute_uint32(self, task, attribute): value = ctypes.c_uint32() - cfunc = lib_importer.cdll.DAQmxGetTrigAttribute - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxGetTrigAttribute + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes.c_int32] - error_code = cfunc( + error_code = c_func( task, attribute, ctypes.byref(value)) self.check_for_error(error_code) return value.value @@ -3959,15 +3959,15 @@ def get_trig_attribute_uint32(self, task, attribute): def get_watchdog_attribute_bool(self, task, lines, attribute): value = c_bool32() - cfunc = lib_importer.cdll.DAQmxGetWatchdogAttribute - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxGetWatchdogAttribute + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes_byte_str, ctypes.c_int32] - error_code = cfunc( + error_code = c_func( task, lines, attribute, ctypes.byref(value)) self.check_for_error(error_code) return value.value @@ -3975,15 +3975,15 @@ def get_watchdog_attribute_bool(self, task, lines, attribute): def get_watchdog_attribute_double(self, task, lines, attribute): value = ctypes.c_double() - cfunc = lib_importer.cdll.DAQmxGetWatchdogAttribute - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxGetWatchdogAttribute + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes_byte_str, ctypes.c_int32] - error_code = cfunc( + error_code = c_func( task, lines, attribute, ctypes.byref(value)) self.check_for_error(error_code) return value.value @@ -3991,32 +3991,32 @@ def get_watchdog_attribute_double(self, task, lines, attribute): def get_watchdog_attribute_int32(self, task, lines, attribute): value = ctypes.c_int32() - cfunc = lib_importer.cdll.DAQmxGetWatchdogAttribute - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxGetWatchdogAttribute + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes_byte_str, ctypes.c_int32] - error_code = cfunc( + error_code = c_func( task, lines, attribute, ctypes.byref(value)) self.check_for_error(error_code) return value.value def get_watchdog_attribute_string(self, task, lines, attribute): - cfunc = lib_importer.cdll.DAQmxGetWatchdogAttribute - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxGetWatchdogAttribute + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes_byte_str, ctypes.c_int32] temp_size = 0 while True: value = ctypes.create_string_buffer(temp_size) - size_or_code = cfunc( + size_or_code = c_func( task, lines, attribute, value, temp_size) if is_string_buffer_too_small(size_or_code): # Buffer size must have changed between calls; check again. @@ -4032,14 +4032,14 @@ def get_watchdog_attribute_string(self, task, lines, attribute): def get_write_attribute_bool(self, task, attribute): value = c_bool32() - cfunc = lib_importer.cdll.DAQmxGetWriteAttribute - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxGetWriteAttribute + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes.c_int32] - error_code = cfunc( + error_code = c_func( task, attribute, ctypes.byref(value)) self.check_for_error(error_code) return value.value @@ -4047,14 +4047,14 @@ def get_write_attribute_bool(self, task, attribute): def get_write_attribute_double(self, task, attribute): value = ctypes.c_double() - cfunc = lib_importer.cdll.DAQmxGetWriteAttribute - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxGetWriteAttribute + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes.c_int32] - error_code = cfunc( + error_code = c_func( task, attribute, ctypes.byref(value)) self.check_for_error(error_code) return value.value @@ -4062,30 +4062,30 @@ def get_write_attribute_double(self, task, attribute): def get_write_attribute_int32(self, task, attribute): value = ctypes.c_int32() - cfunc = lib_importer.cdll.DAQmxGetWriteAttribute - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxGetWriteAttribute + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes.c_int32] - error_code = cfunc( + error_code = c_func( task, attribute, ctypes.byref(value)) self.check_for_error(error_code) return value.value def get_write_attribute_string(self, task, attribute, size_hint=0): - cfunc = lib_importer.cdll.DAQmxGetWriteAttribute - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxGetWriteAttribute + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes.c_int32] temp_size = size_hint while True: value = ctypes.create_string_buffer(temp_size) - size_or_code = cfunc( + size_or_code = c_func( task, attribute, value, temp_size) if is_string_buffer_too_small(size_or_code): # Buffer size must have changed between calls; check again. @@ -4101,14 +4101,14 @@ def get_write_attribute_string(self, task, attribute, size_hint=0): def get_write_attribute_uint32(self, task, attribute): value = ctypes.c_uint32() - cfunc = lib_importer.cdll.DAQmxGetWriteAttribute - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxGetWriteAttribute + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes.c_int32] - error_code = cfunc( + error_code = c_func( task, attribute, ctypes.byref(value)) self.check_for_error(error_code) return value.value @@ -4116,30 +4116,30 @@ def get_write_attribute_uint32(self, task, attribute): def get_write_attribute_uint64(self, task, attribute): value = ctypes.c_uint64() - cfunc = lib_importer.cdll.DAQmxGetWriteAttribute - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxGetWriteAttribute + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes.c_int32] - error_code = cfunc( + error_code = c_func( task, attribute, ctypes.byref(value)) self.check_for_error(error_code) return value.value def internal_get_last_created_chan(self): - cfunc = lib_importer.windll.DAQmxInternalGetLastCreatedChan - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxInternalGetLastCreatedChan + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ ctypes.c_char_p, ctypes.c_uint] temp_size = 0 while True: value = ctypes.create_string_buffer(temp_size) - size_or_code = cfunc( + size_or_code = c_func( value, temp_size) if is_string_buffer_too_small(size_or_code): # Buffer size must have changed between calls; check again. @@ -4155,14 +4155,14 @@ def internal_get_last_created_chan(self): def is_task_done(self, task): is_task_done = c_bool32() - cfunc = lib_importer.windll.DAQmxIsTaskDone - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxIsTaskDone + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes.POINTER(c_bool32)] - error_code = cfunc( + error_code = c_func( task, ctypes.byref(is_task_done)) self.check_for_error(error_code) return is_task_done.value @@ -4171,29 +4171,29 @@ def load_task(self, session_name): new_session_initialized = True task = lib_importer.task_handle(0) - cfunc = lib_importer.windll.DAQmxLoadTask - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxLoadTask + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ ctypes_byte_str, ctypes.POINTER(lib_importer.task_handle)] - error_code = cfunc( + error_code = c_func( session_name, ctypes.byref(task)) self.check_for_error(error_code) return task, new_session_initialized def perform_bridge_offset_nulling_cal_ex( self, task, channel, skip_unsupported_channels): - cfunc = lib_importer.windll.DAQmxPerformBridgeOffsetNullingCalEx - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxPerformBridgeOffsetNullingCalEx + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes_byte_str, c_bool32] - error_code = cfunc( + error_code = c_func( task, channel, skip_unsupported_channels) self.check_for_error(error_code) @@ -4202,16 +4202,16 @@ def perform_bridge_shunt_cal_ex( shunt_resistor_location, shunt_resistor_select, shunt_resistor_source, bridge_resistance, skip_unsupported_channels): - cfunc = lib_importer.windll.DAQmxPerformBridgeShuntCalEx - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxPerformBridgeShuntCalEx + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes_byte_str, ctypes.c_double, ctypes.c_int, ctypes.c_int, ctypes.c_int, ctypes.c_double, c_bool32] - error_code = cfunc( + error_code = c_func( task, channel, shunt_resistor_value, shunt_resistor_location, shunt_resistor_select, shunt_resistor_source, bridge_resistance, skip_unsupported_channels) @@ -4221,16 +4221,16 @@ def perform_strain_shunt_cal_ex( self, task, channel, shunt_resistor_value, shunt_resistor_location, shunt_resistor_select, shunt_resistor_source, skip_unsupported_channels): - cfunc = lib_importer.windll.DAQmxPerformStrainShuntCalEx - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxPerformStrainShuntCalEx + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes_byte_str, ctypes.c_double, ctypes.c_int, ctypes.c_int, ctypes.c_int, c_bool32] - error_code = cfunc( + error_code = c_func( task, channel, shunt_resistor_value, shunt_resistor_location, shunt_resistor_select, shunt_resistor_source, skip_unsupported_channels) @@ -4238,14 +4238,14 @@ def perform_strain_shunt_cal_ex( def perform_thrmcpl_lead_offset_nulling_cal( self, task, channel, skip_unsupported_channels): - cfunc = lib_importer.windll.DAQmxPerformThrmcplLeadOffsetNullingCal - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxPerformThrmcplLeadOffsetNullingCal + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes_byte_str, c_bool32] - error_code = cfunc( + error_code = c_func( task, channel, skip_unsupported_channels) self.check_for_error(error_code) @@ -4253,18 +4253,18 @@ def read_analog_f64( self, task, num_samps_per_chan, timeout, fill_mode, read_array): samps_per_chan_read = ctypes.c_int() - cfunc = lib_importer.windll.DAQmxReadAnalogF64 - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxReadAnalogF64 + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes.c_int, ctypes.c_double, ctypes.c_int, wrapped_ndpointer(dtype=numpy.float64, flags=('C','W')), ctypes.c_uint, ctypes.POINTER(ctypes.c_int), ctypes.POINTER(c_bool32)] - error_code = cfunc( + error_code = c_func( task, num_samps_per_chan, timeout, fill_mode, read_array, read_array.size, ctypes.byref(samps_per_chan_read), None) self.check_for_error(error_code, samps_per_chan_read=samps_per_chan_read.value) @@ -4273,16 +4273,16 @@ def read_analog_f64( def read_analog_scalar_f64(self, task, timeout): value = ctypes.c_double() - cfunc = lib_importer.windll.DAQmxReadAnalogScalarF64 - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxReadAnalogScalarF64 + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes.c_double, ctypes.POINTER(ctypes.c_double), ctypes.POINTER(c_bool32)] - error_code = cfunc( + error_code = c_func( task, timeout, ctypes.byref(value), None) self.check_for_error(error_code) return value.value @@ -4291,18 +4291,18 @@ def read_binary_i16( self, task, num_samps_per_chan, timeout, fill_mode, read_array): samps_per_chan_read = ctypes.c_int() - cfunc = lib_importer.windll.DAQmxReadBinaryI16 - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxReadBinaryI16 + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes.c_int, ctypes.c_double, ctypes.c_int, wrapped_ndpointer(dtype=numpy.int16, flags=('C','W')), ctypes.c_uint, ctypes.POINTER(ctypes.c_int), ctypes.POINTER(c_bool32)] - error_code = cfunc( + error_code = c_func( task, num_samps_per_chan, timeout, fill_mode, read_array, read_array.size, ctypes.byref(samps_per_chan_read), None) self.check_for_error(error_code, samps_per_chan_read=samps_per_chan_read.value) @@ -4312,18 +4312,18 @@ def read_binary_i32( self, task, num_samps_per_chan, timeout, fill_mode, read_array): samps_per_chan_read = ctypes.c_int() - cfunc = lib_importer.windll.DAQmxReadBinaryI32 - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxReadBinaryI32 + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes.c_int, ctypes.c_double, ctypes.c_int, wrapped_ndpointer(dtype=numpy.int32, flags=('C','W')), ctypes.c_uint, ctypes.POINTER(ctypes.c_int), ctypes.POINTER(c_bool32)] - error_code = cfunc( + error_code = c_func( task, num_samps_per_chan, timeout, fill_mode, read_array, read_array.size, ctypes.byref(samps_per_chan_read), None) self.check_for_error(error_code, samps_per_chan_read=samps_per_chan_read.value) @@ -4333,18 +4333,18 @@ def read_binary_u16( self, task, num_samps_per_chan, timeout, fill_mode, read_array): samps_per_chan_read = ctypes.c_int() - cfunc = lib_importer.windll.DAQmxReadBinaryU16 - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxReadBinaryU16 + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes.c_int, ctypes.c_double, ctypes.c_int, wrapped_ndpointer(dtype=numpy.uint16, flags=('C','W')), ctypes.c_uint, ctypes.POINTER(ctypes.c_int), ctypes.POINTER(c_bool32)] - error_code = cfunc( + error_code = c_func( task, num_samps_per_chan, timeout, fill_mode, read_array, read_array.size, ctypes.byref(samps_per_chan_read), None) self.check_for_error(error_code, samps_per_chan_read=samps_per_chan_read.value) @@ -4354,18 +4354,18 @@ def read_binary_u32( self, task, num_samps_per_chan, timeout, fill_mode, read_array): samps_per_chan_read = ctypes.c_int() - cfunc = lib_importer.windll.DAQmxReadBinaryU32 - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxReadBinaryU32 + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes.c_int, ctypes.c_double, ctypes.c_int, wrapped_ndpointer(dtype=numpy.uint32, flags=('C','W')), ctypes.c_uint, ctypes.POINTER(ctypes.c_int), ctypes.POINTER(c_bool32)] - error_code = cfunc( + error_code = c_func( task, num_samps_per_chan, timeout, fill_mode, read_array, read_array.size, ctypes.byref(samps_per_chan_read), None) self.check_for_error(error_code, samps_per_chan_read=samps_per_chan_read.value) @@ -4374,18 +4374,18 @@ def read_binary_u32( def read_counter_f64(self, task, num_samps_per_chan, timeout, read_array): samps_per_chan_read = ctypes.c_int() - cfunc = lib_importer.windll.DAQmxReadCounterF64 - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxReadCounterF64 + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes.c_int, ctypes.c_double, wrapped_ndpointer(dtype=numpy.float64, flags=('C','W')), ctypes.c_uint, ctypes.POINTER(ctypes.c_int), ctypes.POINTER(c_bool32)] - error_code = cfunc( + error_code = c_func( task, num_samps_per_chan, timeout, read_array, read_array.size, ctypes.byref(samps_per_chan_read), None) self.check_for_error(error_code, samps_per_chan_read=samps_per_chan_read.value) @@ -4395,18 +4395,18 @@ def read_counter_f64_ex( self, task, num_samps_per_chan, timeout, fill_mode, read_array): samps_per_chan_read = ctypes.c_int() - cfunc = lib_importer.windll.DAQmxReadCounterF64Ex - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxReadCounterF64Ex + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes.c_int, ctypes.c_double, ctypes.c_int, wrapped_ndpointer(dtype=numpy.float64, flags=('C','W')), ctypes.c_uint, ctypes.POINTER(ctypes.c_int), ctypes.POINTER(c_bool32)] - error_code = cfunc( + error_code = c_func( task, num_samps_per_chan, timeout, fill_mode, read_array, read_array.size, ctypes.byref(samps_per_chan_read), None) self.check_for_error(error_code, samps_per_chan_read=samps_per_chan_read.value) @@ -4415,16 +4415,16 @@ def read_counter_f64_ex( def read_counter_scalar_f64(self, task, timeout): value = ctypes.c_double() - cfunc = lib_importer.windll.DAQmxReadCounterScalarF64 - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxReadCounterScalarF64 + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes.c_double, ctypes.POINTER(ctypes.c_double), ctypes.POINTER(c_bool32)] - error_code = cfunc( + error_code = c_func( task, timeout, ctypes.byref(value), None) self.check_for_error(error_code) return value.value @@ -4432,16 +4432,16 @@ def read_counter_scalar_f64(self, task, timeout): def read_counter_scalar_u32(self, task, timeout): value = ctypes.c_uint() - cfunc = lib_importer.windll.DAQmxReadCounterScalarU32 - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxReadCounterScalarU32 + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes.c_double, ctypes.POINTER(ctypes.c_uint), ctypes.POINTER(c_bool32)] - error_code = cfunc( + error_code = c_func( task, timeout, ctypes.byref(value), None) self.check_for_error(error_code) return value.value @@ -4449,17 +4449,17 @@ def read_counter_scalar_u32(self, task, timeout): def read_counter_u32(self, task, num_samps_per_chan, timeout, read_array): samps_per_chan_read = ctypes.c_int() - cfunc = lib_importer.windll.DAQmxReadCounterU32 - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxReadCounterU32 + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes.c_int, ctypes.c_double, wrapped_ndpointer(dtype=numpy.uint32, flags=('C','W')), ctypes.c_uint, ctypes.POINTER(ctypes.c_int), ctypes.POINTER(c_bool32)] - error_code = cfunc( + error_code = c_func( task, num_samps_per_chan, timeout, read_array, read_array.size, ctypes.byref(samps_per_chan_read), None) self.check_for_error(error_code, samps_per_chan_read=samps_per_chan_read.value) @@ -4469,18 +4469,18 @@ def read_counter_u32_ex( self, task, num_samps_per_chan, timeout, fill_mode, read_array): samps_per_chan_read = ctypes.c_int() - cfunc = lib_importer.windll.DAQmxReadCounterU32Ex - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxReadCounterU32Ex + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes.c_int, ctypes.c_double, ctypes.c_int, wrapped_ndpointer(dtype=numpy.uint32, flags=('C','W')), ctypes.c_uint, ctypes.POINTER(ctypes.c_int), ctypes.POINTER(c_bool32)] - error_code = cfunc( + error_code = c_func( task, num_samps_per_chan, timeout, fill_mode, read_array, read_array.size, ctypes.byref(samps_per_chan_read), None) self.check_for_error(error_code, samps_per_chan_read=samps_per_chan_read.value) @@ -4491,11 +4491,11 @@ def read_ctr_freq( read_array_frequency, read_array_duty_cycle): samps_per_chan_read = ctypes.c_int() - cfunc = lib_importer.windll.DAQmxReadCtrFreq - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxReadCtrFreq + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes.c_int, ctypes.c_double, ctypes.c_int, wrapped_ndpointer(dtype=numpy.float64, @@ -4504,7 +4504,7 @@ def read_ctr_freq( flags=('C','W')), ctypes.c_uint, ctypes.POINTER(ctypes.c_int), ctypes.POINTER(c_bool32)] - error_code = cfunc( + error_code = c_func( task, num_samps_per_chan, timeout, interleaved, read_array_frequency, read_array_duty_cycle, read_array_duty_cycle.size, ctypes.byref(samps_per_chan_read), @@ -4516,17 +4516,17 @@ def read_ctr_freq_scalar(self, task, timeout): frequency = ctypes.c_double() duty_cycle = ctypes.c_double() - cfunc = lib_importer.windll.DAQmxReadCtrFreqScalar - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxReadCtrFreqScalar + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes.c_double, ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(c_bool32)] - error_code = cfunc( + error_code = c_func( task, timeout, ctypes.byref(frequency), ctypes.byref(duty_cycle), None) self.check_for_error(error_code) @@ -4537,11 +4537,11 @@ def read_ctr_ticks( read_array_high_ticks, read_array_low_ticks): samps_per_chan_read = ctypes.c_int() - cfunc = lib_importer.windll.DAQmxReadCtrTicks - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxReadCtrTicks + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes.c_int, ctypes.c_double, ctypes.c_int, wrapped_ndpointer(dtype=numpy.uint32, @@ -4550,7 +4550,7 @@ def read_ctr_ticks( flags=('C','W')), ctypes.c_uint, ctypes.POINTER(ctypes.c_int), ctypes.POINTER(c_bool32)] - error_code = cfunc( + error_code = c_func( task, num_samps_per_chan, timeout, interleaved, read_array_high_ticks, read_array_low_ticks, read_array_low_ticks.size, ctypes.byref(samps_per_chan_read), None) @@ -4561,17 +4561,17 @@ def read_ctr_ticks_scalar(self, task, timeout): high_ticks = ctypes.c_uint32() low_ticks = ctypes.c_uint32() - cfunc = lib_importer.windll.DAQmxReadCtrTicksScalar - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxReadCtrTicksScalar + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes.c_double, ctypes.POINTER(ctypes.c_uint32), ctypes.POINTER(ctypes.c_uint32), ctypes.POINTER(c_bool32)] - error_code = cfunc( + error_code = c_func( task, timeout, ctypes.byref(high_ticks), ctypes.byref(low_ticks), None) self.check_for_error(error_code) @@ -4582,11 +4582,11 @@ def read_ctr_time( read_array_high_time, read_array_low_time): samps_per_chan_read = ctypes.c_int() - cfunc = lib_importer.windll.DAQmxReadCtrTime - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxReadCtrTime + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes.c_int, ctypes.c_double, ctypes.c_int, wrapped_ndpointer(dtype=numpy.float64, @@ -4595,7 +4595,7 @@ def read_ctr_time( flags=('C','W')), ctypes.c_uint, ctypes.POINTER(ctypes.c_int), ctypes.POINTER(c_bool32)] - error_code = cfunc( + error_code = c_func( task, num_samps_per_chan, timeout, interleaved, read_array_high_time, read_array_low_time, read_array_low_time.size, ctypes.byref(samps_per_chan_read), None) @@ -4606,17 +4606,17 @@ def read_ctr_time_scalar(self, task, timeout): high_time = ctypes.c_double() low_time = ctypes.c_double() - cfunc = lib_importer.windll.DAQmxReadCtrTimeScalar - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxReadCtrTimeScalar + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes.c_double, ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(c_bool32)] - error_code = cfunc( + error_code = c_func( task, timeout, ctypes.byref(high_time), ctypes.byref(low_time), None) self.check_for_error(error_code) @@ -4627,18 +4627,18 @@ def read_digital_lines( samps_per_chan_read = ctypes.c_int() num_bytes_per_samp = ctypes.c_int() - cfunc = lib_importer.windll.DAQmxReadDigitalLines - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxReadDigitalLines + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes.c_int, ctypes.c_double, ctypes.c_int, wrapped_ndpointer(dtype=bool, flags=('C','W')), ctypes.c_uint, ctypes.POINTER(ctypes.c_int), ctypes.POINTER(ctypes.c_int), ctypes.POINTER(c_bool32)] - error_code = cfunc( + error_code = c_func( task, num_samps_per_chan, timeout, fill_mode, read_array, read_array.size, ctypes.byref(samps_per_chan_read), ctypes.byref(num_bytes_per_samp), None) @@ -4648,16 +4648,16 @@ def read_digital_lines( def read_digital_scalar_u32(self, task, timeout): value = ctypes.c_uint() - cfunc = lib_importer.windll.DAQmxReadDigitalScalarU32 - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxReadDigitalScalarU32 + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes.c_double, ctypes.POINTER(ctypes.c_uint), ctypes.POINTER(c_bool32)] - error_code = cfunc( + error_code = c_func( task, timeout, ctypes.byref(value), None) self.check_for_error(error_code) return value.value @@ -4666,18 +4666,18 @@ def read_digital_u16( self, task, num_samps_per_chan, timeout, fill_mode, read_array): samps_per_chan_read = ctypes.c_int() - cfunc = lib_importer.windll.DAQmxReadDigitalU16 - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxReadDigitalU16 + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes.c_int, ctypes.c_double, ctypes.c_int, wrapped_ndpointer(dtype=numpy.uint16, flags=('C','W')), ctypes.c_uint, ctypes.POINTER(ctypes.c_int), ctypes.POINTER(c_bool32)] - error_code = cfunc( + error_code = c_func( task, num_samps_per_chan, timeout, fill_mode, read_array, read_array.size, ctypes.byref(samps_per_chan_read), None) self.check_for_error(error_code, samps_per_chan_read=samps_per_chan_read.value) @@ -4687,18 +4687,18 @@ def read_digital_u32( self, task, num_samps_per_chan, timeout, fill_mode, read_array): samps_per_chan_read = ctypes.c_int() - cfunc = lib_importer.windll.DAQmxReadDigitalU32 - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxReadDigitalU32 + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes.c_int, ctypes.c_double, ctypes.c_int, wrapped_ndpointer(dtype=numpy.uint32, flags=('C','W')), ctypes.c_uint, ctypes.POINTER(ctypes.c_int), ctypes.POINTER(c_bool32)] - error_code = cfunc( + error_code = c_func( task, num_samps_per_chan, timeout, fill_mode, read_array, read_array.size, ctypes.byref(samps_per_chan_read), None) self.check_for_error(error_code, samps_per_chan_read=samps_per_chan_read.value) @@ -4708,18 +4708,18 @@ def read_digital_u8( self, task, num_samps_per_chan, timeout, fill_mode, read_array): samps_per_chan_read = ctypes.c_int() - cfunc = lib_importer.windll.DAQmxReadDigitalU8 - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxReadDigitalU8 + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes.c_int, ctypes.c_double, ctypes.c_int, wrapped_ndpointer(dtype=numpy.uint8, flags=('C','W')), ctypes.c_uint, ctypes.POINTER(ctypes.c_int), ctypes.POINTER(c_bool32)] - error_code = cfunc( + error_code = c_func( task, num_samps_per_chan, timeout, fill_mode, read_array, read_array.size, ctypes.byref(samps_per_chan_read), None) self.check_for_error(error_code, samps_per_chan_read=samps_per_chan_read.value) @@ -4729,17 +4729,17 @@ def read_power_scalar_f64(self, task, timeout): voltage = ctypes.c_double() current = ctypes.c_double() - cfunc = lib_importer.windll.DAQmxReadPowerScalarF64 - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxReadPowerScalarF64 + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes.c_double, ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.c_double), ctypes.POINTER(c_bool32)] - error_code = cfunc( + error_code = c_func( task, timeout, ctypes.byref(voltage), ctypes.byref(current), None) self.check_for_error(error_code) return voltage.value, current.value @@ -4750,11 +4750,11 @@ def register_done_event( ctypes.c_int32, lib_importer.task_handle, ctypes.c_int, ctypes.c_void_p) - cfunc = lib_importer.windll.DAQmxRegisterDoneEvent - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxRegisterDoneEvent + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes.c_uint, DAQmxDoneEventCallbackPtr, ctypes.POINTER(ctypes.c_void_p)] @@ -4762,7 +4762,7 @@ def register_done_event( assert callback_function is not None callback_method_ptr = DAQmxDoneEventCallbackPtr(callback_function) - error_code = cfunc( + error_code = c_func( task, options, callback_method_ptr, callback_data) self.check_for_error(error_code) @@ -4775,11 +4775,11 @@ def register_every_n_samples_event( ctypes.c_int32, lib_importer.task_handle, ctypes.c_int, ctypes.c_uint, ctypes.c_void_p) - cfunc = lib_importer.windll.DAQmxRegisterEveryNSamplesEvent - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxRegisterEveryNSamplesEvent + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes.c_int, ctypes.c_uint, ctypes.c_uint, DAQmxEveryNSamplesEventCallbackPtr, ctypes.POINTER(ctypes.c_void_p)] @@ -4787,7 +4787,7 @@ def register_every_n_samples_event( assert callback_function is not None callback_method_ptr = DAQmxEveryNSamplesEventCallbackPtr(callback_function) - error_code = cfunc( + error_code = c_func( task, every_n_samples_event_type, n_samples, options, callback_method_ptr, callback_data) self.check_for_error(error_code) @@ -4800,11 +4800,11 @@ def register_signal_event( ctypes.c_int32, lib_importer.task_handle, ctypes.c_int, ctypes.c_void_p) - cfunc = lib_importer.windll.DAQmxRegisterSignalEvent - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxRegisterSignalEvent + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes.c_int, ctypes.c_uint, DAQmxSignalEventCallbackPtr, ctypes.POINTER(ctypes.c_void_p)] @@ -4812,231 +4812,231 @@ def register_signal_event( assert callback_function is not None callback_method_ptr = DAQmxSignalEventCallbackPtr(callback_function) - error_code = cfunc( + error_code = c_func( task, signal_id, options, callback_method_ptr, callback_data) self.check_for_error(error_code) return LibraryEventHandler(callback_method_ptr) def remove_cdaq_sync_connection(self, port_list): - cfunc = lib_importer.windll.DAQmxRemoveCDAQSyncConnection - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxRemoveCDAQSyncConnection + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ ctypes_byte_str] - error_code = cfunc( + error_code = c_func( port_list) self.check_for_error(error_code) def reserve_network_device(self, device_name, override_reservation): - cfunc = lib_importer.windll.DAQmxReserveNetworkDevice - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxReserveNetworkDevice + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ ctypes_byte_str, c_bool32] - error_code = cfunc( + error_code = c_func( device_name, override_reservation) self.check_for_error(error_code) def reset_buffer_attribute(self, task, attribute): - cfunc = lib_importer.windll.DAQmxResetBufferAttribute - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxResetBufferAttribute + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes.c_int32] - error_code = cfunc( + error_code = c_func( task, attribute) self.check_for_error(error_code) def reset_chan_attribute(self, task, channel, attribute): - cfunc = lib_importer.windll.DAQmxResetChanAttribute - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxResetChanAttribute + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes_byte_str, ctypes.c_int32] - error_code = cfunc( + error_code = c_func( task, channel, attribute) self.check_for_error(error_code) def reset_device(self, device_name): - cfunc = lib_importer.windll.DAQmxResetDevice - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxResetDevice + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ ctypes_byte_str] - error_code = cfunc( + error_code = c_func( device_name) self.check_for_error(error_code) def reset_exported_signal_attribute(self, task, attribute): - cfunc = lib_importer.windll.DAQmxResetExportedSignalAttribute - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxResetExportedSignalAttribute + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes.c_int] - error_code = cfunc( + error_code = c_func( task, attribute) self.check_for_error(error_code) def reset_read_attribute(self, task, attribute): - cfunc = lib_importer.windll.DAQmxResetReadAttribute - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxResetReadAttribute + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes.c_int] - error_code = cfunc( + error_code = c_func( task, attribute) self.check_for_error(error_code) def reset_timing_attribute(self, task, attribute): - cfunc = lib_importer.windll.DAQmxResetTimingAttribute - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxResetTimingAttribute + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes.c_int] - error_code = cfunc( + error_code = c_func( task, attribute) self.check_for_error(error_code) def reset_timing_attribute_ex(self, task, device_names, attribute): - cfunc = lib_importer.windll.DAQmxResetTimingAttributeEx - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxResetTimingAttributeEx + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes_byte_str, ctypes.c_int] - error_code = cfunc( + error_code = c_func( task, device_names, attribute) self.check_for_error(error_code) def reset_trig_attribute(self, task, attribute): - cfunc = lib_importer.windll.DAQmxResetTrigAttribute - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxResetTrigAttribute + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes.c_int] - error_code = cfunc( + error_code = c_func( task, attribute) self.check_for_error(error_code) def reset_watchdog_attribute(self, task, lines, attribute): - cfunc = lib_importer.windll.DAQmxResetWatchdogAttribute - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxResetWatchdogAttribute + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes_byte_str, ctypes.c_int] - error_code = cfunc( + error_code = c_func( task, lines, attribute) self.check_for_error(error_code) def reset_write_attribute(self, task, attribute): - cfunc = lib_importer.windll.DAQmxResetWriteAttribute - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxResetWriteAttribute + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes.c_int] - error_code = cfunc( + error_code = c_func( task, attribute) self.check_for_error(error_code) def restore_last_ext_cal_const(self, device_name): - cfunc = lib_importer.windll.DAQmxRestoreLastExtCalConst - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxRestoreLastExtCalConst + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ ctypes_byte_str] - error_code = cfunc( + error_code = c_func( device_name) self.check_for_error(error_code) def save_global_chan(self, task, channel_name, save_as, author, options): - cfunc = lib_importer.windll.DAQmxSaveGlobalChan - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxSaveGlobalChan + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes_byte_str, ctypes_byte_str, ctypes_byte_str, ctypes.c_uint32] - error_code = cfunc( + error_code = c_func( task, channel_name, save_as, author, options) self.check_for_error(error_code) def save_scale(self, scale_name, save_as, author, options): - cfunc = lib_importer.windll.DAQmxSaveScale - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxSaveScale + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ ctypes_byte_str, ctypes_byte_str, ctypes_byte_str, ctypes.c_uint32] - error_code = cfunc( + error_code = c_func( scale_name, save_as, author, options) self.check_for_error(error_code) def save_task(self, task, save_as, author, options): - cfunc = lib_importer.windll.DAQmxSaveTask - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxSaveTask + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes_byte_str, ctypes_byte_str, ctypes.c_uint32] - error_code = cfunc( + error_code = c_func( task, save_as, author, options) self.check_for_error(error_code) def self_cal(self, device_name): - cfunc = lib_importer.windll.DAQmxSelfCal - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxSelfCal + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ ctypes_byte_str] - error_code = cfunc( + error_code = c_func( device_name) self.check_for_error(error_code) def self_test_device(self, device_name): - cfunc = lib_importer.windll.DAQmxSelfTestDevice - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxSelfTestDevice + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ ctypes_byte_str] - error_code = cfunc( + error_code = c_func( device_name) self.check_for_error(error_code) @@ -5059,178 +5059,178 @@ def set_analog_power_up_states( args.append(None) argtypes.append(ctypes.c_void_p) - cfunc = lib_importer.cdll.DAQmxSetAnalogPowerUpStates - with cfunc.arglock: - cfunc.argtypes = argtypes - error_code = cfunc(*args) + c_func = lib_importer.cdll.DAQmxSetAnalogPowerUpStates + with c_func.arg_lock: + c_func.argtypes = argtypes + error_code = c_func(*args) self.check_for_error(error_code) def set_analog_power_up_states_with_output_type( self, channel_names, state_array, channel_type_array): - cfunc = lib_importer.cdll.DAQmxSetAnalogPowerUpStatesWithOutputType - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxSetAnalogPowerUpStatesWithOutputType + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ ctypes_byte_str, wrapped_ndpointer(dtype=numpy.float64, flags=('C')), wrapped_ndpointer(dtype=numpy.int32, flags=('C')), ctypes.c_uint] - error_code = cfunc( + error_code = c_func( channel_names, state_array, channel_type_array, len(channel_type_array)) self.check_for_error(error_code) def set_buffer_attribute_uint32(self, task, attribute, value): - cfunc = lib_importer.cdll.DAQmxSetBufferAttribute - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxSetBufferAttribute + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes.c_int32] - error_code = cfunc( + error_code = c_func( task, attribute, ctypes.c_uint32(value)) self.check_for_error(error_code) def set_cal_info_attribute_bool(self, device_name, attribute, value): - cfunc = lib_importer.cdll.DAQmxSetCalInfoAttribute - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxSetCalInfoAttribute + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ ctypes_byte_str, ctypes.c_int32] - error_code = cfunc( + error_code = c_func( device_name, attribute, c_bool32(value)) self.check_for_error(error_code) def set_cal_info_attribute_double(self, device_name, attribute, value): - cfunc = lib_importer.cdll.DAQmxSetCalInfoAttribute - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxSetCalInfoAttribute + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ ctypes_byte_str, ctypes.c_int32] - error_code = cfunc( + error_code = c_func( device_name, attribute, ctypes.c_double(value)) self.check_for_error(error_code) def set_cal_info_attribute_string(self, device_name, attribute, value): - cfunc = lib_importer.cdll.DAQmxSetCalInfoAttribute - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxSetCalInfoAttribute + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ ctypes_byte_str, ctypes.c_int32] - error_code = cfunc( + error_code = c_func( device_name, attribute, value.encode(lib_importer.encoding)) self.check_for_error(error_code) def set_cal_info_attribute_uint32(self, device_name, attribute, value): - cfunc = lib_importer.cdll.DAQmxSetCalInfoAttribute - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxSetCalInfoAttribute + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ ctypes_byte_str, ctypes.c_int32] - error_code = cfunc( + error_code = c_func( device_name, attribute, ctypes.c_uint32(value)) self.check_for_error(error_code) def set_chan_attribute_bool(self, task, channel, attribute, value): - cfunc = lib_importer.cdll.DAQmxSetChanAttribute - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxSetChanAttribute + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes_byte_str, ctypes.c_int32] - error_code = cfunc( + error_code = c_func( task, channel, attribute, c_bool32(value)) self.check_for_error(error_code) def set_chan_attribute_double(self, task, channel, attribute, value): - cfunc = lib_importer.cdll.DAQmxSetChanAttribute - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxSetChanAttribute + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes_byte_str, ctypes.c_int32] - error_code = cfunc( + error_code = c_func( task, channel, attribute, ctypes.c_double(value)) self.check_for_error(error_code) def set_chan_attribute_double_array(self, task, channel, attribute, value): - cfunc = lib_importer.cdll.DAQmxSetChanAttribute - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxSetChanAttribute + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes_byte_str, ctypes.c_int32] - error_code = cfunc( + error_code = c_func( task, channel, attribute, value.ctypes.data_as(ctypes.c_void_p), len(value)) self.check_for_error(error_code) def set_chan_attribute_int32(self, task, channel, attribute, value): - cfunc = lib_importer.cdll.DAQmxSetChanAttribute - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxSetChanAttribute + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes_byte_str, ctypes.c_int32] - error_code = cfunc( + error_code = c_func( task, channel, attribute, ctypes.c_int32(value)) self.check_for_error(error_code) def set_chan_attribute_string(self, task, channel, attribute, value): - cfunc = lib_importer.cdll.DAQmxSetChanAttribute - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxSetChanAttribute + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes_byte_str, ctypes.c_int32] - error_code = cfunc( + error_code = c_func( task, channel, attribute, value.encode(lib_importer.encoding)) self.check_for_error(error_code) def set_chan_attribute_uint32(self, task, channel, attribute, value): - cfunc = lib_importer.cdll.DAQmxSetChanAttribute - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxSetChanAttribute + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes_byte_str, ctypes.c_int32] - error_code = cfunc( + error_code = c_func( task, channel, attribute, ctypes.c_uint32(value)) self.check_for_error(error_code) def set_digital_logic_family_power_up_state( self, device_name, logic_family): - cfunc = lib_importer.windll.DAQmxSetDigitalLogicFamilyPowerUpState - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxSetDigitalLogicFamilyPowerUpState + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ ctypes_byte_str, ctypes.c_int] - error_code = cfunc( + error_code = c_func( device_name, logic_family) self.check_for_error(error_code) @@ -5249,10 +5249,10 @@ def set_digital_power_up_states(self, device_name, channel_names, state): args.append(None) argtypes.append(ctypes.c_void_p) - cfunc = lib_importer.cdll.DAQmxSetDigitalPowerUpStates - with cfunc.arglock: - cfunc.argtypes = argtypes - error_code = cfunc(*args) + c_func = lib_importer.cdll.DAQmxSetDigitalPowerUpStates + with c_func.arg_lock: + c_func.argtypes = argtypes + error_code = c_func(*args) self.check_for_error(error_code) def set_digital_pull_up_pull_down_states( @@ -5271,640 +5271,640 @@ def set_digital_pull_up_pull_down_states( args.append(None) argtypes.append(ctypes.c_void_p) - cfunc = lib_importer.cdll.DAQmxSetDigitalPullUpPullDownStates - with cfunc.arglock: - cfunc.argtypes = argtypes - error_code = cfunc(*args) + c_func = lib_importer.cdll.DAQmxSetDigitalPullUpPullDownStates + with c_func.arg_lock: + c_func.argtypes = argtypes + error_code = c_func(*args) self.check_for_error(error_code) def set_exported_signal_attribute_bool(self, task, attribute, value): - cfunc = lib_importer.cdll.DAQmxSetExportedSignalAttribute - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxSetExportedSignalAttribute + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes.c_int32] - error_code = cfunc( + error_code = c_func( task, attribute, c_bool32(value)) self.check_for_error(error_code) def set_exported_signal_attribute_double(self, task, attribute, value): - cfunc = lib_importer.cdll.DAQmxSetExportedSignalAttribute - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxSetExportedSignalAttribute + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes.c_int32] - error_code = cfunc( + error_code = c_func( task, attribute, ctypes.c_double(value)) self.check_for_error(error_code) def set_exported_signal_attribute_int32(self, task, attribute, value): - cfunc = lib_importer.cdll.DAQmxSetExportedSignalAttribute - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxSetExportedSignalAttribute + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes.c_int32] - error_code = cfunc( + error_code = c_func( task, attribute, ctypes.c_int32(value)) self.check_for_error(error_code) def set_exported_signal_attribute_string(self, task, attribute, value): - cfunc = lib_importer.cdll.DAQmxSetExportedSignalAttribute - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxSetExportedSignalAttribute + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes.c_int32] - error_code = cfunc( + error_code = c_func( task, attribute, value.encode(lib_importer.encoding)) self.check_for_error(error_code) def set_exported_signal_attribute_uint32(self, task, attribute, value): - cfunc = lib_importer.cdll.DAQmxSetExportedSignalAttribute - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxSetExportedSignalAttribute + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes.c_int32] - error_code = cfunc( + error_code = c_func( task, attribute, ctypes.c_uint32(value)) self.check_for_error(error_code) def set_read_attribute_bool(self, task, attribute, value): - cfunc = lib_importer.cdll.DAQmxSetReadAttribute - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxSetReadAttribute + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes.c_int32] - error_code = cfunc( + error_code = c_func( task, attribute, c_bool32(value)) self.check_for_error(error_code) def set_read_attribute_double(self, task, attribute, value): - cfunc = lib_importer.cdll.DAQmxSetReadAttribute - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxSetReadAttribute + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes.c_int32] - error_code = cfunc( + error_code = c_func( task, attribute, ctypes.c_double(value)) self.check_for_error(error_code) def set_read_attribute_int32(self, task, attribute, value): - cfunc = lib_importer.cdll.DAQmxSetReadAttribute - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxSetReadAttribute + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes.c_int32] - error_code = cfunc( + error_code = c_func( task, attribute, ctypes.c_int32(value)) self.check_for_error(error_code) def set_read_attribute_string(self, task, attribute, value): - cfunc = lib_importer.cdll.DAQmxSetReadAttribute - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxSetReadAttribute + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes.c_int32] - error_code = cfunc( + error_code = c_func( task, attribute, value.encode(lib_importer.encoding)) self.check_for_error(error_code) def set_read_attribute_uint32(self, task, attribute, value): - cfunc = lib_importer.cdll.DAQmxSetReadAttribute - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxSetReadAttribute + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes.c_int32] - error_code = cfunc( + error_code = c_func( task, attribute, ctypes.c_uint32(value)) self.check_for_error(error_code) def set_read_attribute_uint64(self, task, attribute, value): - cfunc = lib_importer.cdll.DAQmxSetReadAttribute - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxSetReadAttribute + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes.c_int32] - error_code = cfunc( + error_code = c_func( task, attribute, ctypes.c_uint64(value)) self.check_for_error(error_code) def set_runtime_environment( self, environment, environment_version, reserved_1, reserved_2): - cfunc = lib_importer.windll.DAQmxSetRuntimeEnvironment - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxSetRuntimeEnvironment + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ ctypes_byte_str, ctypes_byte_str, ctypes_byte_str, ctypes_byte_str] - error_code = cfunc( + error_code = c_func( environment, environment_version, reserved_1, reserved_2) self.check_for_error(error_code) def set_scale_attribute_double(self, scale_name, attribute, value): - cfunc = lib_importer.cdll.DAQmxSetScaleAttribute - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxSetScaleAttribute + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ ctypes_byte_str, ctypes.c_int32] - error_code = cfunc( + error_code = c_func( scale_name, attribute, ctypes.c_double(value)) self.check_for_error(error_code) def set_scale_attribute_double_array(self, scale_name, attribute, value): - cfunc = lib_importer.cdll.DAQmxSetScaleAttribute - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxSetScaleAttribute + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ ctypes_byte_str, ctypes.c_int32] - error_code = cfunc( + error_code = c_func( scale_name, attribute, value.ctypes.data_as(ctypes.c_void_p), len(value)) self.check_for_error(error_code) def set_scale_attribute_int32(self, scale_name, attribute, value): - cfunc = lib_importer.cdll.DAQmxSetScaleAttribute - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxSetScaleAttribute + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ ctypes_byte_str, ctypes.c_int32] - error_code = cfunc( + error_code = c_func( scale_name, attribute, ctypes.c_int32(value)) self.check_for_error(error_code) def set_scale_attribute_string(self, scale_name, attribute, value): - cfunc = lib_importer.cdll.DAQmxSetScaleAttribute - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxSetScaleAttribute + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ ctypes_byte_str, ctypes.c_int32] - error_code = cfunc( + error_code = c_func( scale_name, attribute, value.encode(lib_importer.encoding)) self.check_for_error(error_code) def set_timing_attribute_bool(self, task, attribute, value): - cfunc = lib_importer.cdll.DAQmxSetTimingAttribute - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxSetTimingAttribute + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes.c_int32] - error_code = cfunc( + error_code = c_func( task, attribute, c_bool32(value)) self.check_for_error(error_code) def set_timing_attribute_double(self, task, attribute, value): - cfunc = lib_importer.cdll.DAQmxSetTimingAttribute - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxSetTimingAttribute + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes.c_int32] - error_code = cfunc( + error_code = c_func( task, attribute, ctypes.c_double(value)) self.check_for_error(error_code) def set_timing_attribute_ex_bool( self, task, device_names, attribute, value): - cfunc = lib_importer.cdll.DAQmxSetTimingAttributeEx - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxSetTimingAttributeEx + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes_byte_str, ctypes.c_int32] - error_code = cfunc( + error_code = c_func( task, device_names, attribute, c_bool32(value)) self.check_for_error(error_code) def set_timing_attribute_ex_double( self, task, device_names, attribute, value): - cfunc = lib_importer.cdll.DAQmxSetTimingAttributeEx - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxSetTimingAttributeEx + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes_byte_str, ctypes.c_int32] - error_code = cfunc( + error_code = c_func( task, device_names, attribute, ctypes.c_double(value)) self.check_for_error(error_code) def set_timing_attribute_ex_int32( self, task, device_names, attribute, value): - cfunc = lib_importer.cdll.DAQmxSetTimingAttributeEx - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxSetTimingAttributeEx + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes_byte_str, ctypes.c_int32] - error_code = cfunc( + error_code = c_func( task, device_names, attribute, ctypes.c_int32(value)) self.check_for_error(error_code) def set_timing_attribute_ex_string( self, task, device_names, attribute, value): - cfunc = lib_importer.cdll.DAQmxSetTimingAttributeEx - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxSetTimingAttributeEx + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes_byte_str, ctypes.c_int32] - error_code = cfunc( + error_code = c_func( task, device_names, attribute, value.encode(lib_importer.encoding)) self.check_for_error(error_code) def set_timing_attribute_ex_uint32( self, task, device_names, attribute, value): - cfunc = lib_importer.cdll.DAQmxSetTimingAttributeEx - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxSetTimingAttributeEx + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes_byte_str, ctypes.c_int32] - error_code = cfunc( + error_code = c_func( task, device_names, attribute, ctypes.c_uint32(value)) self.check_for_error(error_code) def set_timing_attribute_ex_uint64( self, task, device_names, attribute, value): - cfunc = lib_importer.cdll.DAQmxSetTimingAttributeEx - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxSetTimingAttributeEx + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes_byte_str, ctypes.c_int32] - error_code = cfunc( + error_code = c_func( task, device_names, attribute, ctypes.c_uint64(value)) self.check_for_error(error_code) def set_timing_attribute_int32(self, task, attribute, value): - cfunc = lib_importer.cdll.DAQmxSetTimingAttribute - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxSetTimingAttribute + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes.c_int32] - error_code = cfunc( + error_code = c_func( task, attribute, ctypes.c_int32(value)) self.check_for_error(error_code) def set_timing_attribute_string(self, task, attribute, value): - cfunc = lib_importer.cdll.DAQmxSetTimingAttribute - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxSetTimingAttribute + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes.c_int32] - error_code = cfunc( + error_code = c_func( task, attribute, value.encode(lib_importer.encoding)) self.check_for_error(error_code) def set_timing_attribute_uint32(self, task, attribute, value): - cfunc = lib_importer.cdll.DAQmxSetTimingAttribute - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxSetTimingAttribute + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes.c_int32] - error_code = cfunc( + error_code = c_func( task, attribute, ctypes.c_uint32(value)) self.check_for_error(error_code) def set_timing_attribute_uint64(self, task, attribute, value): - cfunc = lib_importer.cdll.DAQmxSetTimingAttribute - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxSetTimingAttribute + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes.c_int32] - error_code = cfunc( + error_code = c_func( task, attribute, ctypes.c_uint64(value)) self.check_for_error(error_code) def set_trig_attribute_bool(self, task, attribute, value): - cfunc = lib_importer.cdll.DAQmxSetTrigAttribute - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxSetTrigAttribute + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes.c_int32] - error_code = cfunc( + error_code = c_func( task, attribute, c_bool32(value)) self.check_for_error(error_code) def set_trig_attribute_double(self, task, attribute, value): - cfunc = lib_importer.cdll.DAQmxSetTrigAttribute - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxSetTrigAttribute + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes.c_int32] - error_code = cfunc( + error_code = c_func( task, attribute, ctypes.c_double(value)) self.check_for_error(error_code) def set_trig_attribute_double_array(self, task, attribute, value): - cfunc = lib_importer.cdll.DAQmxSetTrigAttribute - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxSetTrigAttribute + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes.c_int32] - error_code = cfunc( + error_code = c_func( task, attribute, value.ctypes.data_as(ctypes.c_void_p), len(value)) self.check_for_error(error_code) def set_trig_attribute_int32(self, task, attribute, value): - cfunc = lib_importer.cdll.DAQmxSetTrigAttribute - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxSetTrigAttribute + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes.c_int32] - error_code = cfunc( + error_code = c_func( task, attribute, ctypes.c_int32(value)) self.check_for_error(error_code) def set_trig_attribute_int32_array(self, task, attribute, value): - cfunc = lib_importer.cdll.DAQmxSetTrigAttribute - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxSetTrigAttribute + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes.c_int32] - error_code = cfunc( + error_code = c_func( task, attribute, value.ctypes.data_as(ctypes.c_void_p), len(value)) self.check_for_error(error_code) def set_trig_attribute_string(self, task, attribute, value): - cfunc = lib_importer.cdll.DAQmxSetTrigAttribute - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxSetTrigAttribute + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes.c_int32] - error_code = cfunc( + error_code = c_func( task, attribute, value.encode(lib_importer.encoding)) self.check_for_error(error_code) def set_trig_attribute_timestamp(self, task, attribute, value): - cfunc = lib_importer.cdll.DAQmxSetTrigAttribute - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxSetTrigAttribute + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes.c_int32] - error_code = cfunc( + error_code = c_func( task, attribute, AbsoluteTime.from_datetime(value)) self.check_for_error(error_code) def set_trig_attribute_uint32(self, task, attribute, value): - cfunc = lib_importer.cdll.DAQmxSetTrigAttribute - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxSetTrigAttribute + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes.c_int32] - error_code = cfunc( + error_code = c_func( task, attribute, ctypes.c_uint32(value)) self.check_for_error(error_code) def set_watchdog_attribute_bool(self, task, lines, attribute, value): - cfunc = lib_importer.cdll.DAQmxSetWatchdogAttribute - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxSetWatchdogAttribute + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes_byte_str, ctypes.c_int32] - error_code = cfunc( + error_code = c_func( task, lines, attribute, c_bool32(value)) self.check_for_error(error_code) def set_watchdog_attribute_double(self, task, lines, attribute, value): - cfunc = lib_importer.cdll.DAQmxSetWatchdogAttribute - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxSetWatchdogAttribute + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes_byte_str, ctypes.c_int32] - error_code = cfunc( + error_code = c_func( task, lines, attribute, ctypes.c_double(value)) self.check_for_error(error_code) def set_watchdog_attribute_int32(self, task, lines, attribute, value): - cfunc = lib_importer.cdll.DAQmxSetWatchdogAttribute - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxSetWatchdogAttribute + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes_byte_str, ctypes.c_int32] - error_code = cfunc( + error_code = c_func( task, lines, attribute, ctypes.c_int32(value)) self.check_for_error(error_code) def set_watchdog_attribute_string(self, task, lines, attribute, value): - cfunc = lib_importer.cdll.DAQmxSetWatchdogAttribute - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxSetWatchdogAttribute + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes_byte_str, ctypes.c_int32] - error_code = cfunc( + error_code = c_func( task, lines, attribute, value.encode(lib_importer.encoding)) self.check_for_error(error_code) def set_write_attribute_bool(self, task, attribute, value): - cfunc = lib_importer.cdll.DAQmxSetWriteAttribute - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxSetWriteAttribute + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes.c_int32] - error_code = cfunc( + error_code = c_func( task, attribute, c_bool32(value)) self.check_for_error(error_code) def set_write_attribute_double(self, task, attribute, value): - cfunc = lib_importer.cdll.DAQmxSetWriteAttribute - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxSetWriteAttribute + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes.c_int32] - error_code = cfunc( + error_code = c_func( task, attribute, ctypes.c_double(value)) self.check_for_error(error_code) def set_write_attribute_int32(self, task, attribute, value): - cfunc = lib_importer.cdll.DAQmxSetWriteAttribute - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxSetWriteAttribute + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes.c_int32] - error_code = cfunc( + error_code = c_func( task, attribute, ctypes.c_int32(value)) self.check_for_error(error_code) def set_write_attribute_string(self, task, attribute, value): - cfunc = lib_importer.cdll.DAQmxSetWriteAttribute - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxSetWriteAttribute + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes.c_int32] - error_code = cfunc( + error_code = c_func( task, attribute, value.encode(lib_importer.encoding)) self.check_for_error(error_code) def set_write_attribute_uint32(self, task, attribute, value): - cfunc = lib_importer.cdll.DAQmxSetWriteAttribute - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxSetWriteAttribute + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes.c_int32] - error_code = cfunc( + error_code = c_func( task, attribute, ctypes.c_uint32(value)) self.check_for_error(error_code) def set_write_attribute_uint64(self, task, attribute, value): - cfunc = lib_importer.cdll.DAQmxSetWriteAttribute - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.cdll.DAQmxSetWriteAttribute + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes.c_int32] - error_code = cfunc( + error_code = c_func( task, attribute, ctypes.c_uint64(value)) self.check_for_error(error_code) def start_new_file(self, task, file_path): - cfunc = lib_importer.windll.DAQmxStartNewFile - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxStartNewFile + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes_byte_str] - error_code = cfunc( + error_code = c_func( task, file_path) self.check_for_error(error_code) def start_task(self, task): - cfunc = lib_importer.windll.DAQmxStartTask - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxStartTask + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle] - error_code = cfunc( + error_code = c_func( task) self.check_for_error(error_code) def stop_task(self, task): - cfunc = lib_importer.windll.DAQmxStopTask - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxStopTask + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle] - error_code = cfunc( + error_code = c_func( task) self.check_for_error(error_code) def task_control(self, task, action): - cfunc = lib_importer.windll.DAQmxTaskControl - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxTaskControl + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes.c_int] - error_code = cfunc( + error_code = c_func( task, action) self.check_for_error(error_code) def tristate_output_term(self, output_terminal): - cfunc = lib_importer.windll.DAQmxTristateOutputTerm - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxTristateOutputTerm + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ ctypes_byte_str] - error_code = cfunc( + error_code = c_func( output_terminal) self.check_for_error(error_code) @@ -5913,11 +5913,11 @@ def unregister_done_event(self, task): ctypes.c_int32, lib_importer.task_handle, ctypes.c_int, ctypes.c_void_p) - cfunc = lib_importer.windll.DAQmxRegisterDoneEvent - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxRegisterDoneEvent + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes.c_uint, DAQmxDoneEventCallbackPtr, ctypes.POINTER(ctypes.c_void_p)] @@ -5926,7 +5926,7 @@ def unregister_done_event(self, task): callback_method_ptr = DAQmxDoneEventCallbackPtr() callback_data = None - error_code = cfunc( + error_code = c_func( task, options, callback_method_ptr, callback_data) self.check_for_error(error_code) @@ -5936,11 +5936,11 @@ def unregister_every_n_samples_event( ctypes.c_int32, lib_importer.task_handle, ctypes.c_int, ctypes.c_uint, ctypes.c_void_p) - cfunc = lib_importer.windll.DAQmxRegisterEveryNSamplesEvent - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxRegisterEveryNSamplesEvent + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes.c_int, ctypes.c_uint, ctypes.c_uint, DAQmxEveryNSamplesEventCallbackPtr, ctypes.POINTER(ctypes.c_void_p)] @@ -5950,7 +5950,7 @@ def unregister_every_n_samples_event( callback_method_ptr = DAQmxEveryNSamplesEventCallbackPtr() callback_data = None - error_code = cfunc( + error_code = c_func( task, every_n_samples_event_type, n_samples, options, callback_method_ptr, callback_data) self.check_for_error(error_code) @@ -5960,11 +5960,11 @@ def unregister_signal_event(self, task, signal_id): ctypes.c_int32, lib_importer.task_handle, ctypes.c_int, ctypes.c_void_p) - cfunc = lib_importer.windll.DAQmxRegisterSignalEvent - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxRegisterSignalEvent + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes.c_int, ctypes.c_uint, DAQmxSignalEventCallbackPtr, ctypes.POINTER(ctypes.c_void_p)] @@ -5973,47 +5973,47 @@ def unregister_signal_event(self, task, signal_id): callback_method_ptr = DAQmxSignalEventCallbackPtr() callback_data = None - error_code = cfunc( + error_code = c_func( task, signal_id, options, callback_method_ptr, callback_data) self.check_for_error(error_code) def unreserve_network_device(self, device_name): - cfunc = lib_importer.windll.DAQmxUnreserveNetworkDevice - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxUnreserveNetworkDevice + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ ctypes_byte_str] - error_code = cfunc( + error_code = c_func( device_name) self.check_for_error(error_code) def wait_for_valid_timestamp(self, task, timestamp_event, timeout): timestamp = AbsoluteTime() - cfunc = lib_importer.windll.DAQmxWaitForValidTimestamp - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxWaitForValidTimestamp + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes.c_int32, ctypes.c_double, ctypes.POINTER(AbsoluteTime)] - error_code = cfunc( + error_code = c_func( task, timestamp_event, timeout, ctypes.byref(timestamp)) self.check_for_error(error_code) return timestamp.to_datetime() def wait_until_task_done(self, task, time_to_wait): - cfunc = lib_importer.windll.DAQmxWaitUntilTaskDone - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxWaitUntilTaskDone + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes.c_double] - error_code = cfunc( + error_code = c_func( task, time_to_wait) self.check_for_error(error_code) @@ -6022,32 +6022,32 @@ def write_analog_f64( write_array): samps_per_chan_written = ctypes.c_int() - cfunc = lib_importer.windll.DAQmxWriteAnalogF64 - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxWriteAnalogF64 + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes.c_int, c_bool32, ctypes.c_double, ctypes.c_int, wrapped_ndpointer(dtype=numpy.float64, flags=('C')), ctypes.POINTER(ctypes.c_int), ctypes.POINTER(c_bool32)] - error_code = cfunc( + error_code = c_func( task, num_samps_per_chan, auto_start, timeout, data_layout, write_array, ctypes.byref(samps_per_chan_written), None) self.check_for_error(error_code, samps_per_chan_written=samps_per_chan_written.value) return samps_per_chan_written.value def write_analog_scalar_f64(self, task, auto_start, timeout, value): - cfunc = lib_importer.windll.DAQmxWriteAnalogScalarF64 - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxWriteAnalogScalarF64 + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, c_bool32, ctypes.c_double, ctypes.c_double, ctypes.POINTER(c_bool32)] - error_code = cfunc( + error_code = c_func( task, auto_start, timeout, value, None) self.check_for_error(error_code) @@ -6056,17 +6056,17 @@ def write_binary_i16( write_array): samps_per_chan_written = ctypes.c_int() - cfunc = lib_importer.windll.DAQmxWriteBinaryI16 - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxWriteBinaryI16 + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes.c_int, c_bool32, ctypes.c_double, ctypes.c_int, wrapped_ndpointer(dtype=numpy.int16, flags=('C')), ctypes.POINTER(ctypes.c_int), ctypes.POINTER(c_bool32)] - error_code = cfunc( + error_code = c_func( task, num_samps_per_chan, auto_start, timeout, data_layout, write_array, ctypes.byref(samps_per_chan_written), None) self.check_for_error(error_code, samps_per_chan_written=samps_per_chan_written.value) @@ -6077,17 +6077,17 @@ def write_binary_i32( write_array): samps_per_chan_written = ctypes.c_int() - cfunc = lib_importer.windll.DAQmxWriteBinaryI32 - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxWriteBinaryI32 + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes.c_int, c_bool32, ctypes.c_double, ctypes.c_int, wrapped_ndpointer(dtype=numpy.int32, flags=('C')), ctypes.POINTER(ctypes.c_int), ctypes.POINTER(c_bool32)] - error_code = cfunc( + error_code = c_func( task, num_samps_per_chan, auto_start, timeout, data_layout, write_array, ctypes.byref(samps_per_chan_written), None) self.check_for_error(error_code, samps_per_chan_written=samps_per_chan_written.value) @@ -6098,17 +6098,17 @@ def write_binary_u16( write_array): samps_per_chan_written = ctypes.c_int() - cfunc = lib_importer.windll.DAQmxWriteBinaryU16 - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxWriteBinaryU16 + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes.c_int, c_bool32, ctypes.c_double, ctypes.c_int, wrapped_ndpointer(dtype=numpy.uint16, flags=('C')), ctypes.POINTER(ctypes.c_int), ctypes.POINTER(c_bool32)] - error_code = cfunc( + error_code = c_func( task, num_samps_per_chan, auto_start, timeout, data_layout, write_array, ctypes.byref(samps_per_chan_written), None) self.check_for_error(error_code, samps_per_chan_written=samps_per_chan_written.value) @@ -6119,17 +6119,17 @@ def write_binary_u32( write_array): samps_per_chan_written = ctypes.c_int() - cfunc = lib_importer.windll.DAQmxWriteBinaryU32 - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxWriteBinaryU32 + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes.c_int, c_bool32, ctypes.c_double, ctypes.c_int, wrapped_ndpointer(dtype=numpy.uint32, flags=('C')), ctypes.POINTER(ctypes.c_int), ctypes.POINTER(c_bool32)] - error_code = cfunc( + error_code = c_func( task, num_samps_per_chan, auto_start, timeout, data_layout, write_array, ctypes.byref(samps_per_chan_written), None) self.check_for_error(error_code, samps_per_chan_written=samps_per_chan_written.value) @@ -6140,18 +6140,18 @@ def write_ctr_freq( frequency, duty_cycle): num_samps_per_chan_written = ctypes.c_int() - cfunc = lib_importer.windll.DAQmxWriteCtrFreq - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxWriteCtrFreq + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes.c_int, c_bool32, ctypes.c_double, ctypes.c_int, wrapped_ndpointer(dtype=numpy.float64, flags=('C')), wrapped_ndpointer(dtype=numpy.float64, flags=('C')), ctypes.POINTER(ctypes.c_int), ctypes.POINTER(c_bool32)] - error_code = cfunc( + error_code = c_func( task, num_samps_per_chan, auto_start, timeout, data_layout, frequency, duty_cycle, ctypes.byref(num_samps_per_chan_written), None) @@ -6160,16 +6160,16 @@ def write_ctr_freq( def write_ctr_freq_scalar( self, task, auto_start, timeout, frequency, duty_cycle): - cfunc = lib_importer.windll.DAQmxWriteCtrFreqScalar - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxWriteCtrFreqScalar + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, c_bool32, ctypes.c_double, ctypes.c_double, ctypes.c_double, ctypes.POINTER(c_bool32)] - error_code = cfunc( + error_code = c_func( task, auto_start, timeout, frequency, duty_cycle, None) self.check_for_error(error_code) @@ -6178,18 +6178,18 @@ def write_ctr_ticks( high_ticks, low_ticks): num_samps_per_chan_written = ctypes.c_int() - cfunc = lib_importer.windll.DAQmxWriteCtrTicks - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxWriteCtrTicks + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes.c_int, c_bool32, ctypes.c_double, ctypes.c_int, wrapped_ndpointer(dtype=numpy.uint32, flags=('C')), wrapped_ndpointer(dtype=numpy.uint32, flags=('C')), ctypes.POINTER(ctypes.c_int), ctypes.POINTER(c_bool32)] - error_code = cfunc( + error_code = c_func( task, num_samps_per_chan, auto_start, timeout, data_layout, high_ticks, low_ticks, ctypes.byref(num_samps_per_chan_written), None) @@ -6198,16 +6198,16 @@ def write_ctr_ticks( def write_ctr_ticks_scalar( self, task, auto_start, timeout, high_ticks, low_ticks): - cfunc = lib_importer.windll.DAQmxWriteCtrTicksScalar - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxWriteCtrTicksScalar + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, c_bool32, ctypes.c_double, ctypes.c_uint32, ctypes.c_uint32, ctypes.POINTER(c_bool32)] - error_code = cfunc( + error_code = c_func( task, auto_start, timeout, high_ticks, low_ticks, None) self.check_for_error(error_code) @@ -6216,18 +6216,18 @@ def write_ctr_time( high_time, low_time): num_samps_per_chan_written = ctypes.c_int() - cfunc = lib_importer.windll.DAQmxWriteCtrTime - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxWriteCtrTime + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes.c_int, c_bool32, ctypes.c_double, ctypes.c_int, wrapped_ndpointer(dtype=numpy.float64, flags=('C')), wrapped_ndpointer(dtype=numpy.float64, flags=('C')), ctypes.POINTER(ctypes.c_int), ctypes.POINTER(c_bool32)] - error_code = cfunc( + error_code = c_func( task, num_samps_per_chan, auto_start, timeout, data_layout, high_time, low_time, ctypes.byref(num_samps_per_chan_written), None) @@ -6236,16 +6236,16 @@ def write_ctr_time( def write_ctr_time_scalar( self, task, auto_start, timeout, high_time, low_time): - cfunc = lib_importer.windll.DAQmxWriteCtrTimeScalar - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxWriteCtrTimeScalar + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, c_bool32, ctypes.c_double, ctypes.c_double, ctypes.c_double, ctypes.POINTER(c_bool32)] - error_code = cfunc( + error_code = c_func( task, auto_start, timeout, high_time, low_time, None) self.check_for_error(error_code) @@ -6254,32 +6254,32 @@ def write_digital_lines( write_array): samps_per_chan_written = ctypes.c_int() - cfunc = lib_importer.windll.DAQmxWriteDigitalLines - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxWriteDigitalLines + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes.c_int, c_bool32, ctypes.c_double, ctypes.c_int, wrapped_ndpointer(dtype=bool, flags=('C')), ctypes.POINTER(ctypes.c_int), ctypes.POINTER(c_bool32)] - error_code = cfunc( + error_code = c_func( task, num_samps_per_chan, auto_start, timeout, data_layout, write_array, ctypes.byref(samps_per_chan_written), None) self.check_for_error(error_code, samps_per_chan_written=samps_per_chan_written.value) return samps_per_chan_written.value def write_digital_scalar_u32(self, task, auto_start, timeout, value): - cfunc = lib_importer.windll.DAQmxWriteDigitalScalarU32 - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxWriteDigitalScalarU32 + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, c_bool32, ctypes.c_double, ctypes.c_uint, ctypes.POINTER(c_bool32)] - error_code = cfunc( + error_code = c_func( task, auto_start, timeout, value, None) self.check_for_error(error_code) @@ -6288,17 +6288,17 @@ def write_digital_u16( write_array): samps_per_chan_written = ctypes.c_int() - cfunc = lib_importer.windll.DAQmxWriteDigitalU16 - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxWriteDigitalU16 + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes.c_int, c_bool32, ctypes.c_double, ctypes.c_int, wrapped_ndpointer(dtype=numpy.uint16, flags=('C')), ctypes.POINTER(ctypes.c_int), ctypes.POINTER(c_bool32)] - error_code = cfunc( + error_code = c_func( task, num_samps_per_chan, auto_start, timeout, data_layout, write_array, ctypes.byref(samps_per_chan_written), None) self.check_for_error(error_code, samps_per_chan_written=samps_per_chan_written.value) @@ -6309,17 +6309,17 @@ def write_digital_u32( write_array): samps_per_chan_written = ctypes.c_int() - cfunc = lib_importer.windll.DAQmxWriteDigitalU32 - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxWriteDigitalU32 + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes.c_int, c_bool32, ctypes.c_double, ctypes.c_int, wrapped_ndpointer(dtype=numpy.uint32, flags=('C')), ctypes.POINTER(ctypes.c_int), ctypes.POINTER(c_bool32)] - error_code = cfunc( + error_code = c_func( task, num_samps_per_chan, auto_start, timeout, data_layout, write_array, ctypes.byref(samps_per_chan_written), None) self.check_for_error(error_code, samps_per_chan_written=samps_per_chan_written.value) @@ -6330,74 +6330,74 @@ def write_digital_u8( write_array): samps_per_chan_written = ctypes.c_int() - cfunc = lib_importer.windll.DAQmxWriteDigitalU8 - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxWriteDigitalU8 + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes.c_int, c_bool32, ctypes.c_double, ctypes.c_int, wrapped_ndpointer(dtype=numpy.uint8, flags=('C')), ctypes.POINTER(ctypes.c_int), ctypes.POINTER(c_bool32)] - error_code = cfunc( + error_code = c_func( task, num_samps_per_chan, auto_start, timeout, data_layout, write_array, ctypes.byref(samps_per_chan_written), None) self.check_for_error(error_code, samps_per_chan_written=samps_per_chan_written.value) return samps_per_chan_written.value def write_id_pin_memory(self, device_name, id_pin_name, data, format_code): - cfunc = lib_importer.windll.DAQmxWriteIDPinMemory - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxWriteIDPinMemory + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ ctypes_byte_str, ctypes_byte_str, wrapped_ndpointer(dtype=numpy.uint8, flags=('C')), ctypes.c_uint, ctypes.c_uint] - error_code = cfunc( + error_code = c_func( device_name, id_pin_name, data, len(data), format_code) self.check_for_error(error_code) def write_to_teds_from_array( self, physical_channel, bit_stream, basic_teds_options): - cfunc = lib_importer.windll.DAQmxWriteToTEDSFromArray - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxWriteToTEDSFromArray + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ ctypes_byte_str, wrapped_ndpointer(dtype=numpy.uint8, flags=('C')), ctypes.c_uint, ctypes.c_int] - error_code = cfunc( + error_code = c_func( physical_channel, bit_stream, len(bit_stream), basic_teds_options) self.check_for_error(error_code) def write_to_teds_from_file( self, physical_channel, file_path, basic_teds_options): - cfunc = lib_importer.windll.DAQmxWriteToTEDSFromFile - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxWriteToTEDSFromFile + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ ctypes_byte_str, ctypes_byte_str, ctypes.c_int] - error_code = cfunc( + error_code = c_func( physical_channel, file_path, basic_teds_options) self.check_for_error(error_code) def get_error_string(self, error_code): error_buffer = ctypes.create_string_buffer(2048) - cfunc = lib_importer.windll.DAQmxGetErrorString - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ctypes.c_int, ctypes.c_char_p, + c_func = lib_importer.windll.DAQmxGetErrorString + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ctypes.c_int, ctypes.c_char_p, ctypes.c_uint] - query_error_code = cfunc(error_code, error_buffer, 2048) + query_error_code = c_func(error_code, error_buffer, 2048) if query_error_code < 0: _logger.error('Failed to get error string for error code %d. DAQmxGetErrorString returned error code %d.', error_code, query_error_code) return 'Failed to retrieve error description.' @@ -6406,13 +6406,13 @@ def get_error_string(self, error_code): def get_extended_error_info(self): error_buffer = ctypes.create_string_buffer(2048) - cfunc = lib_importer.windll.DAQmxGetExtendedErrorInfo - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ctypes.c_char_p, ctypes.c_uint] + c_func = lib_importer.windll.DAQmxGetExtendedErrorInfo + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ctypes.c_char_p, ctypes.c_uint] - query_error_code = cfunc(error_buffer, 2048) + query_error_code = c_func(error_buffer, 2048) if query_error_code < 0: _logger.error('Failed to get extended error info. DAQmxGetExtendedErrorInfo returned error code %d.', query_error_code) return 'Failed to retrieve error description.' @@ -6520,11 +6520,11 @@ def _internal_read_analog_waveform_ex( assert isinstance(task_handle, TaskHandle) samps_per_chan_read = ctypes.c_int() - cfunc = lib_importer.windll.DAQmxInternalReadAnalogWaveformEx - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxInternalReadAnalogWaveformEx + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ TaskHandle, ctypes.c_int, ctypes.c_double, @@ -6540,7 +6540,7 @@ def _internal_read_analog_waveform_ex( ctypes.POINTER(c_bool32), ] - error_code = cfunc( + error_code = c_func( task_handle, number_of_samples_per_channel, timeout, @@ -6579,11 +6579,11 @@ def _internal_read_analog_waveform_per_chan( array_size = read_arrays[0].size assert all(read_array.size == array_size for read_array in read_arrays) - cfunc = lib_importer.windll.DAQmxInternalReadAnalogWaveformPerChan - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxInternalReadAnalogWaveformPerChan + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ TaskHandle, ctypes.c_int, ctypes.c_double, @@ -6599,11 +6599,11 @@ def _internal_read_analog_waveform_per_chan( ctypes.POINTER(c_bool32), ] - read_array_ptrs = (ctypes.POINTER(ctypes.c_double) * channel_count)() + read_array_pointers = (ctypes.POINTER(ctypes.c_double) * channel_count)() for i, read_array in enumerate(read_arrays): - read_array_ptrs[i] = read_array.ctypes.data_as(ctypes.POINTER(ctypes.c_double)) + read_array_pointers[i] = read_array.ctypes.data_as(ctypes.POINTER(ctypes.c_double)) - error_code = cfunc( + error_code = c_func( task_handle, num_samps_per_chan, timeout, @@ -6612,7 +6612,7 @@ def _internal_read_analog_waveform_per_chan( 0 if t0_array is None else t0_array.size, self._get_wfm_attr_callback(properties), None, - read_array_ptrs, + read_array_pointers, channel_count, array_size, ctypes.byref(samps_per_chan_read), @@ -6875,11 +6875,11 @@ def _internal_read_digital_waveform( samps_per_chan_read = ctypes.c_int() num_bytes_per_samp = ctypes.c_int() - cfunc = lib_importer.windll.DAQmxInternalReadDigitalWaveform - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxInternalReadDigitalWaveform + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ TaskHandle, ctypes.c_int, ctypes.c_double, @@ -6898,7 +6898,7 @@ def _internal_read_digital_waveform( ctypes.POINTER(c_bool32), ] - error_code = cfunc( + error_code = c_func( task_handle, number_of_samples_per_channel, timeout, @@ -6923,17 +6923,17 @@ def read_id_pin_memory(self, device_name, id_pin_name): data_length_read = ctypes.c_uint() format_code = ctypes.c_uint() - cfunc = lib_importer.windll.DAQmxReadIDPinMemory - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxReadIDPinMemory + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ ctypes_byte_str, ctypes_byte_str, wrapped_ndpointer(dtype=numpy.uint8, flags=('C','W')), ctypes.c_uint, ctypes.POINTER(ctypes.c_uint), ctypes.POINTER(ctypes.c_uint)] - array_size = cfunc( + array_size = c_func( device_name, id_pin_name, None, 0, ctypes.byref(data_length_read), ctypes.byref(format_code)) @@ -6942,7 +6942,7 @@ def read_id_pin_memory(self, device_name, id_pin_name): data = numpy.zeros(array_size, dtype=numpy.uint8) - error_code = cfunc( + error_code = c_func( device_name, id_pin_name, data, array_size, ctypes.byref(data_length_read), ctypes.byref(format_code)) self.check_for_error(error_code) @@ -6953,11 +6953,11 @@ def read_power_binary_i16( read_voltage_array, read_current_array): samps_per_chan_read = ctypes.c_int() - cfunc = lib_importer.windll.DAQmxReadPowerBinaryI16 - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxReadPowerBinaryI16 + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes.c_int, ctypes.c_double, c_bool32, wrapped_ndpointer(dtype=numpy.int16, flags=('C', 'W')), @@ -6965,7 +6965,7 @@ def read_power_binary_i16( ctypes.c_uint, ctypes.POINTER(ctypes.c_int), ctypes.POINTER(c_bool32)] - error_code = cfunc( + error_code = c_func( task, num_samps_per_chan, timeout, fill_mode, read_voltage_array, read_current_array, read_voltage_array.size, ctypes.byref(samps_per_chan_read), None) @@ -6978,11 +6978,11 @@ def read_power_f64( read_voltage_array, read_current_array): samps_per_chan_read = ctypes.c_int() - cfunc = lib_importer.windll.DAQmxReadPowerF64 - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxReadPowerF64 + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes.c_int, ctypes.c_double, c_bool32, wrapped_ndpointer(dtype=numpy.float64, flags=('C', 'W')), @@ -6990,7 +6990,7 @@ def read_power_f64( ctypes.c_uint, ctypes.POINTER(ctypes.c_int), ctypes.POINTER(c_bool32)] - error_code = cfunc( + error_code = c_func( task, num_samps_per_chan, timeout, fill_mode, read_voltage_array, read_current_array, read_voltage_array.size, ctypes.byref(samps_per_chan_read), None) @@ -7002,17 +7002,17 @@ def read_raw(self, task, num_samps_per_chan, timeout, read_array): samples_read = ctypes.c_int() number_of_bytes_per_sample = ctypes.c_int() - cfunc = lib_importer.windll.DAQmxReadRaw - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxReadRaw + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes.c_int, ctypes.c_double, wrapped_ndpointer(dtype=read_array.dtype, flags=('C', 'W')), ctypes.c_uint, ctypes.POINTER(ctypes.c_int), ctypes.POINTER(ctypes.c_int), ctypes.POINTER(c_bool32)] - error_code = cfunc( + error_code = c_func( task, num_samps_per_chan, timeout, read_array, read_array.nbytes, ctypes.byref(samples_read), ctypes.byref(number_of_bytes_per_sample), None) @@ -7084,11 +7084,11 @@ def _internal_write_analog_waveform_per_chan( assert channel_count > 0 assert all(write_array.size >= num_samps_per_chan for write_array in write_arrays) - cfunc = lib_importer.windll.DAQmxInternalWriteAnalogWaveformPerChan - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxInternalWriteAnalogWaveformPerChan + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ TaskHandle, ctypes.c_int, c_bool32, @@ -7099,16 +7099,16 @@ def _internal_write_analog_waveform_per_chan( ctypes.POINTER(c_bool32), ] - write_array_ptrs = (ctypes.POINTER(ctypes.c_double) * channel_count)() + write_array_pointers = (ctypes.POINTER(ctypes.c_double) * channel_count)() for i, write_array in enumerate(write_arrays): - write_array_ptrs[i] = write_array.ctypes.data_as(ctypes.POINTER(ctypes.c_double)) + write_array_pointers[i] = write_array.ctypes.data_as(ctypes.POINTER(ctypes.c_double)) - error_code = cfunc( + error_code = c_func( task_handle, num_samps_per_chan, auto_start, timeout, - write_array_ptrs, + write_array_pointers, channel_count, ctypes.byref(samps_per_chan_written), None, @@ -7199,11 +7199,11 @@ def _internal_write_digital_waveform( assert isinstance(task_handle, TaskHandle) samps_per_chan_written = ctypes.c_int() - cfunc = lib_importer.windll.DAQmxInternalWriteDigitalWaveform - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxInternalWriteDigitalWaveform + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ TaskHandle, ctypes.c_int, c_bool32, @@ -7216,7 +7216,7 @@ def _internal_write_digital_waveform( ctypes.POINTER(c_bool32), ] - error_code = cfunc( + error_code = c_func( task_handle, num_samps_per_chan, auto_start, @@ -7235,18 +7235,18 @@ def write_raw( self, task_handle, num_samps_per_chan, auto_start, timeout, numpy_array): samps_per_chan_written = ctypes.c_int() - cfunc = lib_importer.windll.DAQmxWriteRaw - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxWriteRaw + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes.c_int, c_bool32, ctypes.c_double, wrapped_ndpointer(dtype=numpy_array.dtype, flags=('C')), ctypes.POINTER(ctypes.c_int), ctypes.POINTER(c_bool32)] - error_code = cfunc( + error_code = c_func( task_handle, num_samps_per_chan, auto_start, timeout, numpy_array, ctypes.byref(samps_per_chan_written), None) self.check_for_error(error_code, samps_per_chan_written=samps_per_chan_written.value) diff --git a/generated/nidaqmx/_linux_installation_commands.py b/generated/nidaqmx/_linux_installation_commands.py index 91e688ebe..c5d522492 100644 --- a/generated/nidaqmx/_linux_installation_commands.py +++ b/generated/nidaqmx/_linux_installation_commands.py @@ -66,7 +66,7 @@ class DistroInfo: # noqa: D101 - Missing docstring in public class (auto-genera install_commands: list[list[str]] -# Mapping of distros to their command templates and version handlers +# Mapping of Linux distributions to their command templates and version handlers LINUX_COMMANDS = { "ubuntu": DistroInfo(_get_version_ubuntu, _DEBIAN_DAQMX_VERSION_COMMAND, _APT_INSTALL_COMMANDS), "opensuse": DistroInfo( diff --git a/generated/nidaqmx/system/physical_channel.py b/generated/nidaqmx/system/physical_channel.py index 8bc74606e..cc76517e5 100644 --- a/generated/nidaqmx/system/physical_channel.py +++ b/generated/nidaqmx/system/physical_channel.py @@ -92,13 +92,13 @@ def ai_power_control_enable(self, val): from nidaqmx._lib import lib_importer, ctypes_byte_str, c_bool32 if not isinstance(self._interpreter, LibraryInterpreter): raise NotImplementedError - cfunc = lib_importer.windll.DAQmxSetPhysicalChanAIPowerControlEnable - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxSetPhysicalChanAIPowerControlEnable + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ ctypes_byte_str, c_bool32] - error_code = cfunc( + error_code = c_func( self._name, val) self._interpreter.check_for_error(error_code) @@ -108,13 +108,13 @@ def ai_power_control_enable(self): from nidaqmx._lib import lib_importer, ctypes_byte_str, c_bool32 if not isinstance(self._interpreter, LibraryInterpreter): raise NotImplementedError - cfunc = lib_importer.windll.DAQmxResetPhysicalChanAIPowerControlEnable - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxResetPhysicalChanAIPowerControlEnable + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ ctypes_byte_str] - error_code = cfunc( + error_code = c_func( self._name) self._interpreter.check_for_error(error_code) @@ -135,13 +135,13 @@ def ai_power_control_type(self, val): if not isinstance(self._interpreter, LibraryInterpreter): raise NotImplementedError val = val.value - cfunc = lib_importer.windll.DAQmxSetPhysicalChanAIPowerControlType - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxSetPhysicalChanAIPowerControlType + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ ctypes_byte_str, ctypes.c_int] - error_code = cfunc( + error_code = c_func( self._name, val) self._interpreter.check_for_error(error_code) @@ -151,13 +151,13 @@ def ai_power_control_type(self): from nidaqmx._lib import lib_importer, ctypes_byte_str, c_bool32 if not isinstance(self._interpreter, LibraryInterpreter): raise NotImplementedError - cfunc = lib_importer.windll.DAQmxResetPhysicalChanAIPowerControlType - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxResetPhysicalChanAIPowerControlType + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ ctypes_byte_str] - error_code = cfunc( + error_code = c_func( self._name) self._interpreter.check_for_error(error_code) @@ -177,14 +177,14 @@ def ai_power_control_voltage(self, val): from nidaqmx._lib import lib_importer, ctypes_byte_str, c_bool32 if not isinstance(self._interpreter, LibraryInterpreter): raise NotImplementedError - cfunc = (lib_importer.windll. + c_func = (lib_importer.windll. DAQmxSetPhysicalChanAIPowerControlVoltage) - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ ctypes_byte_str, ctypes.c_double] - error_code = cfunc( + error_code = c_func( self._name, val) self._interpreter.check_for_error(error_code) @@ -194,14 +194,14 @@ def ai_power_control_voltage(self): from nidaqmx._lib import lib_importer, ctypes_byte_str, c_bool32 if not isinstance(self._interpreter, LibraryInterpreter): raise NotImplementedError - cfunc = (lib_importer.windll. + c_func = (lib_importer.windll. DAQmxResetPhysicalChanAIPowerControlVoltage) - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ ctypes_byte_str] - error_code = cfunc( + error_code = c_func( self._name) self._interpreter.check_for_error(error_code) @@ -287,14 +287,14 @@ def ao_manual_control_enable(self, val): from nidaqmx._lib import lib_importer, ctypes_byte_str, c_bool32 if not isinstance(self._interpreter, LibraryInterpreter): raise NotImplementedError - cfunc = (lib_importer.windll. + c_func = (lib_importer.windll. DAQmxSetPhysicalChanAOManualControlEnable) - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ ctypes_byte_str, c_bool32] - error_code = cfunc( + error_code = c_func( self._name, val) self._interpreter.check_for_error(error_code) @@ -304,14 +304,14 @@ def ao_manual_control_enable(self): from nidaqmx._lib import lib_importer, ctypes_byte_str, c_bool32 if not isinstance(self._interpreter, LibraryInterpreter): raise NotImplementedError - cfunc = (lib_importer.windll. + c_func = (lib_importer.windll. DAQmxResetPhysicalChanAOManualControlEnable) - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ ctypes_byte_str] - error_code = cfunc( + error_code = c_func( self._name) self._interpreter.check_for_error(error_code) @@ -362,13 +362,13 @@ def ao_power_amp_channel_enable(self, val): from nidaqmx._lib import lib_importer, ctypes_byte_str, c_bool32 if not isinstance(self._interpreter, LibraryInterpreter): raise NotImplementedError - cfunc = lib_importer.windll.DAQmxSetAOPowerAmpChannelEnable - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxSetAOPowerAmpChannelEnable + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ ctypes_byte_str, c_bool32] - error_code = cfunc( + error_code = c_func( self._name, val) self._interpreter.check_for_error(error_code) @@ -378,13 +378,13 @@ def ao_power_amp_channel_enable(self): from nidaqmx._lib import lib_importer, ctypes_byte_str, c_bool32 if not isinstance(self._interpreter, LibraryInterpreter): raise NotImplementedError - cfunc = lib_importer.windll.DAQmxResetAOPowerAmpChannelEnable - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxResetAOPowerAmpChannelEnable + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ ctypes_byte_str] - error_code = cfunc( + error_code = c_func( self._name) self._interpreter.check_for_error(error_code) @@ -530,13 +530,13 @@ def dig_port_logic_family(self, val): if not isinstance(self._interpreter, LibraryInterpreter): raise NotImplementedError val = val.value - cfunc = lib_importer.windll.DAQmxSetPhysicalChanDigPortLogicFamily - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxSetPhysicalChanDigPortLogicFamily + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ ctypes_byte_str, ctypes.c_int] - error_code = cfunc( + error_code = c_func( self._name, val) self._interpreter.check_for_error(error_code) @@ -546,13 +546,13 @@ def dig_port_logic_family(self): from nidaqmx._lib import lib_importer, ctypes_byte_str, c_bool32 if not isinstance(self._interpreter, LibraryInterpreter): raise NotImplementedError - cfunc = lib_importer.windll.DAQmxResetPhysicalChanDigPortLogicFamily - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxResetPhysicalChanDigPortLogicFamily + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ ctypes_byte_str] - error_code = cfunc( + error_code = c_func( self._name) self._interpreter.check_for_error(error_code) diff --git a/generated/nidaqmx/task/_in_stream.py b/generated/nidaqmx/task/_in_stream.py index eed1bd1f7..29d9d240c 100644 --- a/generated/nidaqmx/task/_in_stream.py +++ b/generated/nidaqmx/task/_in_stream.py @@ -621,7 +621,7 @@ def open_thrmcpl_chans(self): """ List[str]: Indicates a list of names of any virtual channels in the task for which the device(s) detected an open - thermcouple. You must read **open_thrmcpl_chans_exist** + thermocouple. You must read **open_thrmcpl_chans_exist** before you read this property. Otherwise, you will receive an error. """ diff --git a/generated/nidaqmx/task/triggering/_reference_trigger.py b/generated/nidaqmx/task/triggering/_reference_trigger.py index e253d5d96..c48d3c017 100644 --- a/generated/nidaqmx/task/triggering/_reference_trigger.py +++ b/generated/nidaqmx/task/triggering/_reference_trigger.py @@ -64,7 +64,7 @@ def anlg_edge_dig_fltr_enable(self): @property def anlg_edge_dig_fltr_min_pulse_width(self): """ - float: Specifies in seconds the minimum pulse width thefilter + float: Specifies in seconds the minimum pulse width the filter recognizes. """ diff --git a/generated/nidaqmx/types.py b/generated/nidaqmx/types.py index 45f296004..561b34ece 100644 --- a/generated/nidaqmx/types.py +++ b/generated/nidaqmx/types.py @@ -3,7 +3,7 @@ import collections import typing -# region Task Counter IO namedtuples +# region Task Counter IO named tuples CtrFreq = collections.namedtuple("CtrFreq", ["freq", "duty_cycle"]) @@ -13,13 +13,13 @@ # endregion -# region Power IO namedtuples +# region Power IO named tuples PowerMeasurement = collections.namedtuple("PowerMeasurement", ["voltage", "current"]) # endregion -# region Watchdog namedtuples +# region Watchdog named tuples AOExpirationState = collections.namedtuple( "AOExpirationState", ["physical_channel", "expiration_state", "output_type"] @@ -35,7 +35,7 @@ # endregion -# region Power Up States namedtuples +# region Power Up States named tuples AOPowerUpState = collections.namedtuple( "AOPowerUpState", ["physical_channel", "power_up_state", "channel_type"] @@ -49,7 +49,7 @@ # endregion -# region System namedtuples +# region System named tuples CDAQSyncConnection = collections.namedtuple("CDAQSyncConnection", ["output_port", "input_port"]) @@ -59,7 +59,7 @@ # endregion -# region ID Pin namedtuples +# region ID Pin named tuples class IDPinContents(typing.NamedTuple): diff --git a/generated/nidaqmx/utils.py b/generated/nidaqmx/utils.py index 3eb25f7b1..819d565d4 100644 --- a/generated/nidaqmx/utils.py +++ b/generated/nidaqmx/utils.py @@ -10,6 +10,7 @@ from nidaqmx.grpc_session_options import GrpcSessionOptions # Method logic adapted from +# cspell:disable-next-line # //Measurements/Infrastructure/dmxf/trunk/2.5/source/nimuck/parseUtilities.cpp _invalid_range_syntax_message = ( @@ -184,7 +185,7 @@ def unflatten_channel_string(channel_names: str) -> list[str]: for i in range(number_of_channels): current_number = num_min + i if num_min_width > 0: - # Using fstrings to create format strings. Braces for days! + # Using f-strings to create format strings. Braces for days! zero_padded_format_specifier = f"{{:0{num_min_width}d}}" current_number_str = zero_padded_format_specifier.format(current_number) else: diff --git a/pyproject.toml b/pyproject.toml index 089c54eb1..30ab9a799 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -26,11 +26,13 @@ classifiers = [ dynamic = ["dependencies"] readme = "README.rst" authors = [{name = "NI", email = "opensource@ni.com"}] +# cspell:disable maintainers = [ {name = "Zach Hindes", email = "zach.hindes@ni.com"}, {name = "Maxx Boehme", email = "maxx.boehme@ni.com"}, {name = "Brad Keryan", email = "brad.keryan@ni.com"}, ] +# cspell:enable requires-python = '>=3.9,<4.0' [project.urls] @@ -144,8 +146,10 @@ extend_exclude = ".tox,docs,generated,src/codegen/metadata,src/codegen/templates application-import-names = "nidaqmx" [tool.pytest.ini_options] +# cspell:ignore addopts addopts = "--doctest-modules --strict-markers" filterwarnings = ["always::ImportWarning", "always::ResourceWarning"] +# cspell:ignore testpaths testpaths = ["tests/acceptance", "tests/component", "tests/legacy", "tests/unit"] markers = [ # Defines custom markers used by nidaqmx tests. Prevents PytestUnknownMarkWarning. diff --git a/src/codegen/generator.py b/src/codegen/generator.py index cb2f0588d..b5bc3ca31 100644 --- a/src/codegen/generator.py +++ b/src/codegen/generator.py @@ -1,4 +1,4 @@ -"""Codegenerator for generating DAQmx functions.""" +"""Code generator for generating DAQmx functions.""" import logging import os diff --git a/src/codegen/metadata/attributes.py b/src/codegen/metadata/attributes.py index 3ab32045f..4c8a5d7c6 100644 --- a/src/codegen/metadata/attributes.py +++ b/src/codegen/metadata/attributes.py @@ -23038,7 +23038,7 @@ ], 'name': 'AI_CONV_CLK_PULSE_WIDTH', 'python_data_type': 'float', - 'python_description': 'Specifies the width of an exported AI Convert Clock pulse, in units specfied with **ai_conv_clk_pulse_width_units**.', + 'python_description': 'Specifies the width of an exported AI Convert Clock pulse, in units specified with **ai_conv_clk_pulse_width_units**.', 'resettable': False, 'type': 'float64' }, @@ -26055,7 +26055,7 @@ 'name': 'OPEN_THRMCPL_CHANS', 'python_class_name': 'InStream', 'python_data_type': 'str', - 'python_description': 'Indicates a list of names of any virtual channels in the task for which the device(s) detected an open thermcouple. You must read **open_thrmcpl_chans_exist** before you read this property. Otherwise, you will receive an error.', + 'python_description': 'Indicates a list of names of any virtual channels in the task for which the device(s) detected an open thermocouple. You must read **open_thrmcpl_chans_exist** before you read this property. Otherwise, you will receive an error.', 'resettable': False, 'type': 'char[]' }, @@ -31891,7 +31891,7 @@ 'name': 'ANLG_EDGE_REF_TRIG_DIG_FLTR_MIN_PULSE_WIDTH', 'python_class_name': 'ReferenceTrigger', 'python_data_type': 'float', - 'python_description': 'Specifies in seconds the minimum pulse width thefilter recognizes.', + 'python_description': 'Specifies in seconds the minimum pulse width the filter recognizes.', 'python_name': 'anlg_edge_dig_fltr_min_pulse_width', 'resettable': True, 'type': 'float64' diff --git a/src/codegen/stub_generator.py b/src/codegen/stub_generator.py index ecdf75645..4128a402e 100644 --- a/src/codegen/stub_generator.py +++ b/src/codegen/stub_generator.py @@ -61,10 +61,12 @@ def fix_import_paths( ): """Fix import paths of generated files.""" print("Fixing import paths") - grpc_codegened_file_paths = list(stubs_path.rglob("*pb2*py")) - imports_to_fix = [path.stem for path in grpc_codegened_file_paths if path.parent == stubs_path] - grpc_codegened_file_paths.extend(stubs_path.rglob("*pb2*pyi")) - for path in grpc_codegened_file_paths: + grpc_code_generated_file_paths = list(stubs_path.rglob("*pb2*py")) + imports_to_fix = [ + path.stem for path in grpc_code_generated_file_paths if path.parent == stubs_path + ] + grpc_code_generated_file_paths.extend(stubs_path.rglob("*pb2*pyi")) + for path in grpc_code_generated_file_paths: print(f"Processing {path}") data = path.read_text() for name in imports_to_fix: diff --git a/src/codegen/templates/_grpc_interpreter.py.mako b/src/codegen/templates/_grpc_interpreter.py.mako index 6141af792..a348eeeee 100644 --- a/src/codegen/templates/_grpc_interpreter.py.mako +++ b/src/codegen/templates/_grpc_interpreter.py.mako @@ -469,7 +469,7 @@ def _assign_numpy_array(numpy_array, grpc_array): Assigns grpc array to numpy array maintaining the original shape. Checks for the instance of grpc_array with bytes, if validated to True, - the numpy array is assigned to a 1D array of the grpc arrray. + the numpy array is assigned to a 1D array of the grpc array. """ grpc_array_size = len(grpc_array) if isinstance(grpc_array, bytes): diff --git a/src/codegen/templates/_library_interpreter.py.mako b/src/codegen/templates/_library_interpreter.py.mako index 574bd1e92..5a3ad6ac1 100644 --- a/src/codegen/templates/_library_interpreter.py.mako +++ b/src/codegen/templates/_library_interpreter.py.mako @@ -168,14 +168,14 @@ class LibraryInterpreter(BaseInterpreter): def get_error_string(self, error_code): error_buffer = ctypes.create_string_buffer(2048) - cfunc = lib_importer.windll.DAQmxGetErrorString - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ctypes.c_int, ctypes.c_char_p, + c_func = lib_importer.windll.DAQmxGetErrorString + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ctypes.c_int, ctypes.c_char_p, ctypes.c_uint] - query_error_code = cfunc(error_code, error_buffer, 2048) + query_error_code = c_func(error_code, error_buffer, 2048) if query_error_code < 0: _logger.error('Failed to get error string for error code %d. DAQmxGetErrorString returned error code %d.', error_code, query_error_code) return 'Failed to retrieve error description.' @@ -186,13 +186,13 @@ class LibraryInterpreter(BaseInterpreter): def get_extended_error_info(self): error_buffer = ctypes.create_string_buffer(2048) - cfunc = lib_importer.windll.DAQmxGetExtendedErrorInfo - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ctypes.c_char_p, ctypes.c_uint] + c_func = lib_importer.windll.DAQmxGetExtendedErrorInfo + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ctypes.c_char_p, ctypes.c_uint] - query_error_code = cfunc(error_buffer, 2048) + query_error_code = c_func(error_buffer, 2048) if query_error_code < 0: _logger.error('Failed to get extended error info. DAQmxGetExtendedErrorInfo returned error code %d.', query_error_code) return 'Failed to retrieve error description.' @@ -302,11 +302,11 @@ class LibraryInterpreter(BaseInterpreter): assert isinstance(task_handle, TaskHandle) samps_per_chan_read = ctypes.c_int() - cfunc = lib_importer.windll.DAQmxInternalReadAnalogWaveformEx - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxInternalReadAnalogWaveformEx + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ TaskHandle, ctypes.c_int, ctypes.c_double, @@ -322,7 +322,7 @@ class LibraryInterpreter(BaseInterpreter): ctypes.POINTER(c_bool32), ] - error_code = cfunc( + error_code = c_func( task_handle, number_of_samples_per_channel, timeout, @@ -361,11 +361,11 @@ class LibraryInterpreter(BaseInterpreter): array_size = read_arrays[0].size assert all(read_array.size == array_size for read_array in read_arrays) - cfunc = lib_importer.windll.DAQmxInternalReadAnalogWaveformPerChan - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxInternalReadAnalogWaveformPerChan + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ TaskHandle, ctypes.c_int, ctypes.c_double, @@ -381,11 +381,11 @@ class LibraryInterpreter(BaseInterpreter): ctypes.POINTER(c_bool32), ] - read_array_ptrs = (ctypes.POINTER(ctypes.c_double) * channel_count)() + read_array_pointers = (ctypes.POINTER(ctypes.c_double) * channel_count)() for i, read_array in enumerate(read_arrays): - read_array_ptrs[i] = read_array.ctypes.data_as(ctypes.POINTER(ctypes.c_double)) + read_array_pointers[i] = read_array.ctypes.data_as(ctypes.POINTER(ctypes.c_double)) - error_code = cfunc( + error_code = c_func( task_handle, num_samps_per_chan, timeout, @@ -394,7 +394,7 @@ class LibraryInterpreter(BaseInterpreter): 0 if t0_array is None else t0_array.size, self._get_wfm_attr_callback(properties), None, - read_array_ptrs, + read_array_pointers, channel_count, array_size, ctypes.byref(samps_per_chan_read), @@ -658,11 +658,11 @@ class LibraryInterpreter(BaseInterpreter): samps_per_chan_read = ctypes.c_int() num_bytes_per_samp = ctypes.c_int() - cfunc = lib_importer.windll.DAQmxInternalReadDigitalWaveform - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxInternalReadDigitalWaveform + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ TaskHandle, ctypes.c_int, ctypes.c_double, @@ -681,7 +681,7 @@ class LibraryInterpreter(BaseInterpreter): ctypes.POINTER(c_bool32), ] - error_code = cfunc( + error_code = c_func( task_handle, number_of_samples_per_channel, timeout, @@ -708,17 +708,17 @@ class LibraryInterpreter(BaseInterpreter): data_length_read = ctypes.c_uint() format_code = ctypes.c_uint() - cfunc = lib_importer.windll.DAQmxReadIDPinMemory - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxReadIDPinMemory + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ ctypes_byte_str, ctypes_byte_str, wrapped_ndpointer(dtype=numpy.uint8, flags=('C','W')), ctypes.c_uint, ctypes.POINTER(ctypes.c_uint), ctypes.POINTER(ctypes.c_uint)] - array_size = cfunc( + array_size = c_func( device_name, id_pin_name, None, 0, ctypes.byref(data_length_read), ctypes.byref(format_code)) @@ -727,7 +727,7 @@ class LibraryInterpreter(BaseInterpreter): data = numpy.zeros(array_size, dtype=numpy.uint8) - error_code = cfunc( + error_code = c_func( device_name, id_pin_name, data, array_size, ctypes.byref(data_length_read), ctypes.byref(format_code)) self.check_for_error(error_code) @@ -739,11 +739,11 @@ class LibraryInterpreter(BaseInterpreter): read_voltage_array, read_current_array): samps_per_chan_read = ctypes.c_int() - cfunc = lib_importer.windll.DAQmxReadPowerBinaryI16 - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxReadPowerBinaryI16 + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes.c_int, ctypes.c_double, c_bool32, wrapped_ndpointer(dtype=numpy.int16, flags=('C', 'W')), @@ -751,7 +751,7 @@ class LibraryInterpreter(BaseInterpreter): ctypes.c_uint, ctypes.POINTER(ctypes.c_int), ctypes.POINTER(c_bool32)] - error_code = cfunc( + error_code = c_func( task, num_samps_per_chan, timeout, fill_mode, read_voltage_array, read_current_array, read_voltage_array.size, ctypes.byref(samps_per_chan_read), None) @@ -765,11 +765,11 @@ class LibraryInterpreter(BaseInterpreter): read_voltage_array, read_current_array): samps_per_chan_read = ctypes.c_int() - cfunc = lib_importer.windll.DAQmxReadPowerF64 - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxReadPowerF64 + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes.c_int, ctypes.c_double, c_bool32, wrapped_ndpointer(dtype=numpy.float64, flags=('C', 'W')), @@ -777,7 +777,7 @@ class LibraryInterpreter(BaseInterpreter): ctypes.c_uint, ctypes.POINTER(ctypes.c_int), ctypes.POINTER(c_bool32)] - error_code = cfunc( + error_code = c_func( task, num_samps_per_chan, timeout, fill_mode, read_voltage_array, read_current_array, read_voltage_array.size, ctypes.byref(samps_per_chan_read), None) @@ -790,17 +790,17 @@ class LibraryInterpreter(BaseInterpreter): samples_read = ctypes.c_int() number_of_bytes_per_sample = ctypes.c_int() - cfunc = lib_importer.windll.DAQmxReadRaw - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxReadRaw + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes.c_int, ctypes.c_double, wrapped_ndpointer(dtype=read_array.dtype, flags=('C', 'W')), ctypes.c_uint, ctypes.POINTER(ctypes.c_int), ctypes.POINTER(ctypes.c_int), ctypes.POINTER(c_bool32)] - error_code = cfunc( + error_code = c_func( task, num_samps_per_chan, timeout, read_array, read_array.nbytes, ctypes.byref(samples_read), ctypes.byref(number_of_bytes_per_sample), None) @@ -874,11 +874,11 @@ class LibraryInterpreter(BaseInterpreter): assert channel_count > 0 assert all(write_array.size >= num_samps_per_chan for write_array in write_arrays) - cfunc = lib_importer.windll.DAQmxInternalWriteAnalogWaveformPerChan - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxInternalWriteAnalogWaveformPerChan + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ TaskHandle, ctypes.c_int, c_bool32, @@ -889,16 +889,16 @@ class LibraryInterpreter(BaseInterpreter): ctypes.POINTER(c_bool32), ] - write_array_ptrs = (ctypes.POINTER(ctypes.c_double) * channel_count)() + write_array_pointers = (ctypes.POINTER(ctypes.c_double) * channel_count)() for i, write_array in enumerate(write_arrays): - write_array_ptrs[i] = write_array.ctypes.data_as(ctypes.POINTER(ctypes.c_double)) + write_array_pointers[i] = write_array.ctypes.data_as(ctypes.POINTER(ctypes.c_double)) - error_code = cfunc( + error_code = c_func( task_handle, num_samps_per_chan, auto_start, timeout, - write_array_ptrs, + write_array_pointers, channel_count, ctypes.byref(samps_per_chan_written), None, @@ -989,11 +989,11 @@ class LibraryInterpreter(BaseInterpreter): assert isinstance(task_handle, TaskHandle) samps_per_chan_written = ctypes.c_int() - cfunc = lib_importer.windll.DAQmxInternalWriteDigitalWaveform - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxInternalWriteDigitalWaveform + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ TaskHandle, ctypes.c_int, c_bool32, @@ -1006,7 +1006,7 @@ class LibraryInterpreter(BaseInterpreter): ctypes.POINTER(c_bool32), ] - error_code = cfunc( + error_code = c_func( task_handle, num_samps_per_chan, auto_start, @@ -1026,18 +1026,18 @@ class LibraryInterpreter(BaseInterpreter): self, task_handle, num_samps_per_chan, auto_start, timeout, numpy_array): samps_per_chan_written = ctypes.c_int() - cfunc = lib_importer.windll.DAQmxWriteRaw - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.windll.DAQmxWriteRaw + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ lib_importer.task_handle, ctypes.c_int, c_bool32, ctypes.c_double, wrapped_ndpointer(dtype=numpy_array.dtype, flags=('C')), ctypes.POINTER(ctypes.c_int), ctypes.POINTER(c_bool32)] - error_code = cfunc( + error_code = c_func( task_handle, num_samps_per_chan, auto_start, timeout, numpy_array, ctypes.byref(samps_per_chan_written), None) self.check_for_error(error_code, samps_per_chan_written=samps_per_chan_written.value) diff --git a/src/codegen/templates/library_interpreter/default_c_function_call.py.mako b/src/codegen/templates/library_interpreter/default_c_function_call.py.mako index d16c6be09..fc27bfeb3 100644 --- a/src/codegen/templates/library_interpreter/default_c_function_call.py.mako +++ b/src/codegen/templates/library_interpreter/default_c_function_call.py.mako @@ -13,14 +13,14 @@ # or samps_per_chan_written=) samps_per_chan_param = get_samps_per_chan_read_or_write_param(function.base_parameters) %>\ - cfunc = lib_importer.${'windll' if function.calling_convention == 'StdCall' else 'cdll'}.DAQmx${function.c_function_name} - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.${'windll' if function.calling_convention == 'StdCall' else 'cdll'}.DAQmx${function.c_function_name} + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ ${', '.join(get_argument_types(function)) | wrap(24, 24)}] - error_code = cfunc( + error_code = c_func( ${', '.join(function_call_args) | wrap(12, 12)}) %if samps_per_chan_param is None: self.check_for_error(error_code) diff --git a/src/codegen/templates/library_interpreter/double_c_function_call.py.mako b/src/codegen/templates/library_interpreter/double_c_function_call.py.mako index 185badf08..b01e00c2f 100644 --- a/src/codegen/templates/library_interpreter/double_c_function_call.py.mako +++ b/src/codegen/templates/library_interpreter/double_c_function_call.py.mako @@ -13,17 +13,17 @@ function_call_args = generate_interpreter_function_call_args(function) explicit_output_param = get_output_param_with_ivi_dance_mechanism(function) %>\ - cfunc = lib_importer.${'windll' if function.calling_convention == 'StdCall' else 'cdll'}.DAQmx${function.c_function_name} - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.${'windll' if function.calling_convention == 'StdCall' else 'cdll'}.DAQmx${function.c_function_name} + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ ${', '.join(get_argument_types(function)) | wrap(24, 24)}] temp_size = ${'size_hint' if function.function_name in INCLUDE_SIZE_HINT_FUNCTIONS else '0'} while True: ${instantiate_explicit_output_param(explicit_output_param)} - size_or_code = cfunc( + size_or_code = c_func( ${', '.join(function_call_args) | wrap(16, 16)}) %if explicit_output_param.ctypes_data_type == 'ctypes.c_char_p': if is_string_buffer_too_small(size_or_code): diff --git a/src/codegen/templates/library_interpreter/event_function_call.py.mako b/src/codegen/templates/library_interpreter/event_function_call.py.mako index 2b45ca098..076146350 100644 --- a/src/codegen/templates/library_interpreter/event_function_call.py.mako +++ b/src/codegen/templates/library_interpreter/event_function_call.py.mako @@ -24,11 +24,11 @@ ${callback_func_param.type} = ctypes.CFUNCTYPE( ${', '.join(callback_param_types) | wrap(12)}) - cfunc = lib_importer.${'windll' if function.calling_convention == 'StdCall' else 'cdll'}.DAQmx${function.c_function_name} - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + c_func = lib_importer.${'windll' if function.calling_convention == 'StdCall' else 'cdll'}.DAQmx${function.c_function_name} + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ ${', '.join(argument_types) | wrap(24)}] %if is_event_register_function(function): @@ -43,7 +43,7 @@ callback_data = None %endif - error_code = cfunc( + error_code = c_func( ${', '.join(function_call_args) | wrap(12)}) self.check_for_error(error_code) %if is_event_register_function(function): diff --git a/src/codegen/templates/library_interpreter/exec_cdecl_c_function_call.py.mako b/src/codegen/templates/library_interpreter/exec_cdecl_c_function_call.py.mako index 3285ded60..16a642447 100644 --- a/src/codegen/templates/library_interpreter/exec_cdecl_c_function_call.py.mako +++ b/src/codegen/templates/library_interpreter/exec_cdecl_c_function_call.py.mako @@ -30,8 +30,8 @@ args.append(None) argtypes.append(ctypes.c_void_p) - cfunc = lib_importer.${'windll' if function.calling_convention == 'StdCall' else 'cdll'}.DAQmx${function.c_function_name} - with cfunc.arglock: - cfunc.argtypes = argtypes - error_code = cfunc(*args) + c_func = lib_importer.${'windll' if function.calling_convention == 'StdCall' else 'cdll'}.DAQmx${function.c_function_name} + with c_func.arg_lock: + c_func.argtypes = argtypes + error_code = c_func(*args) self.check_for_error(error_code) diff --git a/src/codegen/templates/property_legacy_deleter_template.py.mako b/src/codegen/templates/property_legacy_deleter_template.py.mako index 140fb2b24..6a70e2220 100644 --- a/src/codegen/templates/property_legacy_deleter_template.py.mako +++ b/src/codegen/templates/property_legacy_deleter_template.py.mako @@ -10,15 +10,15 @@ raise NotImplementedError ## When the length of the function name is too long, it will be wrapped to the next line %if len(attribute.c_function_name) < 33: - cfunc = lib_importer.${attribute.get_lib_importer_type()}.DAQmxReset${attribute.c_function_name} + c_func = lib_importer.${attribute.get_lib_importer_type()}.DAQmxReset${attribute.c_function_name} %else: - cfunc = (lib_importer.${attribute.get_lib_importer_type()}. + c_func = (lib_importer.${attribute.get_lib_importer_type()}. DAQmxReset${attribute.c_function_name}) %endif - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ ${', '.join(attribute.get_handle_parameter_arguments()) | wrap(initial_indent=24)}] \ ## Script function call. @@ -27,7 +27,7 @@ for handle_parameter in attribute.handle_parameters: function_call_args.append(handle_parameter.accessor) %>\ - error_code = cfunc( + error_code = c_func( ${', '.join(function_call_args) | wrap(initial_indent=12)}) self._interpreter.check_for_error(error_code) \ No newline at end of file diff --git a/src/codegen/templates/property_legacy_setter_template.py.mako b/src/codegen/templates/property_legacy_setter_template.py.mako index 1d6b92dfb..9c23dfc8c 100644 --- a/src/codegen/templates/property_legacy_setter_template.py.mako +++ b/src/codegen/templates/property_legacy_setter_template.py.mako @@ -46,15 +46,15 @@ %>\ ## When the length of the function name is too long, it will be wrapped to the next line %if len(attribute.c_function_name) < 33: - cfunc = lib_importer.${attribute.get_lib_importer_type()}.DAQmxSet${attribute.c_function_name} + c_func = lib_importer.${attribute.get_lib_importer_type()}.DAQmxSet${attribute.c_function_name} %else: - cfunc = (lib_importer.${attribute.get_lib_importer_type()}. + c_func = (lib_importer.${attribute.get_lib_importer_type()}. DAQmxSet${attribute.c_function_name}) %endif - if cfunc.argtypes is None: - with cfunc.arglock: - if cfunc.argtypes is None: - cfunc.argtypes = [ + if c_func.argtypes is None: + with c_func.arg_lock: + if c_func.argtypes is None: + c_func.argtypes = [ ${', '.join(argtypes) | wrap(initial_indent=24)}] \ ## Script function call. @@ -66,7 +66,7 @@ if attribute.has_explicit_write_buffer_size: function_call_args.append('len(val)') %>\ - error_code = cfunc( + error_code = c_func( ${', '.join(function_call_args) | wrap(initial_indent=12)}) self._interpreter.check_for_error(error_code) \ No newline at end of file diff --git a/src/codegen/templates/task/triggering/_arm_start_trigger.py.mako b/src/codegen/templates/task/triggering/_arm_start_trigger.py.mako index d9a03d15e..5894afb8f 100644 --- a/src/codegen/templates/task/triggering/_arm_start_trigger.py.mako +++ b/src/codegen/templates/task/triggering/_arm_start_trigger.py.mako @@ -7,8 +7,8 @@ attributes = get_attributes(data, "ArmStartTrigger") functions = get_functions(data,"ArmStartTrigger") attr_enums = attribute_enums(attributes) - fuct_enums = functions_enums(functions) - enums_used = get_enums_to_import(attr_enums, fuct_enums) + func_enums = functions_enums(functions) + enums_used = get_enums_to_import(attr_enums, func_enums) %>\ # Do not edit this file; it was automatically generated. diff --git a/src/codegen/templates/task/triggering/_handshake_trigger.py.mako b/src/codegen/templates/task/triggering/_handshake_trigger.py.mako index 21e9be9c8..49a3c96e0 100644 --- a/src/codegen/templates/task/triggering/_handshake_trigger.py.mako +++ b/src/codegen/templates/task/triggering/_handshake_trigger.py.mako @@ -6,8 +6,8 @@ attributes = get_attributes(data, "HandshakeTrigger") functions = get_functions(data,"HandshakeTrigger") attr_enums = attribute_enums(attributes) - fuct_enums = functions_enums(functions) - enums_used = get_enums_to_import(attr_enums, fuct_enums) + func_enums = functions_enums(functions) + enums_used = get_enums_to_import(attr_enums, func_enums) %>\ # Do not edit this file; it was automatically generated. diff --git a/src/codegen/templates/task/triggering/_pause_trigger.py.mako b/src/codegen/templates/task/triggering/_pause_trigger.py.mako index b58093423..e6a46d54e 100644 --- a/src/codegen/templates/task/triggering/_pause_trigger.py.mako +++ b/src/codegen/templates/task/triggering/_pause_trigger.py.mako @@ -6,8 +6,8 @@ attributes = get_attributes(data, "PauseTrigger") functions = get_functions(data,"PauseTrigger") attr_enums = attribute_enums(attributes) - fuct_enums = functions_enums(functions) - enums_used = get_enums_to_import(attr_enums, fuct_enums) + func_enums = functions_enums(functions) + enums_used = get_enums_to_import(attr_enums, func_enums) %>\ # Do not edit this file; it was automatically generated. diff --git a/src/codegen/templates/task/triggering/_reference_trigger.py.mako b/src/codegen/templates/task/triggering/_reference_trigger.py.mako index 12e39916c..9bac3196c 100644 --- a/src/codegen/templates/task/triggering/_reference_trigger.py.mako +++ b/src/codegen/templates/task/triggering/_reference_trigger.py.mako @@ -6,8 +6,8 @@ attributes = get_attributes(data, "ReferenceTrigger") functions = get_functions(data,"ReferenceTrigger") attr_enums = attribute_enums(attributes) - fuct_enums = functions_enums(functions) - enums_used = get_enums_to_import(attr_enums, fuct_enums) + func_enums = functions_enums(functions) + enums_used = get_enums_to_import(attr_enums, func_enums) %>\ # Do not edit this file; it was automatically generated. diff --git a/src/codegen/templates/task/triggering/_start_trigger.py.mako b/src/codegen/templates/task/triggering/_start_trigger.py.mako index 27de6128f..8718b0ad6 100644 --- a/src/codegen/templates/task/triggering/_start_trigger.py.mako +++ b/src/codegen/templates/task/triggering/_start_trigger.py.mako @@ -6,8 +6,8 @@ attributes = get_attributes(data, "StartTrigger") functions = get_functions(data,"StartTrigger") attr_enums = attribute_enums(attributes) - fuct_enums = functions_enums(functions) - enums_used = get_enums_to_import(attr_enums, fuct_enums) + func_enums = functions_enums(functions) + enums_used = get_enums_to_import(attr_enums, func_enums) %>\ # Do not edit this file; it was automatically generated. diff --git a/src/codegen/utilities/function_helpers.py b/src/codegen/utilities/function_helpers.py index e1b0e159d..f07fe60e1 100644 --- a/src/codegen/utilities/function_helpers.py +++ b/src/codegen/utilities/function_helpers.py @@ -88,7 +88,7 @@ def get_enums_used(functions): def order_function_parameters_by_optional(function_parameters): - """Sorts optional parameters and non optional parameters for function defintion.""" + """Sorts optional parameters and non optional parameters for function definition.""" optional_params = [] non_optional_params = [] for param in function_parameters: @@ -101,7 +101,7 @@ def order_function_parameters_by_optional(function_parameters): def get_parameter_signature(is_python_factory, sorted_params): - """Gets parameter signature for function defintion.""" + """Gets parameter signature for function definition.""" params_with_defaults = [] if not is_python_factory: params_with_defaults.append("self") diff --git a/src/codegen/utilities/interpreter_helpers.py b/src/codegen/utilities/interpreter_helpers.py index ad35916e7..98051eb8a 100644 --- a/src/codegen/utilities/interpreter_helpers.py +++ b/src/codegen/utilities/interpreter_helpers.py @@ -558,7 +558,7 @@ def get_input_arguments_for_compound_params(func): def create_compound_parameter_request(func): - """Gets the input parameters for createing the compound type parameter.""" + """Gets the input parameters for creating the compound type parameter.""" parameters = [] compound_parameter_type = "" for parameter in func.base_parameters: diff --git a/src/handwritten/_install_daqmx.py b/src/handwritten/_install_daqmx.py index 4a30e42c2..68ce913a7 100644 --- a/src/handwritten/_install_daqmx.py +++ b/src/handwritten/_install_daqmx.py @@ -302,7 +302,7 @@ def _install_daqmx_driver_linux_core(download_url: str, release: str) -> None: def _validate_download_url(download_url: str) -> None: - """Velidate that the download URL uses https and points to a trusted site.""" + """Validate that the download URL uses https and points to a trusted site.""" parsed_url = urlparse(download_url) if parsed_url.scheme != "https" or parsed_url.netloc != "download.ni.com": raise click.ClickException(f"Unsupported download URL: {download_url}") diff --git a/src/handwritten/_lib.py b/src/handwritten/_lib.py index 8fccba52b..87e390223 100644 --- a/src/handwritten/_lib.py +++ b/src/handwritten/_lib.py @@ -102,12 +102,12 @@ def __getattr__( # noqa: D105 - Missing docstring in magic method (auto-generat self, function ): try: - cfunc = getattr(self._library, function) - if not hasattr(cfunc, "arglock"): + c_func = getattr(self._library, function) + if not hasattr(c_func, "arg_lock"): with self._lib_lock: - if not hasattr(cfunc, "arglock"): - cfunc.arglock = threading.Lock() - return cfunc + if not hasattr(c_func, "arg_lock"): + c_func.arg_lock = threading.Lock() + return c_func except AttributeError: raise DaqFunctionNotSupportedError(_FUNCTION_NOT_SUPPORTED_MESSAGE.format(function)) @@ -188,9 +188,9 @@ def _import_lib(self): if sys.platform.startswith("win"): - def _load_lib(libname: str): - windll = ctypes.windll.LoadLibrary(libname) - cdll = ctypes.cdll.LoadLibrary(libname) + def _load_lib(library_name: str): + windll = ctypes.windll.LoadLibrary(library_name) + cdll = ctypes.cdll.LoadLibrary(library_name) return windll, cdll # Feature Toggle to load nicaiu.dll or nicai_utf8.dll diff --git a/src/handwritten/_linux_installation_commands.py b/src/handwritten/_linux_installation_commands.py index 91e688ebe..c5d522492 100644 --- a/src/handwritten/_linux_installation_commands.py +++ b/src/handwritten/_linux_installation_commands.py @@ -66,7 +66,7 @@ class DistroInfo: # noqa: D101 - Missing docstring in public class (auto-genera install_commands: list[list[str]] -# Mapping of distros to their command templates and version handlers +# Mapping of Linux distributions to their command templates and version handlers LINUX_COMMANDS = { "ubuntu": DistroInfo(_get_version_ubuntu, _DEBIAN_DAQMX_VERSION_COMMAND, _APT_INSTALL_COMMANDS), "opensuse": DistroInfo( diff --git a/src/handwritten/types.py b/src/handwritten/types.py index 45f296004..561b34ece 100644 --- a/src/handwritten/types.py +++ b/src/handwritten/types.py @@ -3,7 +3,7 @@ import collections import typing -# region Task Counter IO namedtuples +# region Task Counter IO named tuples CtrFreq = collections.namedtuple("CtrFreq", ["freq", "duty_cycle"]) @@ -13,13 +13,13 @@ # endregion -# region Power IO namedtuples +# region Power IO named tuples PowerMeasurement = collections.namedtuple("PowerMeasurement", ["voltage", "current"]) # endregion -# region Watchdog namedtuples +# region Watchdog named tuples AOExpirationState = collections.namedtuple( "AOExpirationState", ["physical_channel", "expiration_state", "output_type"] @@ -35,7 +35,7 @@ # endregion -# region Power Up States namedtuples +# region Power Up States named tuples AOPowerUpState = collections.namedtuple( "AOPowerUpState", ["physical_channel", "power_up_state", "channel_type"] @@ -49,7 +49,7 @@ # endregion -# region System namedtuples +# region System named tuples CDAQSyncConnection = collections.namedtuple("CDAQSyncConnection", ["output_port", "input_port"]) @@ -59,7 +59,7 @@ # endregion -# region ID Pin namedtuples +# region ID Pin named tuples class IDPinContents(typing.NamedTuple): diff --git a/src/handwritten/utils.py b/src/handwritten/utils.py index 3eb25f7b1..819d565d4 100644 --- a/src/handwritten/utils.py +++ b/src/handwritten/utils.py @@ -10,6 +10,7 @@ from nidaqmx.grpc_session_options import GrpcSessionOptions # Method logic adapted from +# cspell:disable-next-line # //Measurements/Infrastructure/dmxf/trunk/2.5/source/nimuck/parseUtilities.cpp _invalid_range_syntax_message = ( @@ -184,7 +185,7 @@ def unflatten_channel_string(channel_names: str) -> list[str]: for i in range(number_of_channels): current_number = num_min + i if num_min_width > 0: - # Using fstrings to create format strings. Braces for days! + # Using f-strings to create format strings. Braces for days! zero_padded_format_specifier = f"{{:0{num_min_width}d}}" current_number_str = zero_padded_format_specifier.format(current_number) else: diff --git a/tests/acceptance/test_internationalization.py b/tests/acceptance/test_internationalization.py index 6228d3b6d..e7d578a58 100644 --- a/tests/acceptance/test_internationalization.py +++ b/tests/acceptance/test_internationalization.py @@ -1,3 +1,4 @@ +# cspell:ignore appareil Daten Données Gerät prüfende from __future__ import annotations import pathlib diff --git a/tests/component/_analog_utils.py b/tests/component/_analog_utils.py index 7f39ef07e..5fb2347e1 100644 --- a/tests/component/_analog_utils.py +++ b/tests/component/_analog_utils.py @@ -12,7 +12,7 @@ import nidaqmx.system -# Simulated DAQ voltage data is a noisy sinewave within the range of the minimum and maximum values +# Simulated DAQ voltage data is a noisy sine wave within the range of the minimum and maximum values # of the virtual channel. We can leverage this behavior to validate we get the correct data from # the Python bindings. def _get_voltage_offset_for_chan(chan_index: int) -> float: diff --git a/tests/component/system/_collections/__init__.py b/tests/component/system/_collections/__init__.py index 2ae12b04b..1f851aabe 100644 --- a/tests/component/system/_collections/__init__.py +++ b/tests/component/system/_collections/__init__.py @@ -1 +1 @@ -"""Component tests for nidaqmx.system.storage._collecitons.*.""" +"""Component tests for nidaqmx.system.storage._collections.*.""" diff --git a/tests/component/system/storage/test_persisted_task.py b/tests/component/system/storage/test_persisted_task.py index 22b3116bd..68022313b 100644 --- a/tests/component/system/storage/test_persisted_task.py +++ b/tests/component/system/storage/test_persisted_task.py @@ -62,7 +62,7 @@ def test___persisted_task___load_twice___raises_duplicate_task(persisted_task: P @pytest.mark.task_name("VoltageTesterTask") @pytest.mark.grpc_only(reason="Default gRPC initialization behavior is auto (create or attach)") @pytest.mark.grpc_session_initialization_behavior(SessionInitializationBehavior.AUTO) -def test___grpc_session_initializaton_behavior_auto___load_twice___returns_multiple_task_proxies( +def test___grpc_session_initialization_behavior_auto___load_twice___returns_multiple_task_proxies( persisted_task: PersistedTask, ): with persisted_task.load() as task1: diff --git a/tests/component/task/channels/test_ai_channel.py b/tests/component/task/channels/test_ai_channel.py index 8fe8bb7d5..e182bbbfa 100644 --- a/tests/component/task/channels/test_ai_channel.py +++ b/tests/component/task/channels/test_ai_channel.py @@ -902,7 +902,7 @@ def test___task___add_teds_ai_rtd_chan___sets_channel_attributes( assert chan.ai_meas_type == UsageTypeAI.TEMPERATURE_RTD assert chan.ai_resistance_cfg == resistance_config assert chan.ai_teds_is_teds - # rtd type and coeffeicients come from the TEDS file + # rtd type and coefficients come from the TEDS file assert chan.ai_rtd_type == RTDType.CUSTOM assert chan.ai_rtd_a == pytest.approx(3.81e-3, abs=1e-5) assert chan.ai_rtd_b == pytest.approx(-6.02e-7, abs=1e-9) diff --git a/tests/component/task/test_in_stream.py b/tests/component/task/test_in_stream.py index 2d045eee8..f91eaa262 100644 --- a/tests/component/task/test_in_stream.py +++ b/tests/component/task/test_in_stream.py @@ -15,8 +15,8 @@ SINE_VOLTAGE_MIN = -2.5 SINE_RAW_MAX = 16383 SINE_RAW_MIN = -16384 -FULLSCALE_RAW_MAX = 32767 -FULLSCALE_RAW_MIN = -32768 +FULL_SCALE_RAW_MAX = 32767 +FULL_SCALE_RAW_MIN = -32768 @pytest.fixture() @@ -107,7 +107,7 @@ def test___valid_array___readinto___returns_valid_samples( ) -> None: # Initialize the array to full-scale readings to ensure it is overwritten. data = numpy.full( - ai_sine_task.number_of_channels * samples_to_read, FULLSCALE_RAW_MAX, dtype=numpy.int16 + ai_sine_task.number_of_channels * samples_to_read, FULL_SCALE_RAW_MAX, dtype=numpy.int16 ) with pytest.deprecated_call(): @@ -122,14 +122,14 @@ def test___odd_sized_array___readinto___returns_whole_samples_and_clears_padding ) -> None: _create_ai_sine_channels(task, sim_6363_device, number_of_channels=2) # Initialize the array to full-scale readings to ensure it is overwritten. - data = numpy.full(19, FULLSCALE_RAW_MIN, dtype=numpy.int16) + data = numpy.full(19, FULL_SCALE_RAW_MIN, dtype=numpy.int16) with pytest.deprecated_call(): samples_read = task.in_stream.readinto(data) assert samples_read == 9 assert (SINE_RAW_MIN <= data[:-1]).all() and (data[:-1] <= SINE_RAW_MAX).all() - assert data[-1] == 0 # not FULLSCALE_RAW_MIN + assert data[-1] == 0 # not FULL_SCALE_RAW_MIN def test___ai_finite_task___read_all___returns_valid_samples_shape_and_dtype( @@ -172,7 +172,7 @@ def test___valid_array___read_into___returns_valid_samples( ) -> None: # Initialize the array to full-scale readings to ensure it is overwritten. data = numpy.full( - ai_sine_task.number_of_channels * samples_to_read, FULLSCALE_RAW_MAX, dtype=numpy.int16 + ai_sine_task.number_of_channels * samples_to_read, FULL_SCALE_RAW_MAX, dtype=numpy.int16 ) samples_read = ai_sine_task.in_stream.read_into(data) @@ -186,13 +186,13 @@ def test___odd_sized_array___read_into___returns_whole_samples_and_clears_paddin ) -> None: _create_ai_sine_channels(task, sim_6363_device, number_of_channels=2) # Initialize the array to full-scale readings to ensure it is overwritten. - data = numpy.full(19, FULLSCALE_RAW_MIN, dtype=numpy.int16) + data = numpy.full(19, FULL_SCALE_RAW_MIN, dtype=numpy.int16) samples_read = task.in_stream.read_into(data) assert samples_read == 9 assert (SINE_RAW_MIN <= data[:-1]).all() and (data[:-1] <= SINE_RAW_MAX).all() - assert data[-1] == 0 # not FULLSCALE_RAW_MIN + assert data[-1] == 0 # not FULL_SCALE_RAW_MIN def test___valid_path___configure_logging___returns_assigned_values(ai_task: nidaqmx.Task): diff --git a/tests/component/task/test_timing_properties.py b/tests/component/task/test_timing_properties.py index 1ccaecfc0..7d77a162d 100644 --- a/tests/component/task/test_timing_properties.py +++ b/tests/component/task/test_timing_properties.py @@ -462,9 +462,7 @@ def test___timing___reset_uint64_property_with_device_context___throws_daqerror( assert e.value.error_type == DAQmxErrors.M_STUDIO_OPERATION_DOES_NOT_SUPPORT_DEVICE_CONTEXT -def test___timing___set_unint64_property_out_of_range_value___throws_daqerror( - task, sim_6363_device -): +def test___timing___set_uint64_property_out_of_range_value___throws_daqerror(task, sim_6363_device): task.ai_channels.add_ai_voltage_chan(sim_6363_device.ai_physical_chans[0].name) task.timing.cfg_samp_clk_timing(1000, samps_per_chan=1) diff --git a/tests/conftest.py b/tests/conftest.py index 9b28511ec..4393f5b46 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -642,13 +642,13 @@ def bridge_teds_file_path(teds_assets_directory: pathlib.Path) -> pathlib.Path: """Returns a TEDS file path.""" # Our normal bridge sensor TEDS file is incompatible with most devices. It # has a 1ohm bridge resistance. - return teds_assets_directory / "forcebridge.ted" + return teds_assets_directory / "ForceBridge.ted" @pytest.fixture def force_bridge_teds_file_path(teds_assets_directory: pathlib.Path) -> pathlib.Path: """Returns a TEDS file path.""" - return teds_assets_directory / "forcebridge.ted" + return teds_assets_directory / "ForceBridge.ted" @pytest.fixture @@ -684,13 +684,13 @@ def rvdt_teds_file_path(teds_assets_directory: pathlib.Path) -> pathlib.Path: @pytest.fixture def pressure_bridge_teds_file_path(teds_assets_directory: pathlib.Path) -> pathlib.Path: """Returns a TEDS file path.""" - return teds_assets_directory / "pressurebridge.ted" + return teds_assets_directory / "PressureBridge.ted" @pytest.fixture def torque_bridge_teds_file_path(teds_assets_directory: pathlib.Path) -> pathlib.Path: """Returns a TEDS file path.""" - return teds_assets_directory / "torquebridge.ted" + return teds_assets_directory / "TorqueBridge.ted" @pytest.fixture diff --git a/tests/legacy/test_stream_digital_readers_writers.py b/tests/legacy/test_stream_digital_readers_writers.py index 054bad3c8..22d8ad789 100644 --- a/tests/legacy/test_stream_digital_readers_writers.py +++ b/tests/legacy/test_stream_digital_readers_writers.py @@ -290,7 +290,7 @@ class TestDigitalMultiChannelReaderWriter(TestDAQmxIOBase): @pytest.mark.parametrize("seed", [generate_random_seed()]) def test_one_sample_one_line(self, task, real_x_series_device, seed): - """Test to validate digital mutichannel read and write operation with sample data.""" + """Test to validate digital multichannel read and write operation with sample data.""" # Reset the pseudorandom number generator with seed. random.seed(seed) @@ -320,7 +320,7 @@ def test_one_sample_one_line(self, task, real_x_series_device, seed): @pytest.mark.parametrize("seed", [generate_random_seed()]) def test_one_sample_multi_line(self, task, real_x_series_device, seed): - """Test to validate digital mutichannel read and write operation with sample data.""" + """Test to validate digital multichannel read and write operation with sample data.""" # Reset the pseudorandom number generator with seed. random.seed(seed) @@ -360,7 +360,7 @@ def test_one_sample_multi_line(self, task, real_x_series_device, seed): @pytest.mark.parametrize("seed", [generate_random_seed()]) def test_one_sample_port_byte(self, task, real_x_series_device, seed): - """Test to validate digital mutichannel read and write operation with sample bytes.""" + """Test to validate digital multichannel read and write operation with sample bytes.""" if len([d.do_port_width <= 8 for d in real_x_series_device.do_ports]) < 2: pytest.skip("Requires 2 digital ports with at most 8 lines.") @@ -394,7 +394,7 @@ def test_one_sample_port_byte(self, task, real_x_series_device, seed): @pytest.mark.parametrize("seed", [generate_random_seed()]) def test_one_sample_port_uint16(self, task, real_x_series_device, seed): - """Test to validate digital mutichannel read and write operation with uint16.""" + """Test to validate digital multichannel read and write operation with uint16.""" if len([d.do_port_width <= 16 for d in real_x_series_device.do_ports]) < 2: pytest.skip("Requires 2 digital ports with at most 16 lines.") @@ -428,7 +428,7 @@ def test_one_sample_port_uint16(self, task, real_x_series_device, seed): @pytest.mark.parametrize("seed", [generate_random_seed()]) def test_one_sample_port_uint32(self, task, real_x_series_device, seed): - """Test to validate digital mutichannel read and write operation with uint32.""" + """Test to validate digital multichannel read and write operation with uint32.""" if len([d.do_port_width <= 32 for d in real_x_series_device.do_ports]) < 2: pytest.skip("Requires 2 digital ports with at most 32 lines.") @@ -462,7 +462,7 @@ def test_one_sample_port_uint32(self, task, real_x_series_device, seed): @pytest.mark.parametrize("seed", [generate_random_seed()]) def test_many_sample_port_byte(self, task, real_x_series_device, seed): - """Test to validate digital mutichannel read and write operation with sample bytes.""" + """Test to validate digital multichannel read and write operation with sample bytes.""" if len([d.do_port_width <= 8 for d in real_x_series_device.do_ports]) < 2: pytest.skip("Requires 2 digital ports with at most 8 lines.") @@ -514,7 +514,7 @@ def test_many_sample_port_byte(self, task, real_x_series_device, seed): @pytest.mark.parametrize("seed", [generate_random_seed()]) def test_many_sample_port_uint16(self, task, real_x_series_device, seed): - """Test to validate digital mutichannel read and write operation with uint16.""" + """Test to validate digital multichannel read and write operation with uint16.""" if len([d.do_port_width <= 16 for d in real_x_series_device.do_ports]) < 2: pytest.skip("Requires 2 digital ports with at most 16 lines.") @@ -566,7 +566,7 @@ def test_many_sample_port_uint16(self, task, real_x_series_device, seed): @pytest.mark.parametrize("seed", [generate_random_seed()]) def test_many_sample_port_uint32(self, task, real_x_series_device, seed): - """Test to validate digital mutichannel read and write operation with uint32.""" + """Test to validate digital multichannel read and write operation with uint32.""" if len([d.do_port_width <= 32 for d in real_x_series_device.do_ports]) < 2: pytest.skip("Requires 2 digital ports with at most 32 lines.") diff --git a/tests/test_assets/teds/forcebridge.ted b/tests/test_assets/teds/ForceBridge.ted similarity index 100% rename from tests/test_assets/teds/forcebridge.ted rename to tests/test_assets/teds/ForceBridge.ted diff --git a/tests/test_assets/teds/pressurebridge.ted b/tests/test_assets/teds/PressureBridge.ted similarity index 100% rename from tests/test_assets/teds/pressurebridge.ted rename to tests/test_assets/teds/PressureBridge.ted diff --git a/tests/test_assets/teds/torquebridge.ted b/tests/test_assets/teds/TorqueBridge.ted similarity index 100% rename from tests/test_assets/teds/torquebridge.ted rename to tests/test_assets/teds/TorqueBridge.ted