Helm 4.2.0 introduces a number of changes and improvements in Lua scripting integration.
Lua Version is upgraded to 5.1.5.
This version is a bugfix from the previous 5.1.4. No compatibility issues are known
Lua interpreter and modules are not statically linked into Helm.
In earlier versions, the Lua interpreter was compiled and linked into the Helm code. This meant any changes to Lua or addition of new Lua modules often meant that Helm needed to be recompiled and reissued. Now, Lua and associated modules are provided as DLL’s and are loaded as required.
Advantages:
- Third-party Lua modules with can easily be added or upgraded
- Lua interpreter itself can be upgraded independently
Standard modules
Helm ships with the following Lua modules
Module | Version | URL | Notes |
---|---|---|---|
LuaXML | 1.7.4 | https://github.com/LuaDist2/luaxml | |
LuaSocket | 2.0.2 | https://github.com/diegonehab/luasocket | |
LuaFilesystem | 1.6.3 | https://github.com/keplerproject/luafilesystem |
Standard locations for Lua support files
Previously, modules were placed in ad-hoc locations or directly within the application folder. All lua modules and DLLs should now be located as shown.
Files | Path | Notes |
---|---|---|
Main Lua DLLs: | C:\Program Files(x86)\Rascular\Helm Designer | lua51.dll and lua5.1.dll |
Lua source modules | C:\Program Files(x86)\Rascular\Helm Designer\Lua | |
Lua module DLLs | C:\Program Files(x86)\Rascular\Helm Designer\clibs |
Shorthand access to panel objects and properties
Helm Panel object properties and functions can now be accessed directly from Lua without using the “helm.set/get/exec” functions.
Now, all panel objects and their properties can be directly accessed via the new global “H” table. This simplifies Lua coding and makes scripts easier to read and write. From this…
-- set label text to name of logo on DSK1 helm.set("LABEL_1", "Text", helm.get("IS750_1", "DSK1_Image")) -- and switch the Imagestore video to the B input. helm.exec("IS750_1", "MixToB", 50)
… to this…
-- set label text to name of logo on DSK1 H.LABEL_1.Text = H.IS750_1.DSK1_Image -- and switch the Imagestore video to the B input. H.IS750_1:MixToB(50)
The helm.set.get.exec
functions will remain fully supported and can still be used. They are currently still required for access to ‘sub-properties’ like “Font:Pointsize” which aren’t supported with the new system.
Note : Helm versions from V4.2 to V4.4 required a dot between object and method names. This was a non-standard Lua syntax, and is not supported in Lua for Web Panels. Helm V4.5 onwards support the correct syntax which uses a colon ‘:’ between the object and method names, like this:
H.Object:Method(...)
Support for device tables with helm.set
and helm.exec
Helm 4.1.5 introduced wildcard support for helm.set and helm.exec, allowing several controls to be manipulated with a single command if their names matched the specified pattern
So helm.set("LABEL_*", "Visible", true)
would make invisible all components whose name began “LABEL_”.
This is still supported, but the first parameter to helm.set
can now be a Lua table of strings. This is useful when the devices to be controlled need changing at runtime, or the names are not easily matched with a wildcard command.
--lua myLabels = {"LABEL_1","LABEL_2","LABEL_4") helm.set(myLabels, "Visible", true)