Using Lua Scripting

system:inmation provides the functionality to embed scripts into the system. This functionality is also referred to as "Inside API", as opposed to the "Outside API" which is the .NET API (see also Jump Start - Using .NET API (SCI)).

Scripts can be used in various scenarios, that can be divided into two main functional areas:

  • Mathematical operations on data

  • Execute simple calculation, e.g. add two input to create a new value

  • Execute advanced calculation, e.g. run a matrix calculation for equipment analytics

  • Configurational operations on system:inmation

  • Create/Update/Delete objects in all system:inmation model trees

The language of the scripting engine is Lua. Why Lua? Because it is a well proven, powerful and fast scripting environment, that shows exceptional performance when embedded in the C++ backend of system:inmation. Refer to the Lua website for more details on the Lua syntax.

Audience

This Jump Start contains instructions for administrators and power users regarding the use of the Lua scripting engine. The examples given here are basic first steps and examples, to show the principle functionalities available. The reader should have some basic programming knowledge, preferably in Lua, or another script or object based programming language, to help to understand the concepts. To understand the examples and to deal with the configurational operations, it is also useful to have a good knowledge of the internal structure of system:inmation. Refer to the system documentation for more information about this topic. Some details also refer to the OPC standard. Although not a mandatory requirement, it is helpful to have some experience of using OPC servers and clients.