Sie sind auf Seite 1von 36

SmartStruxure™ Lite Solution

Lua4RC
Agenda

Lua4RC

What is it?
Who can use it?
How does it work?
Where can I get resources?

Schneider Electric - SmartStruxure™ Lite solution Training 2


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

Schneider Electric - SmartStruxure™ Lite solution Training 3


Lua4RC
What is it, what can it do?
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

Schneider Electric - SmartStruxure™ Lite solution Training 5


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.

Schneider Electric - SmartStruxure™ Lite solution Training 6


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.

Schneider Electric - SmartStruxure™ Lite solution Training 7


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

Schneider Electric - SmartStruxure™ Lite solution Training 8


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.

Schneider Electric - SmartStruxure™ Lite solution Training 9


Lua4RC does not replace the built-in application!
A few examples

Schneider Electric - SmartStruxure™ Lite solution Training 11


A few examples

Schneider Electric - SmartStruxure™ Lite solution Training 12


How to load Lua4RC scripts
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 •Maximum 10 scripts


•One-shot operation •Maximum 460 bytes / script
•Stored in flash memory •Must be converted to one line script
•Ideal for standalone applications •Scripts uploaded with BACnet will
•Maximum file size of 15kB override any script uploaded by USB.
•Script runs every 1 second •PG1 to PG10 share variables unless
declared as “local”
•Recommended method
•This opens the door to potential
issues with end-user, use with
caution!

Schneider Electric - SmartStruxure™ Lite solution Training 14


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

Schneider Electric - SmartStruxure™ Lite solution Training 15


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

Schneider Electric - SmartStruxure™ Lite solution Training 16


Lua4RC with SBO BACnet objects
Points are discovered as any other BACnet objects.
LUA program 1-10 and Lua Parameter (AV25-AV30)

Schneider Electric - SmartStruxure™ Lite solution Training 17


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

Schneider Electric - SmartStruxure™ Lite solution Training 18


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 : --

Schneider Electric - SmartStruxure™ Lite solution Training 19


Lua4RC on the room controller UI
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.

Schneider Electric - SmartStruxure™ Lite solution Training 21


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.

Schneider Electric - SmartStruxure™ Lite solution Training 22


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.

Schneider Electric - SmartStruxure™ Lite solution Training 23


Examples
Lu4RC existing applications

Available on the Buildings Download Center with the keyword “Lua4RC”

Schneider Electric - SmartStruxure™ Lite solution Training 25


Building Lua4RC custom scripts
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

Schneider Electric - SmartStruxure™ Lite solution Training 27


Lu4RC API

Lua syntax and SSL / BACnet naming convention applies.

For syntax and operators: http://www.lua.org/manual/5.1/

Schneider Electric - SmartStruxure™ Lite solution Training 28


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)

Schneider Electric - SmartStruxure™ Lite solution Training 29


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

Schneider Electric - SmartStruxure™ Lite solution Training 30


API, examples

tools.memory()
This tool returns 2 values:
Used memory
Total memory

Usage example:

a,b = tools.memory()
print(a,b)

Schneider Electric - SmartStruxure™ Lite solution Training 31


Script errors and troubleshooting

Information available in the Lua Custom Programming Guide


Object priorities
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.

Schneider Electric - SmartStruxure™ Lite solution Training 34


Compatibility

In order to use Lua4RC, you need to have the following:

● SE8000/SER8000 with firmware version 1.0.7 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 1.0.7 will eventually be upgradable using the
upload tool, however not at the moment (as of February 2015).

Schneider Electric - SmartStruxure™ Lite solution Training 35


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.

Schneider Electric - SmartStruxure™ Lite solution Training 36

Das könnte Ihnen auch gefallen