Download presentation
1
SmartStruxure™ Lite Solution Lua4RC
2
Agenda Lua4RC What is it? Who can use it? How does it work?
Where can I get resources?
3
Our goals for you… By the end of this module, you will be able to:
Learn what Lua4RC can and cannot do Understand the differences in script loading methods Remember the different functions available Experiment with example scripts Diagnose syntax and logical errors
4
Lua4RC What is it, what can it do?
5
The evolution of room controllers
SE7000 One application = one model number Each model has custom I/O type and count SE8000 Common platform for all models Universal I/O
6
The Application Specific Room Controller
Currently available models SER8300: Line voltage fan coil SE8300: Low voltage fan coil / room controller SE8600: Roof top unit and Indoor Air Quality Pre-loaded application in each model All necessary parameters can either be changed by user interface or through the BMS.
7
Built-in application vs Lua4RC
If the application logic is pre-built, why do I need Lua4RC? Historically, each room controller had its own operation sequence and each small difference in the sequence had to be modified in the embedded firmware. This has helped to build the SE7xxx room controller’s reputation of a solid and stable system but also translated in numerous models and was dependent on engineering / production for time to market. Sometimes a very slight change in the sequence of operation is required in order to adapt to a particular equipment or customer’s requirement and does not justify a complete new model re-design. In these cases, Lua4RC may allow to perform slight modifications of the control sequence in order to accommodate the needs of a specific project.
8
What Lua4RC can and cannot do
What Lua4RC can do: Slightly alter or enhance the on-board sequence of operation of a room control by temporarily reading or writing to some data points. This includes some physical inputs / outputs and virtual points. What Lua4RC cannot do: Replace the on-board sequence and take control of all the inputs and outputs of the room controller Write points to the BMS or other room controllers
9
Built-in application vs Lua4RC
A Lua4RC script will work in parallel WITH the existing pre-built application. It does not replace it. Lua4RC gives you the ability to override elements and parameters of the built-in control logic.
10
Lua4RC does not replace the built-in application!
11
A few examples
12
A few examples
13
How to load Lua4RC scripts
14
How to upload scripts There are two distinct mechanisms available to upload scripts to a room controller. Each has its own particularities: Via USB cable Via BACnet objects Upload script in one file from a PC One-shot operation Stored in flash memory Ideal for standalone applications Maximum file size of 15kB Script runs every 1 second Recommended method Maximum 10 scripts Maximum 460 bytes / script Must be converted to one line script Scripts uploaded with BACnet will override any script uploaded by USB. PG1 to PG10 share variables unless declared as “local” This opens the door to potential issues with end-user, use with caution!
15
How to upload scripts – USB Cable
Requires a standard micro-USB cable and a PC application, available soon on the Buildings Download Center Requires pre-built .lua files available on the download center with the Lua4RC keyword Application also allows to upload custom image, firmware and language files
16
How to upload scripts – BACnet objects
Can be uploaded to BACnet csv objects Uploaded from the BMS Up to 10 scripts running in a single thread Run time for entire thread is 1 second Maximum script size : 420 bytes / script Note: size limitation caused by BACnet string maximum size MS/TP
17
Lua4RC with SBO BACnet objects
Points are discovered as any other BACnet objects. LUA program 1-10 and Lua Parameter (AV25-AV30)
18
Lua4RC with SBO BACnet objects
Note: SBO currently doesn’t allow carriage returns while typing text in the ‘Description’ field. This means the entire script must be placed on a single line. Use semicolons (;) to delimit the various sections. Example: if ME.AO2==nil then ME.MV2 = 1;end; if ME.BV2 == 1 then ME.BO2 = 0;end
19
How to upload scripts - note
Note: It is possible to upload scripts using both methods on the same room controller.The following behaviour applies; 1- A script loaded to any csv BACnet object will override a script loaded to flash; 2- A script loaded to flash will only be available if all csv BACnet objects are empty You cannot delete a script that has been uploaded via a USB cable. If you want to remove a script, you must overwrite it with another script. The script must contain at least comment delimiters ex : --
20
Lua4RC on the room controller UI
21
Lua screen 1/3 Lua page 1/3 presents the first 10 lines of a script. The up and down buttons let you browse through the PG1 to PG10 objects loaded by BACnet, each of which can contain a separate script. A script uploaded using the USB cable will show under PG1.
22
Lua screen 2/3 This page gives the option to run or stop the scripts. Scripts loaded using BACnet cannot be controlled individually. When the Room Controller is started up and a script is loaded, the script is automatically in Running status, shown in the Program status field. If the script is not in Running status, the Program error field will show whether there is an error in the script. If the field shows anything other than No error, there are errors in the loaded script and it will not run. If there is an error or errors, a message explaining the error(s) will be displayed in the Debug log. The Debug log can also be use for printing values from the script. Print results from multiple scripts are concatenated in the Debug log window. The Debug log window can hold a maximum of 78 characters on 3 lines. The Debug log is refreshed every second, that is, every time the script loops back on itself.
23
Lua screen 3/3 The SE8000 Lua environment offers 6 AV objects that can be used in the scripts. These objects are regular BACnet AV objects and are accessible as such. Their value can also be set in the user interface. The user interface sets the value at the lowest level of priority. It will be overridden by a value set in a script or via BACnet. When the value is overridden, the value’s text will appear red and it will not be possible to change it in the interface. To release the override, the script or the BACnet client must set the value priority in effect to nil. IMPORTANT: Even if the script is not currently running, the AV25 to AV30 variables, if used by the script, will still be overridden and unchangeable by the user.
24
Examples
25
Lu4RC existing applications
Available on the Buildings Download Center with the keyword “Lua4RC”
26
Building Lua4RC custom scripts
27
TVD versus custom scripts
SBS Solutions team provides tested, validated and documented Lua4RC scripts for specific needs. Scripts can be loaded by commissioning or project team. These scripts are supported and the library keeps growing. Custom scripts can be written using the Lua API No technical support provided
28
Lu4RC API Lua syntax and SSL / BACnet naming convention applies. For syntax and operators:
29
API, examples tools.switch() Lua interface function switch()
Switch function (on-off with deadband) output (0 or 1) = tools.switch ( output, input-expr, off-expr, on-expr ) SWITCH simulates the operation of a conventional ON-OFF thermostat. It also provides a deadband function so an Object does not continuously switch ON and OFF based on a specific value. Usage example ME.BV1 = tools.switch(ME.BV1, ME.AV1, 0, 10)
30
API, examples tools.scale() Lua interface function scale()
This function returns the linear interpolation between two points. The function can also add the offset value to the final result if desired. nResult = tools.scale(input, offset, x1, y1, x2, y2) Usage example nResult = tools.scale(75,0,0,50,100,100) returns nResult = 87.5
31
API, examples tools.memory() This tool returns 2 values: Used memory Total memory Usage example: a,b = tools.memory() print(a,b)
32
Script errors and troubleshooting
Information available in the Lua Custom Programming Guide
33
Object priorities
34
Object priorities By default, the write priority is priority 16, and therefore the internal control is overridden by LUA commands such as “ME.AV25 = 10”. To write to another priority, an array is used (example: ME.AV25_Present_Value[8] = 20). To release this priority, you can set it to nil (example: ME.AV25_Present_Value[8] = nil). To access the relinquish default (the Room Controller’s internal logic application priority), priority 17 can be used (example: ME.AV25_ Present_Value[17] = 30). In this case, make certain that you are not in conflict with the Room Controller’s normal control logic.
35
Compatibility In order to use Lua4RC, you need to have the following:
SE8000/SER8000 with firmware version and up SER8300 start date code (DC) : 1502 SE8xxx start date code (DC) : 1450 Note: SE8300 manufactured before DC 1450 are not upgradable and will not function with Lua4RC Note: SER8xxx devices that are below will eventually be upgradable using the upload tool, however not at the moment (as of February 2015).
36
Final notes Lua4RC brings a lot of added flexibility but has to be used with caution. . For a list of BACnets to read/write to, please consult the BACnet integration guide of the specific Room Controller.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.