nidaqmx.task.timing

class nidaqmx._task_modules.timing.Timing(task_handle, interpreter)[source]

Bases: object

Represents the timing configurations for a DAQmx task.

property ai_conv_active_edge

Specifies on which edge of the clock pulse an analog-to-digital conversion takes place.

Type

nidaqmx.constants.Edge

property ai_conv_dig_fltr_enable

Specifies whether to apply a digital filter to the AI Convert Clock.

Type

bool

property ai_conv_dig_fltr_min_pulse_width

Specifies in seconds the minimum pulse width the filter recognizes.

Type

float

property ai_conv_dig_fltr_timebase_rate

Specifies in hertz the rate of the digital filter timebase. NI-DAQmx uses this value to compute settings for the filter.

Type

float

property ai_conv_dig_fltr_timebase_src

Specifies the terminal of the signal to use as the timebase of the digital filter.

Type

str

property ai_conv_dig_sync_enable

Specifies whether to synchronize recognition of transitions in the signal to the internal timebase of the device.

Type

bool

property ai_conv_max_rate

Indicates the maximum convert rate supported by the task, given the current devices and channel count.

Type

float

property ai_conv_rate

Specifies in Hertz the rate at which to clock the analog- to-digital converter. This clock is specific to the analog input section of multiplexed devices.

Type

float

property ai_conv_src

Specifies the terminal of the signal to use as the AI Convert Clock.

Type

str

property ai_conv_timebase_div

Specifies the number of AI Convert Clock Timebase pulses needed to produce a single AI Convert Clock pulse.

Type

int

property ai_conv_timebase_src

Specifies the terminal of the signal to use as the AI Convert Clock Timebase.

Type

nidaqmx.constants.MIOAIConvertTimebaseSource

cfg_burst_handshaking_timing_export_clock(sample_clk_rate, sample_clk_outp_term, sample_mode=AcquisitionType.FINITE, samps_per_chan=1000, sample_clk_pulse_polarity=Polarity.ACTIVE_HIGH, pause_when=Level.HIGH, ready_event_active_level=Polarity.ACTIVE_HIGH)[source]

Configures when the DAQ device transfers data to a peripheral device, using the onboard Sample Clock of the DAQ device to control burst handshake timing and exporting that clock for use by the peripheral device.

Parameters
  • sample_clk_rate (float) – Specifies in hertz the rate of the Sample Clock.

  • sample_clk_outp_term (str) – Specifies the terminal to which to export the Sample Clock.

  • sample_mode (Optional[nidaqmx.constants.AcquisitionType]) – Specifies if the task acquires or generates samples continuously or if it acquires or generates a finite number of samples.

  • samps_per_chan (Optional[int]) – Specifies the number of samples to acquire or generate for each channel in the task if sample_mode is FINITE_SAMPLES. If sample_mode is CONTINUOUS_SAMPLES, NI-DAQmx uses this value to determine the buffer size. This function returns an error if the specified value is negative.

  • sample_clk_pulse_polarity (Optional[nidaqmx.constants.Polarity]) – Specifies the polarity of the exported Sample Clock.

  • pause_when (Optional[nidaqmx.constants.Level]) – Specifies whether the task pauses while the trigger signal is high or low.

  • ready_event_active_level (Optional[nidaqmx.constants.Polarity]) – Specifies the polarity of the Ready for Transfer Event.

cfg_burst_handshaking_timing_import_clock(sample_clk_rate, sample_clk_src, sample_mode=AcquisitionType.FINITE, samps_per_chan=1000, sample_clk_active_edge=Edge.RISING, pause_when=Level.HIGH, ready_event_active_level=Polarity.ACTIVE_HIGH)[source]

Configures when the DAQ device transfers data to a peripheral device, using an imported sample clock to control burst handshake timing.

Parameters
  • sample_clk_rate (float) – Specifies in hertz the rate of the Sample Clock.

  • sample_clk_src (str) – Specifies the source terminal of the Sample Clock. Leave this input unspecified to use the default onboard clock of the device.

  • sample_mode (Optional[nidaqmx.constants.AcquisitionType]) – Specifies if the task acquires or generates samples continuously or if it acquires or generates a finite number of samples.

  • samps_per_chan (Optional[int]) – Specifies the number of samples to acquire or generate for each channel in the task if sample_mode is FINITE_SAMPLES. If sample_mode is CONTINUOUS_SAMPLES, NI-DAQmx uses this value to determine the buffer size. This function returns an error if the specified value is negative.

  • sample_clk_active_edge (Optional[nidaqmx.constants.Edge]) – Specifies on which edges of Sample Clock pulses to acquire or generate samples.

  • pause_when (Optional[nidaqmx.constants.Level]) – Specifies whether the task pauses while the trigger signal is high or low.

  • ready_event_active_level (Optional[nidaqmx.constants.Polarity]) – Specifies the polarity of the Ready for Transfer Event.

cfg_change_detection_timing(rising_edge_chan='', falling_edge_chan='', sample_mode=AcquisitionType.FINITE, samps_per_chan=1000)[source]

Configures the task to acquire samples on the rising and/or falling edges of the lines or ports you specify. To detect both rising and falling edges on a line or port, specify the name of that line or port to both rising_edge_chan and falling_edge_chan.

Parameters
  • rising_edge_chan (Optional[str]) – Specifies the names of the digital lines or ports on which to detect rising edges. The DAQmx physical channel constant lists all lines and ports for devices installed in your system.

  • falling_edge_chan (Optional[str]) – Specifies the names of the digital lines or ports on which to detect falling edges. The DAQmx physical channel constant lists all lines and ports for devices installed in your system.

  • sample_mode (Optional[nidaqmx.constants.AcquisitionType]) – Specifies if the task acquires samples continuously or if it acquires a finite number of samples.

  • samps_per_chan (Optional[int]) – Specifies the number of samples to acquire from each channel in the task if sample_mode is FINITE_SAMPLES. This function returns an error if the specified value is negative.

cfg_handshaking_timing(sample_mode=AcquisitionType.FINITE, samps_per_chan=1000)[source]

Determines the number of digital samples to acquire or generate using digital handshaking between the device and a peripheral device.

Parameters
  • sample_mode (Optional[nidaqmx.constants.AcquisitionType]) – Specifies if the task acquires or generates samples continuously or if it acquires or generates a finite number of samples.

  • samps_per_chan (Optional[int]) – Specifies the number of samples to acquire or generate for each channel in the task if sample_mode is FINITE_SAMPLES. If sample_mode is CONTINUOUS_SAMPLES, NI-DAQmx uses this value to determine the buffer size. This function returns an error if the specified value is negative.

cfg_implicit_timing(sample_mode=AcquisitionType.FINITE, samps_per_chan=1000)[source]

Sets only the number of samples to acquire or generate without specifying timing. Typically, you should use this instance when the task does not require sample timing, such as tasks that use counters for buffered frequency measurement, buffered period measurement, or pulse train generation. For finite counter output tasks, samps_per_chan is the number of pulses to generate.

Parameters
  • sample_mode (Optional[nidaqmx.constants.AcquisitionType]) – Specifies if the task acquires or generates samples continuously or if it acquires or generates a finite number of samples.

  • samps_per_chan (Optional[int]) – Specifies the number of samples to acquire or generate for each channel in the task if sample_mode is FINITE_SAMPLES. If sample_mode is CONTINUOUS_SAMPLES, NI-DAQmx uses this value to determine the buffer size. This function returns an error if the specified value is negative.

cfg_pipelined_samp_clk_timing(rate, source='', active_edge=Edge.RISING, sample_mode=AcquisitionType.FINITE, samps_per_chan=1000)[source]

Sets the source of the Sample Clock, the rate of the Sample Clock, and the number of samples to acquire or generate. The device acquires or generates samples on each Sample Clock edge, but it does not respond to certain triggers until a few Sample Clock edges later. Pipelining allows higher data transfer rates at the cost of increased trigger response latency. Refer to the device documentation for information about which triggers pipelining affects. This timing type allows handshaking using the Pause trigger and either the Ready for Transfer event or the Data Active event. Refer to the device documentation for more information. This timing type is supported only by the NI 6536 and NI 6537.

Parameters
  • rate (float) – Specifies the sampling rate in samples per channel per second. If you use an external source for the Sample Clock, set this input to the maximum expected rate of that clock.

  • source (Optional[str]) – Specifies the source terminal of the Sample Clock. Leave this input unspecified to use the default onboard clock of the device.

  • active_edge (Optional[nidaqmx.constants.Edge]) – Specifies on which edges of Sample Clock pulses to acquire or generate samples.

  • sample_mode (Optional[nidaqmx.constants.AcquisitionType]) – Specifies if the task acquires or generates samples continuously or if it acquires or generates a finite number of samples.

  • samps_per_chan (Optional[int]) – Specifies the number of samples to acquire or generate for each channel in the task if sample_mode is FINITE_SAMPLES. If sample_mode is CONTINUOUS_SAMPLES, NI-DAQmx uses this value to determine the buffer size. This function returns an error if the specified value is negative.

cfg_samp_clk_timing(rate, source='', active_edge=Edge.RISING, sample_mode=AcquisitionType.FINITE, samps_per_chan=1000)[source]

Sets the source of the Sample Clock, the rate of the Sample Clock, and the number of samples to acquire or generate.

Parameters
  • rate (float) – Specifies the sampling rate in samples per channel per second. If you use an external source for the Sample Clock, set this input to the maximum expected rate of that clock.

  • source (Optional[str]) – Specifies the source terminal of the Sample Clock. Leave this input unspecified to use the default onboard clock of the device.

  • active_edge (Optional[nidaqmx.constants.Edge]) – Specifies on which edges of Sample Clock pulses to acquire or generate samples.

  • sample_mode (Optional[nidaqmx.constants.AcquisitionType]) – Specifies if the task acquires or generates samples continuously or if it acquires or generates a finite number of samples.

  • samps_per_chan (Optional[int]) – Specifies the number of samples to acquire or generate for each channel in the task if sample_mode is FINITE_SAMPLES. If sample_mode is CONTINUOUS_SAMPLES, NI-DAQmx uses this value to determine the buffer size. This function returns an error if the specified value is negative.

property change_detect_di_falling_edge_physical_chans

nidaqmx.system.physical_channel.PhysicalChannel: Specifies the names of the digital lines or ports on which to detect falling edges. The lines or ports must be used by virtual channels in the task. You also can specify a string that contains a list or range of digital lines or ports.

property change_detect_di_rising_edge_physical_chans

nidaqmx.system.physical_channel.PhysicalChannel: Specifies the names of the digital lines or ports on which to detect rising edges. The lines or ports must be used by virtual channels in the task. You also can specify a string that contains a list or range of digital lines or ports.

property change_detect_di_tristate

Specifies whether to tristate lines specified with change_detect_di_rising_edge_physical_chans and change_detect_di_falling_edge_physical_chans that are not in a virtual channel in the task. If you set this property to True, NI-DAQmx tristates rising/falling edge lines that are not in a virtual channel in the task. If you set this property to False, NI-DAQmx does not modify the configuration of rising/falling edge lines that are not in a virtual channel in the task, even if the lines were previously tristated. Set this property to False to detect changes on lines in other tasks or to detect changes on output-only lines.

Type

bool

property delay_from_samp_clk_delay

Specifies the amount of time to wait after receiving a Sample Clock edge before beginning to acquire the sample. This value is in the units you specify with delay_from_samp_clk_delay_units.

Type

float

property delay_from_samp_clk_delay_units

Specifies the units of delay_from_samp_clk_delay.

Type

nidaqmx.constants.DigitalWidthUnits

property first_samp_timestamp_enable

Specifies whether to enable the first sample timestamp.

Type

bool

property first_samp_timestamp_timescale

Specifies the timescale to be used for the first sample timestamp.

Type

nidaqmx.constants.Timescale

property hshk_delay_after_xfer

Specifies the number of seconds to wait after a handshake cycle before starting a new handshake cycle.

Type

float

property hshk_sample_input_data_when

Specifies on which edge of the Handshake Trigger an input task latches the data from the peripheral device.

Type

nidaqmx.constants.SampleInputDataWhen

property hshk_start_cond

Specifies the point in the handshake cycle that the device is in when the task starts.

Type

nidaqmx.constants.HandshakeStartCondition

property implicit_underflow_behavior

Specifies the action to take when the onboard memory of the device becomes empty.

Type

nidaqmx.constants.UnderflowBehavior

property master_timebase_rate

Specifies the rate of the Master Timebase.

Type

float

property master_timebase_src

Specifies the terminal of the signal to use as the Master Timebase. On an E Series device, you can choose only between the onboard 20MHz Timebase or the RTSI7 terminal.

Type

str

property ref_clk_rate

Specifies the frequency of the Reference Clock.

Type

float

property ref_clk_src

Specifies the terminal of the signal to use as the Reference Clock.

Type

str

property samp_clk_active_edge

Specifies on which edge of a clock pulse sampling takes place. This property is useful primarily when the signal you use as the Sample Clock is not a periodic clock.

Type

nidaqmx.constants.Edge

property samp_clk_dig_fltr_enable

Specifies whether to apply the pulse width filter to the signal.

Type

bool

property samp_clk_dig_fltr_min_pulse_width

Specifies in seconds the minimum pulse width the filter recognizes.

Type

float

property samp_clk_dig_fltr_timebase_rate

Specifies in hertz the rate of the pulse width filter timebase. NI-DAQmx uses this value to compute settings for the filter.

Type

float

property samp_clk_dig_fltr_timebase_src

Specifies the input terminal of the signal to use as the timebase of the pulse width filter.

Type

str

property samp_clk_dig_sync_enable

Specifies whether to synchronize recognition of transitions in the signal to the internal timebase of the device.

Type

bool

property samp_clk_max_rate

Indicates the maximum Sample Clock rate supported by the task, based on other timing settings. For output tasks, the maximum Sample Clock rate is the maximum rate of the DAC. For input tasks, NI-DAQmx calculates the maximum sampling rate differently for multiplexed devices than simultaneous sampling devices.

Type

float

property samp_clk_overrun_behavior

Specifies the action to take if Sample Clock edges occur faster than the device can handle them.

Type

nidaqmx.constants.OverflowBehavior

property samp_clk_rate

Specifies the sampling rate in samples per channel per second. If you use an external source for the Sample Clock, set this input to the maximum expected rate of that clock.

Type

float

property samp_clk_src

Specifies the terminal of the signal to use as the Sample Clock.

Type

str

property samp_clk_term

Indicates the name of the internal Sample Clock terminal for the task. This property does not return the name of the Sample Clock source terminal specified with samp_clk_src.

Type

str

property samp_clk_timebase_active_edge

Specifies on which edge to recognize a Sample Clock Timebase pulse. This property is useful primarily when the signal you use as the Sample Clock Timebase is not a periodic clock.

Type

nidaqmx.constants.Edge

property samp_clk_timebase_div

Specifies the number of Sample Clock Timebase pulses needed to produce a single Sample Clock pulse.

Type

int

property samp_clk_timebase_master_timebase_div

Specifies the number of pulses of the Master Timebase needed to produce a single pulse of the Sample Clock Timebase.

Type

int

property samp_clk_timebase_rate

Specifies the rate of the Sample Clock Timebase. Some applications require that you specify a rate when you use any signal other than the onboard Sample Clock Timebase. NI- DAQmx requires this rate to calculate other timing parameters.

Type

float

property samp_clk_timebase_src

Specifies the terminal of the signal to use as the Sample Clock Timebase.

Type

str

property samp_clk_timebase_term

Indicates the name of the internal Sample Clock Timebase terminal for the task. This property does not return the name of the Sample Clock Timebase source terminal specified with samp_clk_timebase_src.

Type

str

property samp_clk_underflow_behavior

Specifies the action to take when the onboard memory of the device becomes empty. In either case, the sample clock does not stop.

Type

nidaqmx.constants.UnderflowBehavior

property samp_clk_write_wfm_use_initial_wfm_dt

Specifies that the value of samp_clk_rate will be determined by the dt component of the initial DAQmx Write waveform input for Output tasks.

Type

bool

property samp_quant_samp_mode

Specifies if a task acquires or generates a finite number of samples or if it continuously acquires or generates samples.

Type

nidaqmx.constants.AcquisitionType

property samp_quant_samp_per_chan

Specifies the number of samples to acquire or generate for each channel if samp_quant_samp_mode is AcquisitionType.FINITE. If samp_quant_samp_mode is AcquisitionType.CONTINUOUS, NI-DAQmx uses this value to determine the buffer size.

Type

int

property samp_timing_engine

Specifies which timing engine to use for the task.

Type

int

property samp_timing_type

Specifies the type of sample timing to use for the task.

Type

nidaqmx.constants.SampleTimingType

property simultaneous_ao_enable

Specifies whether to update all channels in the task simultaneously, rather than updating channels independently when you write a sample to that channel.

Type

bool

property sync_clk_interval

Specifies the interval, in Sample Clock periods, between each internal Synchronization Clock pulse. NI-DAQmx uses this pulse for synchronization of triggers between multiple devices at different rates. Refer to device documentation for information about how to calculate this value.

Type

int

property sync_pulse_min_delay_to_start

Specifies in seconds the amount of time that elapses after the master device issues the synchronization pulse before the task starts.

Type

float

property sync_pulse_reset_delay

Specifies in seconds the amount of time to wait after the Synchronization Pulse before resetting the ADCs or DACs on the device. When synchronizing devices, query sync_pulse_reset_time on all devices and note the largest reset time. Then, for each device, subtract the reset time from the largest reset time and set this property to the resulting value.

Type

float

property sync_pulse_reset_time

Indicates in seconds the amount of time required for the ADCs or DACs on the device to reset. When synchronizing devices, query this property on all devices and note the largest reset time. Then, for each device, subtract the value of this property from the largest reset time and set sync_pulse_reset_delay to the resulting value.

Type

float

property sync_pulse_src

Specifies the terminal of the signal to use as the synchronization pulse. The synchronization pulse resets the clock dividers and the ADCs/DACs on the device.

Type

str

property sync_pulse_sync_time

Indicates in seconds the delay required to reset the ADCs/DACs after the device receives the synchronization pulse.

Type

float

property sync_pulse_term

Indicates the name of the internal Synchronization Pulse terminal for the task. This property does not return the name of the source terminal.

Type

str

property sync_pulse_time_timescale

Specifies the timescale to be used for timestamps for a sync pulse.

Type

nidaqmx.constants.Timescale

property sync_pulse_type

Specifies the type of sync pulse used in the task.

Type

nidaqmx.constants.SyncPulseType