daq#

NI-DAQ device: external start-trigger + TTL edge counter.

Registered as a BaseDataProducer so its TTL rising edges flow onto the session dataqueue via record() and into the AcquisitionManifest like any other producer.

Dual purpose, preserved from the original engine-driven design:

  1. On start() the counter input is armed first (begins counting), then a single pulse is written on the digital-output line to tell a separate system to go. Arming before pulsing means the first TTL returned by that system is never missed.

  2. A background thread polls the counter and records one row per new rising edge (payload is the cumulative edge count: 1, 2, 3, …) – the marker downstream parsers align against (dataqueue_device_match="nidaq" in psychopy_device.Psychopy).

nidaqmx is imported lazily so this module loads on machines without the NI driver; development_mode short-circuits every hardware call.

class mesofield.devices.daq.Nidaq[source]#

Bases: BaseDataProducer

External start-trigger + TTL edge counter on an NI-DAQ board.

__init__(cfg=None, **kwargs)[source]#
Parameters:
Return type:

None

reset()[source]#

Stop the worker (if running) and reset the NI-DAQ device.

Return type:

None

test_connection()[source]#

Pulse the DO line high ~3 s as a wiring check (logs, never raises).

Return type:

None