Timer Control

I want to have a timer run on an event and then stop when it gets to the upper bound of its count. Functionally, I think I know how to do it, but am having trouble with the syntax. Essentially, I have a component which is counting boxes on a conveyor. When a new box is counted, I want to fire the timer and let it count up to its upper bound and stop. I am using the timer to animate the box traveling down the conveyor. Right now, the timer just loops around and runs continuously irregardless of whether or not there is a box on the conveyor.

To get the timer to stop after one cycle, you can put this code on the propertyChange event of the timer component.

if event.propertyName == "value" and event.newValue == 0: event.source.running = 0