Lua is a scripting language with similar constructs to other imperative programming languages:
local function xor(b1, b2) return (b1 and not b2) or (b2 and not b1) end
Lua has types typical of programming languages, such as boolean, number, string. One unusual type it has, however, is the table type. This is used to implement arrays, dictionaries, and even classes and objects.
The most interesting aspect of the Lua programming language is probably its extremely well implemented interface to the C programming language.
By itself, Lua would be just another programming language. With the capability to run Lua scripts from the C language, however, incredibly flexible customization can be added to embedded systems, which may be implemented in C/C++.
One of our projects involved the requirements to synchronize two embedded system to internet time servers using network time protocol for accurate timestamping, and control a process requiring time accuracy at the seconds resolution, the idea being to trigger the second system just after the second hand ticks, so that the time read by the second system remains consistent.
Although there are PLCs with NTP built in, in reality there are all sorts of constraints including synchronizing time only to the nearest second. Quite useless for our purpose.
By moving to a C/C++ Linux system, we had access to the full NTP time resolution, and opportunity to use Lua for customization.
Contact us for your automation needs.