This script stores incoming data in a circular buffer. When new data arrive, old data is deleted. This is ideal for endless data logging, i.e. for error logging ("Black Box").
| Script name: | mr3-5.txt |
| Current version: | v 5 , dated from 18.06.2009 |
| Firmware: | v4.9 or higher required |
| Hardware: | Logger Box, Logger Module or Logger Cube. |
| History: | v 5: more robust when other files are on disk, pointer reset if empty disk inserted |
Power Up and Connect to your device as described
here in the User Manual section "First Steps".
Typically, this Script is not loaded when an Avisaro Logger product was purchased. Please see
here for details on how to load the script into the logger.
Other than loading the WR3 script and setting the baudrate, there is no configuration necessary.
Configure the RS232 port, such as baudrate and stop bits, as described
here using SD memory cards.
The logger is designed to start automatically:
3) The Logger starts automatically
After a power failure, the logger starts automatically, too.
To stop the logging process, press the push-button. Pressing the push-button again, the logging process will continue. Simply extracting the SD card will stop the logging process as well, however there is a chance that the last couple of bytes are lost.
All incoming data are stored in a file (i.e. "10000.txt"). A maximum file size, i.e. 1 Mbyte, is defined. As soon as the maximum file size is reached, the next file is opened ( "10001.txt" ). This is continued ( "10002.txt", ...) just until the memory card is full. If the new file reaches the number 99999.txt, the counter raps arround to 10000.txt again. This number scheme was choosen to allow easy sorting of the files.
When the memory card is full, the oldest file is deleted. The file to be deleted starts with 10000.txt, than 10001.txt, ... . When it reaches 99999.txt it raps around to 10000.txt again.
A memory card with 2 GByte of data and a maximum file size of 1 MByte will contain 2.000 files. For Example: If the new files to be created is named 21234.txt , the oldest file will be 19234.txt.
All files are stored in directory called "logs". This is because the root directory allows only to hold a limited number of files. A directory can hold an endless amount of files.
This behaviour is defined by the script MR3.txt .
Key:
Is used to stop and restart a logging process.
Green LED:
Indicates power up.
Red LED:
Indicates an ongoing log process. Flashing: data arrived and are written
The files are named as described above in a consecutive order. There is a "pointer" to the file numbers which are created and a "pointer" to the file numbers which are deleted. There are two things to note:
1) The "pointers" are stored in the device, not on on the SD card. When extracting and inserting a SD card, the "pointers" remain at the values as they are. Only when an empty SD memory card is inserted, the "pointers" are reseted.
2) To maintain proper file order, it is recommended to either delete all files, or no files when reading the logfiles.
The file size of each log file is coded into the script. This can be changed by editing the script - a regular editor can be used for that.
Open the script in an editor an go to line 7:
...
' rev.5 (c) Avisaro AG, 17.06.2009
'
' Enter here max file size (in Byte)
let m = 1000000
...
Edit line 7 with your preferred file size. The file size should not be smaller than 1 MByte (1000000) and should not be larger than 2 GByte (2000000000).