Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

Setting 6250 counter threshold

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,

John Passiak
0 Kudos
Message 11 of 13
(2,799 Views)

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

 

0 Kudos
Message 12 of 13
(2,794 Views)

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,

John Passiak
0 Kudos
Message 13 of 13
(2,783 Views)