ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

dumb question

I need to create a timed loop that will output the numbers 1-5 in sequential order and then reset this cycle. Example: 1-2-3-4-5-1-2-3...and so on. What is the best way to do this? Sorry for the noob question I just can't figure out how to do that. 

 

 

0 Kudos
Message 1 of 6
(2,956 Views)

What have you tried so far?

0 Kudos
Message 2 of 6
(2,953 Views)

I was thinking a sequential structure unfortunately you cannot wire seperate sequences to one output like you can with a case structure. I tried using C++ code in a formula node to create a for loop/ if loop combination to increment the value and then reset it...I kept getting errors about not having proper inputs, missing (), etc. 

 

 

0 Kudos
Message 3 of 6
(2,951 Views)

Here's a hint.  Look at the i terminal that is inside the loop.  It is called the iteration terminal and will give you the count number of the iteration loop.  With just a little bit of math on that, you can get the values you are looking for.

0 Kudos
Message 4 of 6
(2,948 Views)

Was the pun intended RavensFan....."Bit of math" 🙂

Certified LabVIEW Architect
Certified Professional Instructor
0 Kudos
Message 5 of 6
(2,928 Views)

Count 1 to 5.png

David C
0 Kudos
Message 6 of 6
(2,925 Views)