11-10-2010 11:31 PM
Is there a way to make my boolean control return back to false position only when the control is read in the program? To detect a boolean button event, I have to make sure that my program is at an even structure to wait for the event or I am polling fast enough, right?
11-10-2010 11:43 PM
If your Boolean is inside the event structure, it will return to the false state.
Don't understand your comment "I have to make sure that my program is at an even structure to wait for the event or I am polling fast enough, right". Event structures have nothing to do with polling and you don't run your program up to an event structure. There is no waiting before an event will be captured.
11-11-2010 02:13 AM
A boolean control will return to false when it is read by the program if you select the correct mechanical action.
You want either "latch when released" or "latch when pressed".
I also don't understand your second sentence. Do you have a simple example that illustrates what you want to do?
Yes, a latched boolean should be inside it's event to ensure it gets read by the code soon after pressing. A program should always be designed to immediately handle events. This means events should not be hidden in potentially inaccessible locations such as case structures, sequences or other code segments that are not in the dataflow. This also means that event cases should be able to finish quickly so the event is ready to handle the next action. Any longer operations (e.g. containing interactive while loops, etc.) don't belong inside an event case but should be done in a parallel loop, such as in a queued state machine.
11-12-2010 01:13 PM
Thank you guys. I think I just have to play around with different scenerio.
11-12-2010 10:40 PM
Hi jyan72211,
If you feel that the answer satisfies you... Just make it as a solution. So that other can kow the thread got closed or not...
And it is also a kind of appreciation instead of saying Thanks...
<<Kudos are welcome>>
11-16-2010 05:31 AM
This is what I have done so far for the thin paches. what I need now is to work out the start and length from the Array of integers.
11-16-2010 09:39 AM
@983w7 wrote:
This is what I have done so far for the thin paches. what I need now is to work out the start and length from the Array of integers.
To answer the boolean question:
TRUE
SCNR