Appendix E: Saving Data to Memory Card
Цей контент ще не доступний вашою мовою.
1. General Data
Section titled “1. General Data”The EM-486 supports microSD compatible memory cards formatted in FAT/FAT32. Only the first volume of the card is used (the maximum usable capacity on the card is 32 GB). The card can be inserted before powering on the device or while the device is in operation.
EM-486 uses a memory card for the following actions:
- Reading task files with programmable logic of work
- Logging of collected data
- Export and import of settings
- Firmware updates
- Navigation on the memory card, downloading and uploading files through the WEB-interface
When the device is started or when a memory card is inserted, its parameters and firmware update files are checked (it may take up to 30 seconds). After that, the card can be used for other actions.
When the device is restarted, when the supply voltage drops below the value specified in the settings (see register 724 in Appendix D), EM-486 safely ejects the memory card, saving temporary data and closing open files.
2. Reading Task Files with Programmable Logic of Work
Section titled “2. Reading Task Files with Programmable Logic of Work”EM-486 reads task files from the “TASKS” folder and its subfolders on the memory card (see Appendix C - Task Files).
3. Logging of Collected Data
Section titled “3. Logging of Collected Data”EM-486 saves the collected data to the log in the “LOGS\TASKS” folder on the memory card. The order of data collection and conditions for logging are specified in the task files (see Appendix C). If the folder is missing, it will be created.
For each month, a subfolder is created with a name in the format:
YYYY_MMWhere:
YYYY– yearMM– month
In this subfolder, for each day of the month, a file is created with the name in the format:
YYMMDDII.EEEWhere:
YY– the last two digits of the yearMM– monthDD– day of the monthII– index. The data is appended to the end of the current file. A new file with the next index is created when the file is filled up to the maximum size (specified in the settings, from 1 KB to 64 MB, see register 726), in case of an error writing to the file, removing the memory card or restarting the device. Before creating the file, the presence of files in the subfolder with names for the given day of the month is checked, and the maximum occupied index is found. Files are numbered starting from 01. The first 99 indices are numeric. After 99 indices follow A0…A9, AA…AZ, B0…ZZ. In total, up to 1035 indexes can be used for one day of the month, after which the recording can be suspended until the date changes (the beginning of the next day)EEE- file extension “CSV” or “DAT” (depending on settings, see register 725)
In the event of write errors, data remains in the write queue in temporary memory, and write attempts continue until the data is written or remains in the queue for more than 10 minutes. After that, the data is removed from the write queue, while the number of bytes that could not be written is added together, and this information about losses can be added to the log later.
3.1 Logging to Data Bytes Files
Section titled “3.1 Logging to Data Bytes Files”When the byte log format is selected, the EM-486 saves the collected data in a compact form to files with the “DAT” extension. Records of a fixed size of 16 bytes are appended to the files. Each record can contain the value of one parameter or a service message.
Service Record Format
Section titled “Service Record Format”| Bytes | Field | Range of Values | Description |
|---|---|---|---|
| 0 – 3 | Time mark | 0 – 4294967295 | Number of seconds since midnight 1.01.1970 UTC+00 |
| 4 – 7 | Service record code | 4294967295 | Indicator for distinguishing from other types of records |
| 8 – 11 | Message type | 0 | 0 – losses due to repetitive errors |
| 12 – 15 | Message | 0 – 4294967295 | For loss reporting - the number of bytes |
Parameter Record Format
Section titled “Parameter Record Format”| Bytes | Field | Range of Values | Description |
|---|---|---|---|
| 0 – 3 | Time mark | 0 – 4294967295 | Number of seconds since midnight 1.01.1970 UTC+00 |
| 4 | Parameter type | 0 – 19, 128 – 147 | Bits 0–6: Parameter type index (6 - parameter in the bit table (flags and digital inputs); other values - in the register table (storage and input), see Appendix C). Bit 7: 0 - parameter from the table for reading and writing (flags, storage registers); 1 - parameter from the table is read-only (discrete inputs, input registers) |
| 5 | Device ID | 1 – 247 | Device address from which the data was received |
| 6 – 7 | Parameter address | 0 – 65535 | The address on the device where the data was read |
| 8 – 11 | Parameter value | -2147483648 – +2147483647 | The value converted to a signed 32-bit integer |
| 12 – 13 | First register read | 0 – 65535 | Data read from the device before being converted to a parameter value |
| 14 – 15 | Second register read | 0 – 65535 | Used for parameter types that occupy two registers |
3.2 Logging to Text Table Files
Section titled “3.2 Logging to Text Table Files”In a case of select the tabular format of the log, EM-486 saves the collected data in text form to files with the “CSV” extension. Records are added to the files in the form of text strings consisting of fields of variable length, separated by the character selected in the settings (see register 725). Lines are separated by a standard pair of characters (CR + LF for line feed). The maximum record length without adding a comment to the end of the line is 70 bytes. When using the logging command with a comment, the maximum line length depends on the format of the comment line and can be up to 200 bytes plus the length of the values substituted into the comment.
Text Table Record Format
Section titled “Text Table Record Format”| Field | Description |
|---|---|
| 1 Date | Date when the parameter value was received |
| 2 Time | Time when the parameter value was obtained (in the time zone of the device) |
| 3 Parameter value | The value converted to a signed 32-bit integer |
| 4 Data type | Text entry of the type similar to that used in the task file (see Appendix C) |
| 5 Parameter address | The address on the device where the data was read |
| 6 Register table | One symbol representing a table on the device: H – storage registers; I – input registers; D – discrete inputs; C – flags |
| 7 Identifier | Device address from which the data was received |
| 8 Data losses | The number of bytes that could not be written and that were removed from the write queue before creating this record. 0 - no losses |
| 9 Comment | An empty field or comment line if the entry was created by a logging command with a comment. It is not recommended to include the table field separator character in the comment |
3.3 Filling the Memory Card
Section titled “3.3 Filling the Memory Card”The time it takes for an empty memory card to be full can be calculated using the formula:
Tfull ≈ (Vfree × Tnew) / (Npar × Lsiz)
Where:
- Tfull – The time it takes for an empty memory card to be full
- Vfree – free space on the memory card
- Tnew – update time of parameter values (see Appendix C)
- Npar – the number of parameters to be logged (if the record is made with each update)
- Lsiz – the size of the log entry depending on its format
Examples:
- When writing 7 parameters to the log in data byte format every 20 seconds - 2 GB card will be filled in 383479222 s (or more than 12 years)
- When writing to the log in a tabular format (no comments) 3 parameters 10 times per second - the volume of 32 GB can be filled in 16361780 s (or more than 6 months)
When the logger mode is turned on (see register 727), after the free space on the memory card is exhausted, the oldest files can be deleted before writing new data. When the recorder mode is off, new data recording will be paused until space becomes available.
4. Export and Import Settings
Section titled “4. Export and Import Settings”EM-486 can export the saved settings from the internal memory to the “SETTINGS\EM486SET.DAT” file, or import the settings from this file and save them to the internal memory.
To export or import settings:
- Enter the parameter settings (see section 5.3.3 of the manual)
- Go to the “Files” tab
- Select the transition to “Export settings”
- To export to a file, click the “Export” button
- To import the settings back from the file, click the “Import” button
The file can be up to 16 kB in size.
5. Saving Pulse Counters
Section titled “5. Saving Pulse Counters”EM-486 can save pulse counters at inputs in the “LOGS\COUNTERS” folder on the memory card. Files with names similar to the names of the log files in the data byte format are created in this folder (see Section 3). The size of each record is 24 bytes. The file size limit is 256 kB. When reading counters from a memory card after starting the device, the old files can be deleted if their number exceeds 3 files.
6. Firmware Updates
Section titled “6. Firmware Updates”EM-486 can update the firmware (see Appendix G - Firmware Update) with one of three files:
UPGRADES\EM486FW1.DATUPGRADES\EM486FW2.DATUPGRADES\EM486FW3.DAT
Files can be up to 10 MB each in size.