Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

Help! To design a counter for counting clocks

Dear all,

I want to design a counter that count all clocks of a square wave. I have tried but I am getting stuck somewhere. Here's attached the file that I started. In this project, my objective is to use NI-USB-6008 to send a square wave to an external oscilloscope. That square wave has to be self-controlled such that nth first clocks have  a certain frequency different to the next (n+1, .....,m) clocks. As part of that, I need to use a counter that I designed myself.

Actually, I have the C++ codes for that:

.

.

.

int count=0;

if(result==1)

{

count++;

}

.

.

.

This is just the section that I want

0 Kudos
Message 1 of 3
(5,757 Views)

Hello,

 

I am a bit confused about your application, are you trying to count (input) clock edges or generate a clock signal with your 6008. If you want to count digital edges with the USB-6008 you can use the counter on the 6008 to count these edges; an example in the example finder exists already and can be found in the location shown below. If you want to generate this varying clock signal, it will be difficult with a USB-6008 since it software timed and updates to the digital line will depend on the updates over the USB bus. If you can clarify your application a bit, I may be able to make some suggestions.

 

Counter Event.png

 

Eric

Eric Liauw
Senior AE Specialist - Automated Test | CLD | CTA
National Instruments
0 Kudos
Message 2 of 3
(5,750 Views)

Thanks for this thread. This is the answer that I want for my class project of a digital clock.

0 Kudos
Message 3 of 3
(5,730 Views)