Lua Scripting Engine - Advanced Usage | Scribe

    Lua Scripting Engine - Advanced Usage

        Navigating to Lua Engine

        1
        Click "Lua Scripting Engine"
        2
        Click "Scripts"
        3
        This view shows the Lua Scripts and their enabled status

        Adding New Lua Script

        4
        Click this button field.
        5
        Enter the name of the script
        6
        For Example Type "TestScript1"

        Data Receivers

        information ordinal icon
        Tip! Lua Scripts can be triggered by Data Receivers - When data is received by the Data Receiver it will fire off any scripts which are set to receive data. For example Axia GPIO\ \ On Start and On Stop Scripts are called when the service starts and stops\ \ Scripts with no Data Receiver can be triggered manually using the Run button\ \ Scripts can also be used to simply store global variables
        7
        Click this dropdown to select the Data Receiver

        Data Types

        8
        Select the Data Type
        information ordinal icon
        Tip! Datatypes can be Bytes / UTF8 ASCII / AxiaDataReceived Object / Json Object or XML
        9
        Enable the script to run
        alert ordinal icon
        Alert! When creating a new script there must be an Entry Function called the same name as the Script
        10
        Click here.
        11
        Click "Save"

        Debug Console

        12
        Click "Debug Log" to access the console, all scripts can print to the console using the console.log function