Timer Component Value reset

Hi guys, I’m trying to work on a window to count down from some number down to till specific trigger makes it stop. I’ve bind the Running property of the timer to a tag so whenever the tag goes off I want it to start counting down from 12 to zero and negative. Where I seem to have a brain fart is the resetting the timer, I tried using this under the propertyChange event handler of the timer component scripting:

if event.propertyName == "Running?" and event.newValue == 0:
	event.source.value = 12

what am I doing wrong? wouldn’t this basically first checks that the property that was changed is Running and then checks if the new value is zero meaning its off and then set the value property of the timer to 12?
I’m trying to use the timer component because this will be a screen that’s going to be open in front of the operator and figured instead of using tags for each station I go ahead and take advantage of the timer component. Thanks

Property names in scripting/the backend are not the same as the property names displayed in the property editor. If you hover over the name of the property in the property editor, there will be a ‘Property Scripting Name’ hint. For the timer in particular, the ‘Running?’ property is just ‘running’ in scripting - all lowercase, no punctuation.

Thanks for that Paul, as usual it’s the little things that traps me. I was losing my mind trying to figure this out… :thumb_right:

1 Like