04-07-2014 02:39 PM
sir, i rectified it. i have created a feedback node and initialized to 0, at the selector for the false condition. now its fixed.
regards
04-07-2014 02:40 PM
Oh, Just make life a bit easier on yourself
Now lets discuss it: There are two event frames. Stop2 Value change (Writes TRue to the conditional terminal) and this one shown configured to fire on Start or Stop value change and those booleans are "Latch when released"
Clicking Start enters the False case (Since the Control ref of the event source is not equal to a control ref of the Stop boolean) and we pass Time of the event out to the Feedback node. Press Stop And we flow throught the true case, calculate the time in mSeconds between the two events, update the mSec Elapsed indicator and re-set the feedback node to 0.
04-07-2014 03:14 PM
then what about the gate 1 and gate 2 sensor status chcecking and servo control. will it also be included in the event structure as an event 'gate 1, gate 2 , value changed' . but still a problem if semsors of any the gate malfunction and we get a boolean 1 but in reality train does not pass gate 1 or 2. how we prevent the code to run gate 1 gate 2 check unless speed get calculated.
04-07-2014 03:34 PM
@ dkfire: i thought the problem is rectified but as i introduced the feed back node the time is not clearing if we press start button for the next time . if i am keeping the selector false condition to 0 constatnt, the result is not holding and showing infinity speed and time in sec as 0. how to avoid this ?
04-07-2014 11:33 PM
Sir i came to know the problem, its because of mechanical action of the boolean buttons. when i change them to switch when pressed the problem arises, iis there any way to avoid this problem because i use ir sensors in place of start and stop buttons. they will remain active until the train crosses the ir sensor so the physical action is like "switch when pressed".
regards
04-08-2014 09:24 AM
@vejella463 wrote:
Sir i came to know the problem, its because of mechanical action of the boolean buttons. when i change them to switch when pressed the problem arises, iis there any way to avoid this problem because i use ir sensors in place of start and stop buttons. they will remain active until the train crosses the ir sensor so the physical action is like "switch when pressed".
regards
Switch until released is the action you are describing. In such a case you need the "new value" of the control to drive a case inside the value change event.