06-11-2013 12:09 PM - edited 06-11-2013 12:09 PM
Hi Eric,
The counter input terminal is set to /Dev1/AnalogComparisonEvent. The analog trigger on the AI task is set to use Dev1/ai0 for the trigger source. The counter counts the analog comparison event which is generated by the analog input on ai0.
Best Regards,
06-11-2013 12:45 PM
Hi John,
That makes sense, but I guess the question is what if I use ai1 instead of ai0? How does the counter know to map to ai1 instead? I'm sure this is probably a dumb question, but something isn't clicking with me.
Eric
06-12-2013 09:17 AM
You would specify to acquire on ai1 when you create your analog input task, and specify to trigger off of that channel when you configure the analog start trigger:
//Configure Analog Task
DAQmxCreateTask("",&aiTaskHandle);
DAQmxCreateAIVoltageChan(aiTaskHandle,<insert AI channel here>,"",DAQmx_Val_Cfg_Default,-10.0,10.0,DAQmx_Val_Volts,NULL);
DAQmxCfgSampClkTiming(aiTaskHandle,"",10000.0,DAQmx_Val_Rising,DAQmx_Val_ContSamps,1000);
DAQmxCfgAnlgEdgeStartTrig(aiTaskHandle,<insert AI channel here>,DAQmx_Val_Rising,<insert trigger level here>);
DAQmxSetAnlgEdgeStartTrigHyst(aiTaskHandle, <insert trigger hysteresis here>);
Best Regards,