Przejdź do głównej zawartości

Appendix E: Saving Data to Memory Card

Ta treść nie jest jeszcze dostępna w Twoim języku.

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).

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_MM

Where:

  • YYYY – year
  • MM – month

In this subfolder, for each day of the month, a file is created with the name in the format:

YYMMDDII.EEE

Where:

  • YY – the last two digits of the year
  • MM – month
  • DD – day of the month
  • II – 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.

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.

BytesFieldRange of ValuesDescription
0 – 3Time mark0 – 4294967295Number of seconds since midnight 1.01.1970 UTC+00
4 – 7Service record code4294967295Indicator for distinguishing from other types of records
8 – 11Message type00 – losses due to repetitive errors
12 – 15Message0 – 4294967295For loss reporting - the number of bytes
BytesFieldRange of ValuesDescription
0 – 3Time mark0 – 4294967295Number of seconds since midnight 1.01.1970 UTC+00
4Parameter type0 – 19, 128 – 147Bits 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)
5Device ID1 – 247Device address from which the data was received
6 – 7Parameter address0 – 65535The address on the device where the data was read
8 – 11Parameter value-2147483648 – +2147483647The value converted to a signed 32-bit integer
12 – 13First register read0 – 65535Data read from the device before being converted to a parameter value
14 – 15Second register read0 – 65535Used for parameter types that occupy two registers

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.

FieldDescription
1 DateDate when the parameter value was received
2 TimeTime when the parameter value was obtained (in the time zone of the device)
3 Parameter valueThe value converted to a signed 32-bit integer
4 Data typeText entry of the type similar to that used in the task file (see Appendix C)
5 Parameter addressThe address on the device where the data was read
6 Register tableOne symbol representing a table on the device: H – storage registers; I – input registers; D – discrete inputs; C – flags
7 IdentifierDevice address from which the data was received
8 Data lossesThe number of bytes that could not be written and that were removed from the write queue before creating this record. 0 - no losses
9 CommentAn 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

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:

  1. 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)
  2. 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.

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:

  1. Enter the parameter settings (see section 5.3.3 of the manual)
  2. Go to the “Files” tab
  3. Select the transition to “Export settings”
  4. To export to a file, click the “Export” button
  5. To import the settings back from the file, click the “Import” button

The file can be up to 16 kB in size.

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.

EM-486 can update the firmware (see Appendix G - Firmware Update) with one of three files:

  • UPGRADES\EM486FW1.DAT
  • UPGRADES\EM486FW2.DAT
  • UPGRADES\EM486FW3.DAT

Files can be up to 10 MB each in size.