EasyManuals Logo

Embedded Systems LM5p-GSMC User Manual

Default Icon
291 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #108 background imageLoading...
Page #108 background image
108
1.
value = knxdatatype.decode(event.datahex, dt.bool)
2.
data =string.format('%s value is %s', os.date('%c'), tostring(value))
3.
-- write to the end of log file preserving all previous data
4.
file =io.open('/mnt/usb/log.txt', 'a+')
5.
file:write(data .. '\r\n')
6.
file:close()
Output:
Mon Jan 3 05:25:13 2011 value is false
Mon Jan 3 05:25:14 2011 value is true
Mon Jan 3 05:25:32 2011 value is false
Mon Jan 3 05:25:33 2011 value is true
Example: Read data from file (config in format key=value)
1.
for line inio.lines('/mnt/usb/config.txt')do
2.
-- split line by '=' sing
3.
items = line:split('=')
4.
-- two items, line seems to be valid
5.
if #items == 2 then
6.
key = items[1]:trim()
7.
value = items[2]:trim()
8.
alert('[config] %s = %s', key, value)
9.
end
10.
end
6.2.21. Script control functions
script.enable('scriptname')
Enable the script with the name scriptname.
script.disable('scriptname')
Disable the script with the name scriptname.
status = script.status('scriptname')
Returns true/false if script is found, nil otherwise
6.2.22. JSON library
Note: json is not loaded by default, use require('json') before calling any functions from this
library.
json.encode (value)

Table of Contents

Other manuals for Embedded Systems LM5p-GSMC

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Embedded Systems LM5p-GSMC and is the answer not in the manual?

Embedded Systems LM5p-GSMC Specifications

General IconGeneral
BrandEmbedded Systems
ModelLM5p-GSMC
CategoryDimmer
LanguageEnglish

Related product manuals