from org.csstudio.opibuilder.scriptUtil import PVUtil, ConsoleUtil from java.lang import Thread, Runnable oldStartMask = int(PVUtil.getDouble(pvs[2])) chann_mask = int(widget.getMacroValue("chmask"),16) class runInThread(Runnable): def run(self): #ConsoleUtil.writeInfo("LED mask = %x, mask = %x and = %x" % (LEDStartMask, mask, LEDStartMask & mask)) #ConsoleUtil.writeInfo("I'm into the truth") mask = (oldStartMask & ~0x00780000) | chann_mask pvs[3].setValue(mask) th = Thread(runInThread()) th.start()