Jump to content
Sign in to follow this  
rimer

For Next Loop

Recommended Posts

I am totally new to Labview programming and I guess I haven't yet fully learned the ropes. :unsure:

I have two numeric controls and a numeric indicator on the front panel. The two controls represent starting and ending values. I want to display the numbers from start value, start value plus one to end value sequentially on the display but only when I receive a (boolean?) response from the rest of the block diagram.

I hope someone can help. :headbang:

Thanks!

Share this post


Link to post
Share on other sites

Hello njkirchner ,

I am thankful for your quick response. I built and tried the vi and found that it counts up to n-1 rather than n. If my second numeric control is set to 10 the max count will be 9. Any ideas on fixing it? Also is there a way of resetting the numeric indicator to 0 at start up?

Much obliged! :yes:

Share this post


Link to post
Share on other sites

I would recommend that you read-up on FOR loops... :book: The loop will iterate for the number wired inthe the N terminal. All you need to do is +1 to that number and it will iterate one more time.

If you need to reset any control, you can use a local variable. You can use them to write 0's to the controls. Put the reset code outside, before you enter the loop.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.