Starter Control module template for creating a new PIXERA module.
NewModule provides the standard module lifecycle structure, including reference forwarding, initialization locking, helper loading, property loading, and clean uninitialization. It is intended as a base module that can be customized with additional libraries, properties, actions, drivers, tickers, schedulers, or device-specific logic.
Usage
Use NewModule as the starting point for a custom Control module.
The module includes the common init and uninit lifecycle actions and a ref action for forwarding calls through the node system. The Description property should be updated to describe the finished module's purpose, functionality, configuration, and operational notes.
For a step-by-step introduction to creating modules, see How to Build a Module From Scratch.
Setup
- Add NewModule to the project and rename it for its intended purpose.
- Update the
Description,Author,Documentation, andVersionproperties where required. - Add configuration properties and actions for the new module.
- Add startup code to
initand the corresponding cleanup code touninit. - Run
initmanually or enableAuto Init.
Keep the code that resets self.isInit and self.lockInit at the end of uninit so the module can recover from an interrupted initialization.
Features
NewModule already includes the basic structure commonly needed by a new module:
-
refreturnsself()so action calls can be forwarded through connected module references. -
initblocks overlapping asynchronous initialization calls withself.lockInit. -
initcallsuninitfirst when the module is already initialized. -
initloadspixcHelperand createsself.helperfor helper functions such as property access and logging. -
initloads all configured properties intoself.propertieswithself.helper:loadAllProperties(). -
initcontains a marked section for custom startup logic. -
uninitclears helper and property references and resets the initialized and init-lock states. -
uninitcontains a marked section for unloading variables, tickers, schedulers, drivers, connections, or other runtime resources.
The existing init lock prevents overlapping asynchronous initialization calls. If init is called while the module is already initialized, it calls uninit first and then continues with initialization.
Actions
| Action | Info | Input | Output |
|---|---|---|---|
| ref | Returns a reference to the module instance for forwarding action calls by name through the node system. | - | self |
| init | Initializes the module, prevents overlapping init calls, unloads an existing initialization if needed, loads the PIXERA helper, loads all properties into self.properties, and sets the initialized state. |
- | - |
| uninit | Unloads helper and property references and resets the initialized and init-lock states. Extend this action to disable custom runtime resources. | - | - |
Properties
| Name | Content | Type Hint | Options Source | Options Action |
|---|---|---|---|---|
| Auto Init | true | bool | - | - |
| Description | Enter a description for this Module. Use this field to provide information about its purpose, functionality, configuration, or any relevant operational notes. This description helps users understand how and when the Module should be used. | string | - | - |
| Author | AV Stumpfl GmbH | string | - | - |
| Logo | Embedded PIXERA logo | image | - | - |
| Documentation | 3875559 | documentation | - | - |
| Version | 1.2 | string | - | - |
Changelog
- 1.2
- Corrected the internal action paths to use the
NewModulename. - Updated the initialization code to follow the current Lua formatting standard.
- Added the explicit string type to the
Descriptionproperty.
Module Version 1.2 | 29 July 2026 | AV Stumpfl GmbH
