Quantcast
Channel: LabWindows/CVI topics
Viewing all articles
Browse latest Browse all 5339

How to program counter using and external trigger?

$
0
0

I'm using a USB-6221. I want to count TTL pulses coming from an external device. I want to start/stop counting using an external signal (trigger?).

 

The following function statements seem logical to me, but they don't work. Can you help?

 

DAQmxCreateTask ("pulseCnt", &cntTask);
DAQmxCreateCICountEdgesChan (cntTask, "Dev1/ctr0", "", DAQmx_Val_Rising, 0, DAQmx_Val_CountUp);

 

// The following statement gives this error, "Specified property is not supported by the device or is not applicable to the task".

// Property: "DAQmx_StartTrig_type"

 

DAQmxCfgDigEdgeStartTrig (cntTask, "/Dev1/PFI10", DAQmx_Val_Rising);   // start counting when the TTL count start/stop signal is high

 

DAQmxCfgDigEdgeRefTrig (cntTask, "/Dev1/PFI0", DAQmx_Val_Falling, 0);   // stop counting when TTL count start/stop signal is low.

DAQmxStartTask (cntTask);

 

How would I know if my device is capable of doing what I described above? What function calls should I use?

 

Do I need a statement to connect an internal clock to the counter? What statement specifies that?

 

How do find out where to physically connect the input signal to the USB-6221?

 

Sorry to ask these seemingly elementary questions but I don't understand in detail how counters work and I can't seem to find a good explaination. Documentation is either too simple or too complicated.

 

thanks!

 

 


Viewing all articles
Browse latest Browse all 5339

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>