Custom Historical Logging

eWON already embeds a powerful historical logging feature. So in most of the cases you should use this feature to store your historical data.
Using the embedded historical logging of the eWON also allows simple synchronization of the data with a centralized server using the DataMailbox or eSync for example.

However, for some projects, it may be required to store other types of data (strings for example) or to store the data in another format. In this case you may need to script the logging by your own. Using scripting you'll create files inside the /usr directory of the eWON and insert/append data into these files.

Discover more in the programming section.

Basic Script example:

Rem timer of 600 seconds --> 10 min
TSET 1,600
ONTIMER 1, "Goto EVENT_TIMER"

Rem close file in case it is still opened
CLOSE 1

Rem Write file header
OPEN "file:/usr/db.txt" FOR BINARY OUTPUT AS 1
	PUT 1,"TimeStamp;Tagname;Value" + CHR$(13)+ CHR$(10)
CLOSE 1
END

EVENT_TIMER:

OPEN "file:/usr/db.txt" FOR BINARY APPEND AS 1
PUT 1,TIME$ + ";" + "Tank1" + ";" + STR$ Tank1@ + ";" + CHR$(13)+ CHR$(10)
CLOSE 1