Quantcast
Channel: Digital I/O topics
Viewing all articles
Browse latest Browse all 2184

USB-6501 Detect an External Trigger

$
0
0

I have an external trigger I want to wait and detect with the 6501.  I've tried the following ( based on NI example code 😞

ret = DAQmxCreateTask( NULL, &tsk_hndl[ indx ] );

ret = DAQmxCreateDIChan
(
tsk_hndl[ indx ],
"Dev1/port2/line0:7", //"Dev1/port2/line7"
NULL,
DAQmx_Val_ChanPerLine
);

ret = DAQmxCfgChangeDetectionTiming
(
tsk_hndl[ indx ],
"Dev1/port2/line0:7",
"Dev1/port2/line0:7",
DAQmx_Val_ContSamps,
1
);

 

and the DAQmxCfgChangeDetectionTiming gives me an error of -20077 ( DAQmxErrorInvalidAttributeValue ) and the error string isn't very helpful.  I tried using just line 7 vs lines 0-7.  Since this wasn't working I tried setting it up as a counter ( that same line Port 2 / Line 7 is also CTR0 ) and that also errors.  Right now I'm setting it up as a digital input ( without the change detection ) and reading it continuously in a thread but believe triggers are being made ( trigger appears to have occurred looking at the external equipment via oscope ) and being missed by that approach.  


Viewing all articles
Browse latest Browse all 2184

Trending Articles