Vende Posted September 9, 2009 Report Share Posted September 9, 2009 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) Quote Link to comment
Neville D Posted September 9, 2009 Report Share Posted September 9, 2009 Homework? Quote Link to comment
ShaunR Posted September 9, 2009 Report Share Posted September 9, 2009 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. Quote Link to comment
Vende Posted September 10, 2009 Author Report Share Posted September 10, 2009 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. Quote Link to comment
ShaunR Posted September 10, 2009 Report Share Posted September 10, 2009 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. Quote Link to comment
Vende Posted September 10, 2009 Author Report Share Posted September 10, 2009 Ok, I will try it of course, it may be better solution as you say Quote Link to comment
Vende Posted September 14, 2009 Author Report Share Posted September 14, 2009 Thanks! It is an alternative solution to "events", but it works well. Quote Link to comment
ShaunR Posted September 14, 2009 Report Share Posted September 14, 2009 Thanks! It is an alternative solution to "events", but it works well. It will work WITH events as well Look at what it is doing rather than how it is implemented. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.