Search code examples
pythontriggersnidaqmx

Digital trigger for analog output


I want to trigger an analog output from a digital trigger on NI PCI 6713

http://www.ni.com/pdf/manuals/371011c.pdf

According to the datasheet I can use PFI <0..9> and those pins are indeed shown in green in NI MAX with ao/StartTrigger

My code is the following:

    task = nidaqmx.Task()
    task.ao_channels.add_ao_voltage_chan("Dev12/ao0")
    task.triggers.start_trigger.cfg_dig_edge_start_trig("Dev12/PFI0")
    task.timing.cfg_samp_clk_timing(rate=1)
    task.start()
    task.write([1,2,3,4,5,6,7,8,9,10,0])

I recieve the following error:

DaqError: Source terminal to be routed could not be found on the device.

Make sure the terminal name is valid for the specified device. Refer to Measurement & Automation Explorer for valid terminal names.
Property: DAQmx_DigEdge_StartTrig_Src
Property: DAQmx_DigEdge_StartTrig_Edge
Source Device: Dev12
Source Terminal: Dev12/PFI0

Channel Name: Dev12/ao0

Task Name: _unnamedTask<1C>

Status Code: -89120

I use Python 3.7


Solution

    • When specifying names for channels, the format is device_name/channel_name.
    • For physical terminals, the format is /device_name/terminal.

    Note the leading slash for terminals:

    task.ao_channels.add_ao_voltage_chan("Dev12/ao0")
    task.triggers.start_trigger.cfg_dig_edge_start_trig("/Dev12/PFI0")
                                                         ^
                                                        Here