Configuration Commands
-
io.readfile (file)
-
Reads the entire file at once.
-
Returns the file contents as a string on success or nil on error.
-
-
io.writefile (file, data)
-
Writes the given data to a file.
-
Data can be either a value convertible to a string or a table of such values.
-
When data is a table, each table item is terminated by a new line character.
-
Returns a Boolean indicating the write result (whether the file can be opened for writing) or nil if the file cannot be accessed.
-
USB flash drive:
-
Supports FAT, FAT32, and NTFS file systems.
Send and receive SMS messages via USB GSM adapter:
-
Use USB data modem.
-
Plug the modem into the USB port of the controller; it will start operating immediately.
-
Specific functions should be added to the user script library, including PIN code settings and a telephone number whitelist for sending and receiving SMS messages.
Command syntax for SMS:
-
To change an object value using SMS or read an object value via SMS request, follow the format below:
-
Write to bus:
-
SMS command format:
W ALIAS VALUE
-
-
Read from bus:
-
SMS command format:
R ALIAS
-
On read request, the script will reply with an SMS message containing the current value of the selected object.
-
-
ALIAS can be:
-
Group address (e.g., 1/1/1)
-
Name (e.g., Obj1). If the name contains spaces, escape it using double quotes (e.g., Room temperature).
Object data type and name:
-
Set in the Configurator → Objects tab.
-
Without proper configuration, the script will not be able to read from or write to the object.
-
Only ASCII symbols are accepted in the message.
-
For more details on sending SMS, refer to the application note document AN011 (Application Notes).