Our Brands

Impact-Company-Logo-English Black-01-177x54

Welcome to the Schneider Electric Website

Welcome to our website.
		
How can we help you today?
How to get a C-Bus Automation Controller LUA Script IF to perform like a PASCAL Logic ONCE
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.

No outer if (or) - then statement checking event senders

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

Outer if (or) - then statement checking if event sender is visualization or c-bus network

Schneider Electric Australia

Explore more
Product:
Users group

Discuss this topic with experts

Visit our Community for first-hand insights from experts and peers on this topic and more.
Explore more
Product:
  • Products Documentation
  • Software Downloads
  • Product Selector
  • Product Substitution and Replacement
  • Help and Contact Centre
  • Office Locations
  • Where to buy
  • Phone: 13 73 28 (13 SEAU)
  • Schneider Electric Community
  • Careers
  • Company Profile
  • Report a misconduct
  • Newsroom
  • Investors
  • EcoStruxure
  • Job Search
  • Blog
  • Privacy Policy
  • Cookie Notice
  • Terms and Conditions of Sale
  • Change your cookie settings