Hi!
I'm trying to use an external trig signal to control the acquisition.
I would like to start the acquisition on positive edge and stop on negative edge and after that write the data to a file.
I'm reading asynchronously with
while(1) {
n = read(comedi_fileno(dev), buf, bufsz);
// alt 1
cmd->start_src = TRIG_EXT;
cmd->stop_src = TRIG_COUNT;
cmd->stop_arg = X;
This set-up starts the acquisition by the external trig signal and it stops after X acquisitions.
// alt 2
cmd->start_src = TRIG_EXT;
cmd->stop_src = TRIG_NONE;
This set-up starts the acquisition but then it runs for ever.
// alt 3
cmd->start_src = TRIG_NOW;
cmd->scan_begin_src = TRIG_EXT;
cmd->scan_end_src = TRIG_COUNT;
cmd->scan_end_arg = 0;
cmd->stop_src = TRIG_NONE;
This set up starts a scan on positive edge and stops the scan on negative edge (read is blocking until the trigger goes high again).
I can't find out how to get a notification when the trigger goes zero so I can write the data to the file and close it.
The options for my card NI pci-6023e are:
start: now|ext|int
scan_begin: timer|ext
convert: timer|ext
scan_end: count
stop: none|count
Any suggestions?