04-19-2023 12:55 AM
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)
04-19-2023 08:58 PM
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.
04-19-2023 11:44 PM
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.