Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

Stop don't work

hallo
 
I can not stop the LV when I push the STOP buttom , I attached the Vi please take a look and tell me where is the problem
 
thanks
Toni
0 Kudos
Message 1 of 7
(4,928 Views)
this is the right Vi
0 Kudos
Message 2 of 7
(4,926 Views)
Your problem is rather simple.

Because there is an event structure in the loop, a new iteration will be executed - and the value of the stop button read - only if one of the events is fired. The timeout event will never execute because the timeout is unwired (default value = -1 --> wait for ever).

Add a Value Change event for the stop button and the code will behave as expected. You can also remove the timeout event because it does nothing !



Message Edité par JB le 05-07-2008 09:42 AM
0 Kudos
Message 3 of 7
(4,923 Views)

hi JB

thanks for your reply, what do u mean with Add a Value Change event for the stop button , can you give an example plz

thanks

0 Kudos
Message 4 of 7
(4,918 Views)
Add a value change event for Stopp the same way you did it for Move Axis and Save Axis ! Doing so, the value change event will be fired when you press the stop button and the loop will stop.
  • Right-click on the border of the event structure
  • Add Event Case...
  • Select Stopp and Value Change. Press OK to close the window.
  • Move the terminal of Stopp inside the new event
  • Wire it to the terminal of the loop. Please notice that the tunnel is set as Use Default if Unwired by default (right-click on the tunnel). Therefore it is not necessary to wire it from the other events. The default value (FALSE) will be used.
  • It is not a good practice to set this option for the tunnel of the error cluster. Deactivate it to force you to wire it in every event. On the while loop, replace the tunnel for the error cluster with a shift register. See below picture. Doing so, the value of the error cluster will be updated on every iteration. With a tunnel, the original value will be used all the time.
  • Like already mentionned, remove the timeout event because it does nothing.


Message Edité par JB le 05-07-2008 11:08 AM
0 Kudos
Message 5 of 7
(4,915 Views)
Here is the whole answer. Please ignore the previous one.

Add a value change event for Stopp the same way you did it for Move Axis and Save Axis !
Doing so, the value change event will be fired when you press the stop button and the loop will stop.
  • Right-click on the border of the event structure
  • Add Event Case...
  • Select Stopp and Value Change. Press OK to close the window.
  • Move the terminal of Stopp inside the new event
  • Wire it to the terminal of the loop. Please notice that the tunnel is set as Use Default if Unwired by default (right-click on the tunnel). Therefore it is not necessary to wire it from the other events. The default value (FALSE) will be used.
  • It is not a good practice to set this option for the tunnel of the error cluster. Deactivate it to force you to wire it in every event. On the while loop, replace the tunnel for the error cluster with a shift register. See below picture. Doing so, the value of the error cluster will be updated on every iteration. With a tunnel, the original value will be used all the time.
  • Like already mentionned, remove the timeout event because it does nothing.
Message 6 of 7
(4,906 Views)
THANKS JB
0 Kudos
Message 7 of 7
(4,900 Views)