26
CONTENTS
7.6.1
Legacy functions
Legacy functions (written in CAPS) are executed in sequence with a "step delay" after them. The legacy functions
are designed so as to resemble the BASIC commands of the previous generations of EPCR/LPC controllers while
remaining compatible with the Lua language.
Arguments to the legacy functions can be written as e.g.
ON(12345678)
,
ON "12345678"
or
ON("12345678")
.
The supported legacy functions are:
•
ON
,
OFF
,
CYCLE
,
RESTORE
— perform the action on a list of outlets by numbers (as a number or a string);
•
BEEP(ON)
or
BEEP(on)
or
BEEP(true)
— turn beeper on;
•
BEEP(OFF)
or
BEEP(off)
or
BEEP(false)
or
BEEP(0)
— turn beeper off;
•
BEEP(number
>
0)
— turn beeper on for the specified number of seconds, then off;
•
SLEEP(number[,"unit"])
— suspend execution for the given amount of time (units default to "sec-
onds", but can be "seconds", "minutes", "hours" or "days"; abbreviations like "sec", "h", "d" are also accepted);
•
WAIT "cron time mask"
or
WAIT(minute_mask,hour_mask,day_mask,month_
←
-
mask,weekday_mask)
— wait for the local time to match the condition (each separate mask element
must be a number or
"
∗
"
, and a
"cron time mask"
must be a string of 5 such elements separated by
whitespace);
•
LOG "String"
— write a message to the system log
•
DISPLAY "String"
— display a string on the LCD when it's in outlet mode. The following strings are
expanded:
–
%%
— literal "%";
–
%o
— state of outlets, in the form "12456" (ON outlets are listed);
–
%O
— state of outlets, in the form "++-+++--";
–
%n
— serial number;
–
%f
— firmware version;
–
%d
— system time/date;
–
%M
— MAC address of the power controller;
–
%i
— IP address of the power controller;
–
%m
— IP network mask;
–
%g
— IP gateway;
–
\1
— move cursor to the beginning of line 1;
–
\2
— move cursor to the beginning of line 2;
–
\f
— clear screen;
–
\v
— clear end of current line;
•
WOL "MAC address"
— attempt to wake device with specified MAC address up using Wake-on-LAN
protocol (the device has to be in the same LAN segment);
•
TIME "server"
— synchronize time with server specified by IP address or hostname in quotes; you can
use
TIME()
without arguments to synchronize with "pool.ntp.org" if the DNS is configured correctly.
You still need to enclose the function contents in a
function name() ...
end
as explained above.
DLI LPC9 User’s Guide: 1.7.24.0
Summary of Contents for LPC9
Page 1: ...DLI LPC9 User s Guide 1 7 24 0 ...
Page 81: ......