Toggling a Label using a button

So, I want to toggle a label that has a custom property called mode and is boolean. When true it should read AUTO, when false it should read MANUAL, how do I do it using a button to toggle between states - true/false? Click …AUTO…click…MANUAL…and repeats…


brass tacks, no fillers added… :slight_smile:

value = event.source.parent.getComponent('Label').mode if value==0: event.source.parent.getComponent('Label').mode=1 else: event.source.parent.getComponent('Label').mode=0

How about toggling a boolean tag using a button. Using the system.write(tagname, value)? Can I write script on the button to send 1 and 0 to the tag continuously? So, click…sends 1…click…sends 0 and repeats…


You got it! :thumb_left: