LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

counter reseting after particular number is reached

Hi,

 

I need a counter which will count from 1 to 20. It should reset at 20 and again start from 1 again. Can any one help me in this.

 

Also I need how to interface the labview simulation with real time clock. I mean span of 1 iteration in my simulation should be 1 second.

 

Thanks.

0 Kudos
Message 1 of 4
(3,070 Views)

Hi, here is how I would do the count:

0to20in1sec.png

 

Regarding the real time clock, do you mean a physical hardware called so?

0 Kudos
Message 2 of 4
(3,059 Views)

The Remainder function is your friend, as is the Feedback node.  Each time this piece of code is called, it will report the next higher count.  Make it a sub-VI called "Count 1 to 20" with the Count 1 to 20 as its output and you are done.

 

Count 1 to 20.png

 

P.S. -- I really didn't "get" Feedback Nodes, and still don't use them very often, but for something like this, they are ideal!

 

Bob Schor

 

 


@Vamsi006 wrote:

Hi,

 

I need a counter which will count from 1 to 20. It should reset at 20 and again start from 1 again. Can any one help me in this.

 

Also I need how to interface the labview simulation with real time clock. I mean span of 1 iteration in my simulation should be 1 second.

 

Thanks.


 

0 Kudos
Message 3 of 4
(3,020 Views)

@Bob_Schor wrote:

The Remainder function is your friend, as is the Feedback node.


In a normal application, use the Quotient & Remainder.  It is the easiest code to understand.  When going to FPGA, do the normal comparison and a Select function.  The Q&R is really expensive in an FPGA.



There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 4 of 4
(3,010 Views)