Professional Documents
Culture Documents
#4. SmartStruxure Lite - Lua4RC 1.0.0 PDF
#4. SmartStruxure Lite - Lua4RC 1.0.0 PDF
Lua4RC
Agenda
Lua4RC
What is it?
Who can use it?
How does it work?
Where can I get resources?
SE8000
● Common platform for all models
● Universal I/O
MS/TP
Example:
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 : --
● 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.
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)
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
tools.memory()
This tool returns 2 values:
Used memory
Total memory
Usage example:
a,b = tools.memory()
print(a,b)
● By default, the write priority is priority 16, and therefore the internal control is overridden
by LUA commands such as “ME.AV25 = 10”.
● 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.
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).
● 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.