Logic Machine Forum
How to lock a script during execution - Printable Version

+- Logic Machine Forum (https://forum.logicmachine.net)
+-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1)
+--- Forum: Scripting (https://forum.logicmachine.net/forumdisplay.php?fid=8)
+--- Thread: How to lock a script during execution (/showthread.php?tid=5634)



How to lock a script during execution - billierios - 27.09.2024

Hi,
 
In a project, we use a pushbutton on KNX which triggers a LM4 script that gives instruction to the intercom to give a doorbell sound. But… when they push more than 1 time (like a couples of times directly after eachother), the intercom gets a couple of times the instruction and gets confused.
 
What is the best way to avoid that a running script is executed a second time?
 
Thanks!


RE: How to lock a script during execution - Daniel - 27.09.2024

Event script has Execution mode: You can select First or Last. Add some os.sleep() on the end to make sure next script is not triggered.
This is implemented in latest fw.