I have a window where i added a custom property to link to a data type.
This data type consists of one “CMD” which is a doubleinteger DI0 to be precise.
Now this window will be my main sequence example and I’m trying to add a button that will set a bit in this double integer tag.
I’ve done some research and I have found a few examples but they won’t work for me. Do any of you see what I’m doing wrong in my scripting?
def setBit(value, position, newValue): newValue = (newValue & 1) << position mask = 1 << position return (value & ~mask) | newValue system.tag.write(setBit("event.source.parent.DATA_Sequentie.CMD",0,1))
Thanks in advance this will help me a lot!