The SpaceLogic C-Bus Application Controller/Network Automation Controller LUA script does NOT contain an inbuilt "once" statement similar to the C-Bus PICED logic code.
To avoid an if statement being executed by the C-Bus Application/Controller Event-based engine numerous times the use of an outer if (or) - then statement ensuring that the event came from visualization or from c-bus avoids the inner event-based condition being met again and again. We can use LUA script log function and the Logs window to verify expected behaviour
Without outer if (or) - then statement
Without any outer conditional check of whether the event came from either visualization or c-bus network the log windows shows that a change in state of the Group 78 (Strong Room Reed Switch) being set to ON (255) - true results in numerous executions by the event-based lua script engine which continue to occur as seen by updating timestamp.

With outer if (or) - then statement ensuring that the event came from visualization or from c-bus
With the inclusion of an outer conditional loop checking whether the event came from either visualization or c-bus network the log windows shows that a change in state of the Group 78 (Strong Room Reed Switch) being set to ON (255) - true results in one execution and that another change in state of the Group 78 (Strong Room Reed Switch) being set to OFF (0) - false results in one execution. From the Logs window we can see that the added if (or) - then ensuring that the event came from visualization or from c-bus acts similar to a ONCE statement in PICED pascal logic
To avoid an if statement being executed by the C-Bus Application/Controller Event-based engine numerous times the use of an outer if (or) - then statement ensuring that the event came from visualization or from c-bus avoids the inner event-based condition being met again and again. We can use LUA script log function and the Logs window to verify expected behaviour
Without outer if (or) - then statement
Without any outer conditional check of whether the event came from either visualization or c-bus network the log windows shows that a change in state of the Group 78 (Strong Room Reed Switch) being set to ON (255) - true results in numerous executions by the event-based lua script engine which continue to occur as seen by updating timestamp.
With outer if (or) - then statement ensuring that the event came from visualization or from c-bus
With the inclusion of an outer conditional loop checking whether the event came from either visualization or c-bus network the log windows shows that a change in state of the Group 78 (Strong Room Reed Switch) being set to ON (255) - true results in one execution and that another change in state of the Group 78 (Strong Room Reed Switch) being set to OFF (0) - false results in one execution. From the Logs window we can see that the added if (or) - then ensuring that the event came from visualization or from c-bus acts similar to a ONCE statement in PICED pascal logic
Released for:Schneider Electric Australia







