Jump to content

Loop - start, pause, stop


Vende

Recommended Posts

Hi, I want to create an loop that can be controlled by buttons - it can be started, paused and stopped. I have found that this could be done with a help of Event Structure. The example (a counter) is below. Can you help me to run counting when it is started? Thanks

You can download it here: http://www.2shared.c...d2a/events.html (sorry, the file attachement failed)

First you will need to allow the time-out case to execute by wiring a value (say 100ms) to the blue icon in the top left hand corner. You will then have to use the state of the "Running" boolean to decide whether to increment the counter or not. You can use 2 shift rgisters (one for the state and once for the count).

This is thesort of thing you will want to use for the counter.

Link to comment

Thanks, ShaunR, it is a good idea. It would be a good inspiration in the other parts of my projects. But it is not so easy. I need to control the loop, because I have got more conponents inside that are dependent on "i" of the loop. So I need several buttons for start, pause, pause and..., stop connected with the loop directly. I think it can be solved with Event Structure inside the loop, but I can not use it properly. Thanks

To Neville D: No...

First you will need to allow the time-out case to execute by wiring a value (say 100ms) to the blue icon in the top left hand corner. You will then have to use the state of the "Running" boolean to decide whether to increment the counter or not. You can use 2 shift rgisters (one for the state and once for the count).

This is thesort of thing you will want to use for the counter.

Link to comment

Thanks, ShaunR, it is a good idea. It would be a good inspiration in the other parts of my projects. But it is not so easy. I need to control the loop, because I have got more conponents inside that are dependent on "i" of the loop. So I need several buttons for start, pause, pause and..., stop connected with the loop directly. I think it can be solved with Event Structure inside the loop, but I can not use it properly. Thanks

To Neville D: No...

I think you are missing the point.

The image is an "example" of a counter. Not a solution to your project (that would be too easy ;) ).

Look at what it does and how it works and apply it to your current "real" example.

Your dependency on the "i" iterator will cause you problems since it increments every loop execution. Your dependents need to use a counter (oooh...like the example :) ) that can be started and stopped regardless of how many times the loop executes.

Link to comment

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.

×
×
  • Create New...

Important Information

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