Ju
ne
20
18
226 Legrand PDU User Guide
To write a Lua script, type the codes in the Source Code section.
To load an existing Lua script file, click Load Local File.
To use one of Legrand's Lua script examples, click Load Example.
Warning: The newly-loaded script will overwrite all existing codes in the Source Code section. Therefore,
do not load a new script if the current script meets your needs.
6. If you chose to load a script or Legrand's example in the previous step, its codes are then displayed in
the Source Code section. Double check the codes. If needed, modify the codes to meet your needs.
7. Click
Create.
Next steps:
To execute the newly-added script immediately, click
, or click
> Start with Arguments. See
Manually Starting or Stopping a Script
(on page 226).
To add more scripts, first return to the scripts list by clicking "Lua Scripts" on the top (see below) or in the
Menu
(on page 84), and then repeat the above steps.
Manually Starting or Stopping a Script
You can manually start or stop an existing Lua script at any time.
When starting a script, you can choose to start it either with its default arguments or with new arguments.
Tip: To have the Legrand PDU automatically start or stop a script in response to an event, create an event
rule. See
Event Rules and Actions
(on page 184) and
Start or Stop a Lua Script
(on page 204).
To manually start a script:
1. Choose Device Settings > Lua Scripts. The Lua scripts list displays.
2. Click the desired script whose state is either 'Terminated' or 'New.' For details, see
Checking Lua
Scripts States
(on page 228).
3. To start with default arguments, click
.