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 #133 background imageLoading...
Page #133 background image
133
6.4.1. Export logs
Example
Once an hour, make CSV file with all objects logs and send to external FTP server with IP

In Scripting -> Scheduled add the script which will run once an hour
Add the following code in Script editor for this particular script.
1.
require('socket.ftp')
2.
3.
-- ftp file
4.
ftpfile=string.format('ftp://ftplogin:ftppassword@192.168.1.11/%s.csv', os.date('%Y-%m-
%d_%H-%M'))
5.
-- get past hour data (3600 seconds)
6.
logtime=os.time() - 60*60
7.
8.
-- list of objects by id
9.
objects ={}
10.
11.
-- objects with logging enabled
12.
query ='SELECT address, datatype, name FROM objects WHERE disablelog=0'
13.
for _, object in ipairs(db:getall(query)) do
14.
objects[tonumber(object.address)]={
15.
datatype=tonumber(object.datatype),
16.
name =tostring(object.name or''),
17.
}
18.
end
19.

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