navigate Logo

Getting Started

  • Quick Start Guide
  • Software Installation
  • I Want To…

User Guide

  • Supported Hardware
  • Supported File Formats
  • User Interface Walkthrough
  • Setting Up A Microscope
  • Acquiring Data
  • Case Studies

Development

  • Contributing Guidelines
  • Developer Install
  • Software Architecture
  • Feature Container
  • REST-API
  • Plugin Architecture

Troubleshooting & Known Issues

  • Troubleshooting
  • Known Issues

Plugins

  • navigate Plugin Template
  • navigate Confocal Projection
  • navigate at Scale
  • navigate Constant Velocity Acquisition
  • navigate MMCore
  • navigate ilastik Server
  • navigate Photoactivation

Reference

  • Implemented Microscopes
  • Software API
    • navigate.config
    • navigate.controller
    • navigate.log_files
    • navigate.model
      • navigate.model.analysis
      • navigate.model.concurrency
      • navigate.model.data_sources
      • navigate.model.device_startup_functions
      • navigate.model.devices
        • navigate.model.devices.camera
        • navigate.model.devices.daq
        • navigate.model.devices.device_types
        • navigate.model.devices.filter_wheel
        • navigate.model.devices.galvo
        • navigate.model.devices.laser
        • navigate.model.devices.mirror
        • navigate.model.devices.objectives
        • navigate.model.devices.remote_focus
        • navigate.model.devices.shutter
        • navigate.model.devices.stage
        • navigate.model.devices.zoom
      • navigate.model.features
      • navigate.model.metadata_sources
      • navigate.model.microscope
      • navigate.model.model
      • navigate.model.plugins_model
      • navigate.model.waveforms
    • navigate.tools
    • navigate.view
navigate
  • Software API
  • navigate.model
  • navigate.model.devices
  • navigate.model.devices.daq
  • navigate.model.devices.daq.ni
  • navigate.model.devices.daq.ni.NIDAQ
  • View page source

navigate.model.devices.daq.ni.NIDAQ

class navigate.model.devices.daq.ni.NIDAQ(configuration: Dict[str, Any])

Bases: DAQBase

NIDAQ class for Control of NI Data Acquisition Cards.

__init__(configuration: Dict[str, Any]) → None

Initialize NIDAQ class.

Parameters:

configuration (Dict[str, Any]) – Configuration dictionary.

Methods

__init__(configuration)

Initialize NIDAQ class.

calculate_all_waveforms(microscope_name, ...)

Pre-calculates all waveforms necessary for the acquisition and organizes in a dictionary format.

create_analog_output_tasks(channel_key)

Create analog output tasks for each board.

create_camera_task(channel_key)

Set up the camera trigger task.

create_master_trigger_task()

Set up the DO master trigger task.

enable_microscope(microscope_name)

Enable microscope.

prepare_acquisition(channel_key)

Prepare the acquisition.

restart_analog_task_callback_func(task)

Restart analog task callback function.

run_acquisition()

Run DAQ Acquisition.

set_external_trigger([external_trigger])

Set trigger mode.

stop_acquisition()

Stop Acquisition.

update_analog_task(board_name)

Update analog task.

wait_for_external_trigger(trigger_channel[, ...])

Wait for a digital external trigger.

Attributes

configuration

Configuration dictionary.

camera_trigger_task

NI DAQmx task for camera trigger

master_trigger_task

NI DAQmx task for master trigger

laser_switching_task

NI DAQmx task for laser switching

trigger_mode

Trigger mode.

external_trigger

NI DAQmx port for laser switching

analog_outputs

Analog outputs.

analog_output_tasks

NI DAQmx tasks for analog output.

n_sample

Number of samples.

current_channel_key

Current channel key.

is_updating_analog_task

Flag for updating analog task.

wait_to_run_lock

Flag for waiting to run.

calculate_all_waveforms(microscope_name, exposure_times, sweep_times)

Pre-calculates all waveforms necessary for the acquisition and organizes in a dictionary format.

Parameters:
  • microscope_name (str) – Name of the active microscope

  • exposure_times (dict) – Dictionary of exposure times for each selected channel

  • sweep_times (dict) – Dictionary of sweep times for each selected channel

Returns:

self.waveform_dict – Dictionary of waveforms to pass to galvo and ETL, plus a camera waveform for display purposes.

Return type:

dict

create_analog_output_tasks(channel_key: str) → None

Create analog output tasks for each board.

Create a single analog output task for all channels per board. Most NI DAQ cards have only one clock for analog output sample timing, and as such all channels must be grouped here.

Parameters:

channel_key (str) – Channel key for analog output.

create_camera_task(channel_key: str) → None

Set up the camera trigger task.

TTL for triggering the camera. TTL is 4 ms in duration. Channel that the TTL is delivered from, and its delay (typically ~10 ms), are specified in the configuration.yaml file.

Parameters:

channel_key (str) – Channel key for current channel.

create_master_trigger_task() → None

Set up the DO master trigger task.

enable_microscope(microscope_name: str) → None

Enable microscope.

Parameters:

microscope_name (str) – Name of microscope to enable.

prepare_acquisition(channel_key: str) → None

Prepare the acquisition.

Creates and configures the DAQ tasks. Writes the waveforms to each task.

Parameters:

channel_key (str) – Channel key for current channel.

static restart_analog_task_callback_func(task: Task) → callable

Restart analog task callback function.

Parameters:

task (nidaqmx.Task) – Analog output task.

Returns:

callback_func – Callback function

Return type:

function

run_acquisition() → None

Run DAQ Acquisition.

Run the tasks for triggering, analog and counter outputs. The master trigger initiates all other tasks via a shared trigger For this to work, all analog output and counter tasks have to be started so that they are waiting for the trigger signal.

set_external_trigger(external_trigger=None) → None

Set trigger mode.

Parameters:

external_trigger (nidaqmx.Task) – Task for external triggering

stop_acquisition() → None

Stop Acquisition.

Stop all tasks and close them.

update_analog_task(board_name: str) → Optional[bool]

Update analog task.

Parameters:

board_name (str) – Name of board to update.

Returns:

True if task is updated, False otherwise.

Return type:

bool, None

static wait_for_external_trigger(trigger_channel: str, wait_internal=0.001, timeout=-1) → bool

Wait for a digital external trigger.

Parameters:
  • trigger_channel (str) – The name of the DAQ PFI digital input.

  • wait_internal (float) – The internal waiting time to check the trigger

  • timeout (float) – Continue on anyway if timeout is reached. timeout < 0 will run forever.

Returns:

result – True for the trigger, False for no trigger.

Return type:

bool

analog_output_tasks

NI DAQmx tasks for analog output.

Type:

dict

analog_outputs

Analog outputs.

Type:

dict

camera_delay

Camera delay percentage

Type:

float

camera_trigger_task

NI DAQmx task for camera trigger

Type:

obj

configuration

Configuration dictionary.

Type:

dict

current_channel_key

Current channel key.

Type:

str

daq_parameters

Dictionary of DAQ parameters

Type:

dict

exposure_times

exposure times for different channels

Type:

dict

external_trigger

NI DAQmx port for laser switching

Type:

str

is_updating_analog_task

Flag for updating analog task.

Type:

bool

laser_switching_task

NI DAQmx task for laser switching

Type:

obj

master_trigger_task

NI DAQmx task for master trigger

Type:

obj

microscope_name

Name of the active microscope

Type:

str

n_sample

Number of samples.

Type:

float

sample_rate

Sample rate of the DAQ

Type:

float

sweep_times

Sweep times for different channels

Type:

dict

trigger_mode

Trigger mode. Self-trigger or external-trigger.

Type:

str

wait_to_run_lock

Flag for waiting to run.

Type:

bool

waveform_constants

Dictionary of waveform constants

Type:

dict

waveform_dict

Dictionary of waveforms.

Type:

dict

waveform_expand_num

Number of times to expand the waveform

Type:

int

waveform_repeat_num

Number of times to repeat the waveform

Type:

int

Previous Next

© Copyright 2025, Dean Lab, UT Southwestern Medical Center.