### Install Dependencies with Poetry Source: https://github.com/ni/nidaqmx-python/blob/master/CONTRIBUTING.md Install nidaqmx and its development dependencies, including examples, using poetry. ```bash poetry install --all-extras --with examples ``` -------------------------------- ### Install nidaqmx Package Source: https://github.com/ni/nidaqmx-python/blob/master/README.rst Install the nidaqmx package using pip. For gRPC support, install with the 'grpc' extra. ```bash python -m pip install nidaqmx ``` ```bash python -m pip install nidaqmx[grpc] ``` -------------------------------- ### Install NI-DAQmx Driver Source: https://github.com/ni/nidaqmx-python/blob/master/README.rst Use the nidaqmx CLI to install the NI-DAQmx driver. This command automates the download and installation process for Windows and Linux. ```bash python -m nidaqmx installdriver ``` -------------------------------- ### Ready for Start Event Configuration Source: https://github.com/ni/nidaqmx-python/blob/master/docs/task.md Configure the active level and output terminal for the Ready for Start Event. ```APIDOC ## Property: rdy_for_start_event_lvl_active_lvl ### Description Specifies the polarity of the exported Ready for Start Event. ### Type nidaqmx.constants.Polarity ## Property: rdy_for_start_event_output_term ### Description Specifies the terminal to which to route the Ready for Start Event. ### Type str ``` -------------------------------- ### Install Docs Packages and Build Documentation Source: https://github.com/ni/nidaqmx-python/blob/master/CONTRIBUTING.md Install the necessary documentation packages using poetry and then build the HTML documentation using sphinx-build. ```sh $ poetry install --with docs $ poetry run sphinx-build -b html docs docs\_build ``` -------------------------------- ### start Source: https://github.com/ni/nidaqmx-python/blob/master/docs/task.md Starts the task, transitioning it to the running state to begin measurement or generation. This method is required for some applications and optional for others. ```APIDOC ## start ### Description Start the task. This method transitions the task to the running state to begin the measurement or generation. Using this method is required for some applications and is optional for others. If you do not use this method, a measurement task starts automatically when the DAQmx Read method runs. The autostart input of the DAQmx Write method determines if a generation task starts automatically when the DAQmx Write method runs. If you do not use the DAQmx Start Task method and the DAQmx Stop Task method when you use the DAQmx Read method or the DAQmx Write method multiple times, such as in a loop, the task starts and stops repeatedly. Starting and stopping a task repeatedly reduces the performance of the application. ``` -------------------------------- ### Start Trigger Configuration Source: https://github.com/ni/nidaqmx-python/blob/master/docs/task.md Configure the output terminal for the Start Trigger. ```APIDOC ## Property: start_trig_output_term ### Description Specifies the terminal to which to route the Start Trigger. ### Type str ``` -------------------------------- ### Timing.sync_pulse_min_delay_to_start Source: https://github.com/ni/nidaqmx-python/blob/master/docs/index.md Gets or sets the minimum delay from the sync pulse to the start trigger. ```APIDOC ## Timing.sync_pulse_min_delay_to_start ### Description Gets or sets the minimum delay from the sync pulse to the start trigger. ### Method (Getter/Setter) ### Endpoint (N/A for SDK methods) ### Parameters #### Path Parameters (N/A) #### Query Parameters (N/A) #### Request Body - **delay** (float) - Optional - The minimum delay in seconds. ### Request Example ```python task.timing.sync_pulse_min_delay_to_start = 0.00001 ``` ### Response #### Success Response (200) - **delay** (float) - The minimum delay in seconds. #### Response Example ```json { "delay": 0.00001 } ``` ``` -------------------------------- ### Configure Time-Based Start Trigger Source: https://github.com/ni/nidaqmx-python/blob/master/docs/task_triggering.md Configures the task to start acquiring or generating samples at a specified time. ```APIDOC ## cfg_time_start_trig(when, timescale=Timescale.USE_HOST) ### Description Configures the task to start acquiring or generating samples at a specified time. ### Parameters #### Path Parameters - **when** (datetime) - Required - Specifies when to trigger. - **timescale** (Timescale) - Optional - Specifies the start trigger timestamp time scale. Defaults to Timescale.USE_HOST. ``` -------------------------------- ### Disable Start Trigger Source: https://github.com/ni/nidaqmx-python/blob/master/docs/task_triggering.md Configures the task to start acquiring or generating samples immediately upon starting the task, effectively disabling any configured start triggers. ```APIDOC ## disable_start_trig() ### Description Configures the task to start acquiring or generating samples immediately upon starting the task. ``` -------------------------------- ### Configure Analog Window Start Trigger Source: https://github.com/ni/nidaqmx-python/blob/master/docs/task_triggering.md Configures the task to start acquiring or generating samples when an analog signal enters or leaves a specified range. ```APIDOC ## cfg_anlg_window_start_trig ### Description Configures the task to start acquiring or generating samples when an analog signal enters or leaves a range you specify. ### Method `cfg_anlg_window_start_trig(window_top, window_bottom, trigger_source='', trigger_when=WindowTriggerCondition1.ENTERING_WINDOW)` ### Parameters #### Parameters - **window_top** (float) - The upper limit of the window. Specify this value in the units of the measurement or generation. - **window_bottom** (float) - The lower limit of the window. Specify this value in the units of the measurement or generation. - **trigger_source** (str) - Optional - The name of a virtual channel or terminal with an analog signal to use as the source of the trigger. - **trigger_when** (nidaqmx.constants.WindowTriggerCondition1) - Optional - Specifies whether the task starts measuring or generating samples when the signal enters the window or when it leaves the window. Use window_bottom and window_top to specify the limits of the window. ``` -------------------------------- ### List Installed Packages Source: https://github.com/ni/nidaqmx-python/blob/master/docs/index.md Lists installed Python packages and their versions using pip. ```default $ python -m pip list ``` -------------------------------- ### ExportSignals.rdy_for_start_event_output_term Source: https://github.com/ni/nidaqmx-python/blob/master/docs/index.md Configures the output terminal for the Ready For Start event. ```APIDOC ## ExportSignals.rdy_for_start_event_output_term ### Description Configures the output terminal for the Ready For Start event. ### Method (Not specified in source, likely a property setter) ### Endpoint (Not applicable for SDK methods) ### Parameters (Parameters not specified in source) ### Request Example (Not applicable for SDK methods) ### Response (Response details not specified in source) ``` -------------------------------- ### StartTrigger Properties Source: https://github.com/ni/nidaqmx-python/blob/master/docs/task.md Configuration options for setting up a start trigger. ```APIDOC ## StartTrigger ### Properties - **anlg_edge_coupling**: Sets the coupling for analog edge triggers (AC, DC, or GND). - **anlg_edge_dig_fltr_enable**: Enables or disables digital filtering for analog edge triggers. - **anlg_edge_dig_fltr_min_pulse_width**: Sets the minimum pulse width for digital filtering on analog edge triggers. - **anlg_edge_dig_fltr_timebase_rate**: Sets the timebase rate for digital filtering on analog edge triggers. - **anlg_edge_dig_fltr_timebase_src**: Sets the timebase source for digital filtering on analog edge triggers. - **anlg_edge_dig_sync_enable**: Enables or disables synchronization for analog edge triggers. - **anlg_edge_hyst**: Sets the hysteresis for analog edge triggers. - **anlg_edge_lvl**: Sets the voltage level for analog edge triggers. - **anlg_edge_slope**: Sets the slope (rising or falling) for analog edge triggers. - **anlg_edge_src**: Sets the source terminal for analog edge triggers. - **anlg_multi_edge_couplings**: Sets the couplings for multiple analog edge triggers. ``` -------------------------------- ### Timing.samp_timing_engine Source: https://github.com/ni/nidaqmx-python/blob/master/docs/index.md Gets the sample timing engine. ```APIDOC ## Timing.samp_timing_engine ### Description Gets the sample timing engine. ### Method (Getter) ### Endpoint (N/A for SDK methods) ### Parameters (N/A) ### Request Example (N/A) ### Response #### Success Response (200) - **engine** (str) - The sample timing engine (e.g., "DAQmx_Val_MasterTimebase", "DAQmx_Val_SampClk"). #### Response Example ```json { "engine": "DAQmx_Val_SampClk" } ``` ``` -------------------------------- ### Configure Analog Multi-Edge Start Trigger Source: https://github.com/ni/nidaqmx-python/blob/master/docs/task_triggering.md Configures the task to start acquiring or generating samples when any of the configured analog signals cross their respective levels. This uses a logical OR for the configured triggers. ```APIDOC ## cfg_anlg_multi_edge_start_trig ### Description Configures the task to start acquiring or generating samples when any of the configured analog signals cross the respective levels you specified. Multi-edge triggering treats the configured triggers as if a logical OR is applied. ### Method `cfg_anlg_multi_edge_start_trig(trigger_sources, trigger_slope_array, trigger_level_array=None)` ### Parameters #### Parameters - **trigger_sources** (str) - The name of a virtual channel or terminal with an analog signal to use as the source of the trigger. - **trigger_slope_array** (List[nidaqmx.constants.Slope]) - Specifies on which slope of the signal to start acquiring or generating samples when the signal crosses level. - **trigger_level_array** (List[float]) - Optional - Specifies at what threshold to start acquiring or generating samples. Specify this value in the units of the measurement or generation. Use slope to specify on which slope to trigger at this threshold. ``` -------------------------------- ### Configure Digital Pattern Start Trigger Source: https://github.com/ni/nidaqmx-python/blob/master/docs/task_triggering.md Configures a task to start acquiring or generating samples when a specific digital pattern is matched on the specified physical channels. ```APIDOC ## cfg_dig_pattern_start_trig(trigger_source, trigger_pattern, trigger_when=DigitalPatternCondition.PATTERN_MATCHES) ### Description Configures a task to start acquiring or generating samples when a digital pattern is matched. ### Parameters #### Path Parameters - **trigger_source** (str) - Required - Specifies the physical channels to use for pattern matching. The order of the physical channels determines the order of the pattern. If a port is included, the order of the physical channels within the port is in ascending order. - **trigger_pattern** (str) - Required - Specifies the digital pattern that must be met for the trigger to occur. - **trigger_when** (DigitalPatternCondition) - Optional - Specifies the condition under which the trigger occurs. Defaults to DigitalPatternCondition.PATTERN_MATCHES. ``` -------------------------------- ### ExportSignals.start_trig_output_term Source: https://github.com/ni/nidaqmx-python/blob/master/docs/index.md Configures the output terminal for the Start Trigger. ```APIDOC ## ExportSignals.start_trig_output_term ### Description Configures the output terminal for the Start Trigger. ### Method (Not specified in source, likely a property setter) ### Endpoint (Not applicable for SDK methods) ### Parameters (Parameters not specified in source) ### Request Example (Not applicable for SDK methods) ### Response (Response details not specified in source) ``` -------------------------------- ### Timing.samp_quant_samp_mode Source: https://github.com/ni/nidaqmx-python/blob/master/docs/index.md Gets or sets the sample quantity mode. ```APIDOC ## Timing.samp_quant_samp_mode ### Description Gets or sets the sample quantity mode. ### Method (Getter/Setter) ### Endpoint (N/A for SDK methods) ### Parameters #### Path Parameters (N/A) #### Query Parameters (N/A) #### Request Body - **mode** (str) - Optional - The sample quantity mode (e.g., "DAQmx_Val_FiniteSamps", "DAQmx_Val_ContSamps"). ### Request Example ```python task.timing.samp_quant_samp_mode = "DAQmx_Val_FiniteSamps" ``` ### Response #### Success Response (200) - **mode** (str) - The sample quantity mode. #### Response Example ```json { "mode": "DAQmx_Val_FiniteSamps" } ``` ``` -------------------------------- ### start() Source: https://github.com/ni/nidaqmx-python/blob/master/docs/watchdog.md Transitions the task to the running state to begin measurement or generation. This method is required for some applications and optional for others. ```APIDOC ## start() ### Description Transitions the task to the running state to begin the measurement or generation. Using this method is required for some applications and is optional for others. ``` -------------------------------- ### Timing.hshk_start_cond Source: https://github.com/ni/nidaqmx-python/blob/master/docs/index.md Gets or sets the start condition for a handshake. ```APIDOC ## Timing.hshk_start_cond ### Description Gets or sets the start condition for a handshake. ### Method (Getter/Setter) ### Endpoint (N/A for SDK methods) ### Parameters #### Path Parameters (N/A) #### Query Parameters (N/A) #### Request Body - **condition** (str) - Optional - The start condition (e.g., "DAQmx_Val_HandshakeCondition_Start", "DAQmx_Val_HandshakeCondition_Wait"). ### Request Example ```python task.timing.hshk_start_cond = "DAQmx_Val_HandshakeCondition_Start" ``` ### Response #### Success Response (200) - **condition** (str) - The start condition. #### Response Example ```json { "condition": "DAQmx_Val_HandshakeCondition_Start" } ``` ``` -------------------------------- ### Timing.sync_pulse_time_when Source: https://github.com/ni/nidaqmx-python/blob/master/docs/index.md Gets or sets when the sync pulse occurs relative to the start trigger. ```APIDOC ## Timing.sync_pulse_time_when ### Description Gets or sets when the sync pulse occurs relative to the start trigger. ### Method (Getter/Setter) ### Endpoint (N/A for SDK methods) ### Parameters #### Path Parameters (N/A) #### Query Parameters (N/A) #### Request Body - **when** (str) - Optional - When the sync pulse occurs (e.g., "DAQmx_Val_When_Before_Data", "DAQmx_Val_When_After_Data"). ### Request Example ```python task.timing.sync_pulse_time_when = "DAQmx_Val_When_Before_Data" ``` ### Response #### Success Response (200) - **when** (str) - When the sync pulse occurs. #### Response Example ```json { "when": "DAQmx_Val_When_Before_Data" } ``` ``` -------------------------------- ### Timing.first_samp_clk_when Source: https://github.com/ni/nidaqmx-python/blob/master/docs/index.md Gets or sets when the first sample clock edge occurs relative to the start trigger. ```APIDOC ## Timing.first_samp_clk_when ### Description Gets or sets when the first sample clock edge occurs relative to the start trigger. ### Method (Getter/Setter) ### Endpoint (N/A for SDK methods) ### Parameters #### Path Parameters (N/A) #### Query Parameters (N/A) #### Request Body - **when** (str) - Optional - When the first sample clock edge occurs (e.g., "DAQmx_Val_When_Before_Data", "DAQmx_Val_When_After_Data"). ### Request Example ```python task.timing.first_samp_clk_when = "DAQmx_Val_When_After_Data" ``` ### Response #### Success Response (200) - **when** (str) - When the first sample clock edge occurs. #### Response Example ```json { "when": "DAQmx_Val_When_After_Data" } ``` ``` -------------------------------- ### Create a Basic NI-DAQmx Task Source: https://github.com/ni/nidaqmx-python/blob/master/docs/index.md Demonstrates the fundamental way to initialize and use a task in NI-DAQmx. Ensure the nidaqmx library is installed. ```python import nidaqmx with nidaqmx.Task() as task: pass ``` -------------------------------- ### Create a Task with nidaqmx Source: https://github.com/ni/nidaqmx-python/blob/master/README.rst Demonstrates the basic creation of a task object using the nidaqmx library. Tasks are fundamental for configuring and performing measurements. ```python >>> import nidaqmx >>> with nidaqmx.Task() as task: ... pass ``` -------------------------------- ### Handshake Start Condition Constants Source: https://github.com/ni/nidaqmx-python/blob/master/docs/constants.md Constants to specify the condition for starting a handshake. ```APIDOC ## HandshakeStartCondition Constants to specify the condition for starting a handshake. ### IMMEDIATE Device is waiting for space in the FIFO (for acquisition) or waiting for samples (for generation). ### WAIT_FOR_HANDSHAKE_TRIGGER_ASSERT Device is waiting for the Handshake Trigger to assert. ### WAIT_FOR_HANDSHAKE_TRIGGER_DEASSERT Device is waiting for the Handshake Trigger to deassert. ``` -------------------------------- ### ExportSignals.rdy_for_start_event_lvl_active_lvl Source: https://github.com/ni/nidaqmx-python/blob/master/docs/index.md Configures the active level for the Ready For Start event level. ```APIDOC ## ExportSignals.rdy_for_start_event_lvl_active_lvl ### Description Configures the active level for the Ready For Start event level. ### Method (Not specified in source, likely a property setter) ### Endpoint (Not applicable for SDK methods) ### Parameters (Parameters not specified in source) ### Request Example (Not applicable for SDK methods) ### Response (Response details not specified in source) ``` -------------------------------- ### StartTrigger Configuration Methods Source: https://github.com/ni/nidaqmx-python/blob/master/docs/task.md This section outlines the methods available for configuring specific types of start triggers. These methods provide convenient ways to set up common trigger configurations. ```APIDOC ## StartTrigger Configuration Methods This section details the methods available for configuring specific types of start triggers. These methods simplify the process of setting up analog edge, analog multi-edge, analog window, and digital edge triggers. ### Methods - **cfg_anlg_edge_start_trig()**: Configures an analog edge start trigger. - **cfg_anlg_multi_edge_start_trig()**: Configures an analog multi-edge start trigger. - **cfg_anlg_window_start_trig()**: Configures an analog window start trigger. - **cfg_dig_edge_start_trig()**: Configures a digital edge start trigger. ``` -------------------------------- ### Configure Digital Edge Start Trigger Source: https://github.com/ni/nidaqmx-python/blob/master/docs/task_triggering.md Configures the task to start acquiring or generating samples on a rising or falling edge of a digital signal. ```APIDOC ## cfg_dig_edge_start_trig ### Description Configures the task to start acquiring or generating samples on a rising or falling edge of a digital signal. ### Method `cfg_dig_edge_start_trig(trigger_source, trigger_edge=Edge.RISING)` ### Parameters #### Parameters - **trigger_source** (str) - Specifies the name of a terminal where there is a digital signal to use as the source of the trigger. - **trigger_edge** (nidaqmx.constants.Edge) - Optional - Specifies on which edge of the digital signal to start acquiring or generating samples. ``` -------------------------------- ### Sample Clock Timebase Configuration Source: https://github.com/ni/nidaqmx-python/blob/master/docs/task.md Configure the output terminal for the Sample Clock Timebase. ```APIDOC ## Property: samp_clk_timebase_output_term ### Description Specifies the terminal to which to route the Sample Clock Timebase. ### Type str ``` -------------------------------- ### Sample Clock Configuration Source: https://github.com/ni/nidaqmx-python/blob/master/docs/task.md Configure the delay offset, output behavior, output terminal, and polarity for the Sample Clock. ```APIDOC ## Property: samp_clk_delay_offset ### Description Specifies in seconds the amount of time to offset the exported Sample clock. Refer to timing diagrams for generation applications in the device documentation for more information about this value. ### Type float ## Property: samp_clk_output_behavior ### Description Specifies whether the exported Sample Clock issues a pulse at the beginning of a sample or changes to a high state for the duration of the sample. ### Type nidaqmx.constants.ExportAction ## Property: samp_clk_output_term ### Description Specifies the terminal to which to route the Sample Clock. ### Type str ## Property: samp_clk_pulse_polarity ### Description Specifies the polarity of the exported Sample Clock if **samp_clk_output_behavior** is **ExportActions3.PULSE**. ### Type nidaqmx.constants.Polarity ``` -------------------------------- ### StartTrigger Analog Edge Slope Source: https://github.com/ni/nidaqmx-python/blob/master/docs/task_triggering.md Specifies the slope (rising or falling) of the analog start trigger signal on which to start acquiring or generating samples. ```APIDOC ## StartTrigger.anlg_edge_slope ### Description Specifies on which slope of the trigger signal to start acquiring or generating samples. ### Type [nidaqmx.constants.Slope] ``` -------------------------------- ### StartTrigger Analog Edge Level Source: https://github.com/ni/nidaqmx-python/blob/master/docs/task_triggering.md Specifies the threshold in the units of the measurement or generation at which to start acquiring or generating samples for an analog start trigger. ```APIDOC ## StartTrigger.anlg_edge_lvl ### Description Specifies at what threshold in the units of the measurement or generation to start acquiring or generating samples. Use **anlg_edge_slope** to specify on which slope to trigger on this threshold. ### Type float ``` -------------------------------- ### Clone the Repository Source: https://github.com/ni/nidaqmx-python/blob/master/CONTRIBUTING.md Clone the nidaqmx project repository to your local machine. ```bash git clone https://github.com/ni/nidaqmx-python.git ``` -------------------------------- ### Initialize NI-DAQmx Task Source: https://github.com/ni/nidaqmx-python/blob/master/docs/task.md Creates a new NI-DAQmx task. If creating tasks within a loop, ensure to clear the task using DAQmx Clear Task to avoid name conflicts. ```python import nidaqmx task = nidaqmx.task.Task(new_task_name='MyTask') ``` -------------------------------- ### Run Benchmark Tests with Tox Source: https://github.com/ni/nidaqmx-python/blob/master/CONTRIBUTING.md Execute benchmark tests using tox, skipping gRPC variants and specifying a device. ```bash poetry run -- tox -e py310-base-benchmark -- --device Dev1 ``` -------------------------------- ### Configure Analog Edge Start Trigger Source: https://github.com/ni/nidaqmx-python/blob/master/docs/task_triggering.md Configures the task to start acquiring or generating samples when an analog signal crosses a specified level on a given slope. ```APIDOC ## cfg_anlg_edge_start_trig ### Description Configures the task to start acquiring or generating samples when an analog signal crosses the level you specify. ### Method `cfg_anlg_edge_start_trig(trigger_source='', trigger_slope=Slope.RISING, trigger_level=0.0)` ### Parameters #### Parameters - **trigger_source** (str) - Optional - The name of a virtual channel or terminal with an analog signal to use as the trigger source. - **trigger_slope** (nidaqmx.constants.Slope) - Optional - Specifies on which slope of the signal to start acquiring or generating samples when the signal crosses trigger_level. - **trigger_level** (float) - Optional - Specifies the threshold at which to start acquiring or generating samples. Specify this value in the units of the measurement or generation. Use trigger_slope to specify on which slope to trigger at this threshold. ``` -------------------------------- ### Run Benchmark Tests Source: https://github.com/ni/nidaqmx-python/blob/master/CONTRIBUTING.md Execute benchmark tests, optionally comparing results or specifying a device. ```bash # Run the benchmarks # Compare benchmark before/after a change # see https://pytest-benchmark.readthedocs.io/en/latest/comparing.html # Run 1: --benchmark-save=some-name # Run N: --benchmark-compare=0001 $ poetry run pytest -v tests/benchmark --device Dev1 ``` -------------------------------- ### name Source: https://github.com/ni/nidaqmx-python/blob/master/docs/watchdog.md Gets the name of the task. ```APIDOC ## name ### Description Indicates the name of the task. ### Type str ``` -------------------------------- ### System Methods Source: https://github.com/ni/nidaqmx-python/blob/master/docs/index.md Methods for interacting with the DAQmx system configuration. ```APIDOC ## System.DriverVersion ### Description Gets the version of the DAQmx driver installed on the system. ### Method Not specified (assumed to be a Python property) ### Parameters None ### Request Example ```python driver_version = system.DriverVersion print(f"DAQmx Driver Version: {driver_version}") ``` ### Response - `str`: The version string of the DAQmx driver. ``` ```APIDOC ## System.add_cdaq_sync_connection() ### Description Configures a synchronization connection between CompactDAQ chassis. ### Method Not specified (assumed to be a Python method call) ### Parameters - `source_device` (str): The name of the source device. - `destination_device` (str): The name of the destination device. - `timeout` (float): Time in seconds to wait for the connection to be established. ### Request Example ```python system.add_cdaq_sync_connection(source_device='cDAQ1', destination_device='cDAQ2', timeout=10.0) ``` ### Response None ``` ```APIDOC ## System.are_configured_cdaq_sync_ports_disconnected() ### Description Checks if any configured synchronization ports between CompactDAQ chassis are disconnected. ### Method Not specified (assumed to be a Python method call) ### Parameters None ### Request Example ```python is_disconnected = system.are_configured_cdaq_sync_ports_disconnected() if is_disconnected: print("Warning: Some cDAQ sync ports are disconnected.") ``` ### Response - `bool`: True if any sync ports are disconnected, False otherwise. ``` -------------------------------- ### Triggers Class Source: https://github.com/ni/nidaqmx-python/blob/master/docs/task_triggering.md The Triggers class provides access to different trigger configurations for a DAQmx task, including arm start, handshake, pause, reference, and start triggers. It also allows configuration of the device's role in a synchronized system. ```APIDOC ## class nidaqmx.task.triggering.Triggers Represents the trigger configurations for a DAQmx task. ### Properties - **arm_start_trigger**: Gets the arm start trigger configurations for the task. - **handshake_trigger**: Gets the handshake trigger configurations for the task. - **pause_trigger**: Gets the pause trigger configurations for the task. - **reference_trigger**: Gets the reference trigger configurations for the task. - **start_trigger**: Gets the start trigger configurations for the task. - **sync_type**: Specifies the role of the device in a synchronized system. Setting this value to SyncType.MASTER or SyncType.SLAVE enables trigger skew correction. If you enable trigger skew correction, set this property to SyncType.MASTER on only one device, and set this property to SyncType.SLAVE on the other devices. - **Type:** [`nidaqmx.constants.SyncType`](constants.md#nidaqmx.constants.SyncType) ``` -------------------------------- ### Acquire Finite Data and Log to TDMS File Source: https://github.com/ni/nidaqmx-python/blob/master/README.rst Demonstrates acquiring a finite number of samples and simultaneously logging the data to a TDMS file using NI-DAQmx's built-in logging capabilities. Requires the 'npTDMS' module for reading the file. ```python >>> import nidaqmx >>> from nidaqmx.constants import AcquisitionType, LoggingMode, LoggingOperation, READ_ALL_AVAILABLE >>> with nidaqmx.Task() as task: ... task.ai_channels.add_ai_voltage_chan("Dev1/ai0") ... task.timing.cfg_samp_clk_timing(1000.0, sample_mode=AcquisitionType.FINITE, samps_per_chan=10) ... task.in_stream.configure_logging("TestData.tdms", LoggingMode.LOG_AND_READ, operation=LoggingOperation.CREATE_OR_REPLACE) ... data = task.read(READ_ALL_AVAILABLE) ... print("Acquired data: [" + ", ".join(f"{value:f}" for value in data) + "]") ... AIChannel(name=Dev1/ai0) Acquired data: [-0.149693, 2.869503, 4.520249, 4.704886, 2.875912, -0.006104, -2.895596, -4.493698, -4.515671, -2.776574] ``` -------------------------------- ### Task Class Initialization Source: https://github.com/ni/nidaqmx-python/blob/master/docs/task.md Initializes a new DAQmx task with an optional name and gRPC session options. ```APIDOC ## Task Class ### Description Represents a DAQmx Task. ### Method `__init__(new_task_name='', grpc_options=None)` ### Parameters * **new_task_name** (Optional[str]) - Specifies the name to assign to the task. If used in a loop, ensure `DAQmx Clear Task` is called to avoid errors. * **grpc_options** (Optional[GrpcSessionOptions]) - Specifies the gRPC session options. ``` -------------------------------- ### ExportSignals.start_trig_pulse_polarity Source: https://github.com/ni/nidaqmx-python/blob/master/docs/index.md Configures the pulse polarity for the Start Trigger. ```APIDOC ## ExportSignals.start_trig_pulse_polarity ### Description Configures the pulse polarity for the Start Trigger. ### Method (Not specified in source, likely a property setter) ### Endpoint (Not applicable for SDK methods) ### Parameters (Parameters not specified in source) ### Request Example (Not applicable for SDK methods) ### Response (Response details not specified in source) ``` -------------------------------- ### Lint Code with Style Guide Source: https://github.com/ni/nidaqmx-python/blob/master/CONTRIBUTING.md Check the updated code against NI's Python coding conventions. ```bash poetry run ni-python-styleguide lint ``` -------------------------------- ### sync_pulse_time_when Source: https://github.com/ni/nidaqmx-python/blob/master/docs/task.md Specifies the start time for the synchronization pulse. ```APIDOC ## *property* sync_pulse_time_when ### Description Specifies the start time of the sync pulse. ### Type datetime ``` -------------------------------- ### Read Samples from Task Source: https://github.com/ni/nidaqmx-python/blob/master/docs/task.md Reads samples from a voltage channel task. This example demonstrates reading multiple samples, resulting in a list of floats. ```python >>> task = Task() >>> task.ai_channels.add_ai_voltage_chan('Dev1/ai0:3') >>> data = task.read() >>> type(data) >>> type(data[0]) ``` -------------------------------- ### Timing.sync_pulse_term Source: https://github.com/ni/nidaqmx-python/blob/master/docs/index.md Gets or sets the terminal for the sync pulse. ```APIDOC ## Timing.sync_pulse_term ### Description Gets or sets the terminal for the sync pulse. ### Method (Getter/Setter) ### Endpoint (N/A for SDK methods) ### Parameters #### Path Parameters (N/A) #### Query Parameters (N/A) #### Request Body - **terminal** (str) - Optional - The terminal for the sync pulse (e.g., "/Dev1/PFI0"). ### Request Example ```python task.timing.sync_pulse_term = "/Dev1/PFI0" ``` ### Response #### Success Response (200) - **terminal** (str) - The terminal for the sync pulse. #### Response Example ```json { "terminal": "/Dev1/PFI0" } ``` ``` -------------------------------- ### Timing.sync_pulse_src Source: https://github.com/ni/nidaqmx-python/blob/master/docs/index.md Gets or sets the source of the sync pulse. ```APIDOC ## Timing.sync_pulse_src ### Description Gets or sets the source of the sync pulse. ### Method (Getter/Setter) ### Endpoint (N/A for SDK methods) ### Parameters #### Path Parameters (N/A) #### Query Parameters (N/A) #### Request Body - **source** (str) - Optional - The source of the sync pulse (e.g., "OnboardClock", "External"). ### Request Example ```python task.timing.sync_pulse_src = "External" ``` ### Response #### Success Response (200) - **source** (str) - The source of the sync pulse. #### Response Example ```json { "source": "External" } ``` ``` -------------------------------- ### Timing.sync_clk_interval Source: https://github.com/ni/nidaqmx-python/blob/master/docs/index.md Gets or sets the interval of the sync clock. ```APIDOC ## Timing.sync_clk_interval ### Description Gets or sets the interval of the sync clock. ### Method (Getter/Setter) ### Endpoint (N/A for SDK methods) ### Parameters #### Path Parameters (N/A) #### Query Parameters (N/A) #### Request Body - **interval** (float) - Optional - The sync clock interval in seconds. ### Request Example ```python task.timing.sync_clk_interval = 0.001 ``` ### Response #### Success Response (200) - **interval** (float) - The sync clock interval in seconds. #### Response Example ```json { "interval": 0.001 } ``` ``` -------------------------------- ### Add Multiple Analog Input Channels and Read Data Source: https://github.com/ni/nidaqmx-python/blob/master/README.rst Illustrates adding multiple analog input voltage channels to a task with different ranges and reading data from all configured channels. Verify 'Dev1/ai0' and 'Dev1/ai1' exist. ```python >>> import nidaqmx >>> with nidaqmx.Task() as task: ... task.ai_channels.add_ai_voltage_chan("Dev1/ai0", min_val=-5.0, max_val=5.0) ... task.ai_channels.add_ai_voltage_chan("Dev1/ai1", min_val=-10.0, max_val=10.0) ... task.read() ... AIChannel(name=Dev1/ai0) AIChannel(name=Dev1/ai1) [-0.07477034821619312, 0.8642841883602405] ```