Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

USB 6xxx Triggered Data Acquisition - using Python

Device: USB6xxx

 

I want to acquire data from an Analog Input using after an internally generated trigger and then replace with external signal source as trigger. 

 

Will this python code work?

 

import nidaqmx
from nidaqmx.constants import Edge

 

with nidaqmx.Task() as task:
task.ai_channels.add_ai_voltage_chan("Dev1/ai0")

task.do_channels.add_do_chan("Dev1/port0/line0")

 

task.triggers.start_trigger.cfg_dig_edge_start_trig("/Dev1/PFI0", Edge.RISING)

 

task.start()
task.wait_until_done()

 

task.write(True)

data = task.read(number_of_samples_per_channel=1000)

task.timing.cfg_samp_clk_timing(rate=33810)

0 Kudos
Message 1 of 3
(613 Views)

What do you mean by an internally generated trigger and an external signal source?

You cannot configure the sample clock timing after starting a task. You must configure the timing and trigger before starting the task so that the DAQmx device is armed and ready to receive the trigger then start generating the sample clock to the ADC.

-------------------------------------------------------
Control Lead | Intelline Inc
0 Kudos
Message 2 of 3
(582 Views)

Thank you.

 

First, I want to capture the analog signal only after seeing the rising edge of internally generated signal (step waveform)

 

Then, I want to repeat the task after replacing the internally generated signal with an external signal.

0 Kudos
Message 3 of 3
(572 Views)