XT2640 Operating Manual
13 July 2016
Page 129 of 187
23.7.7
EXPORTING
A
DATA
LOG
FROM
THE
INTERNAL
MEMORY
If the internal memory contains data log records then these may be exported to an external drive.
This is achieved by inserting the USB drive into the front panel port and pressing the EXPORT button next to the INT MEMORY area
on the data logging screen. After pressing this you are prompted to enter the desired file format (ASCII or BINARY), followed by the
desired filename (the extension is automatically provided), followed by a request to overwrite the file (only if it already exists on the
USB drive). The file transfer is then initiated, and the progress can be viewed in the status area on the lower part of this screen. The
resultant file always contains a header record.
Note:
Since a typical USB drive has a sustained write speed of 500Kbytes/sec (or possibly less) and the internal memory can
contain several Gbytes, this activity can take a very long time (possibly several hours or more).
Once started you do not need to stay on this screen, you can continue to use the XT2640 normally other than being unable
to import or export files and not being able to perform data logging.
If exporting to an ASCII format file then the resultant file will typically be 3x larger than the amount of internal memory
used. This might be more than the 4Gbyte file size limit for FAT32. In this case you should export the data in binary format
and externally convert it into ASCII using the supplied application.
23.7.8
INTERNAL
BUFFER
USAGE
The XT2640 has a large internal FIFO buffer (32Mbytes) which is used for data log data. This buffer serves two purposes‐
1.
If you are data logging to a file on a drive then it reduces the impact on data logging which inconsistencies in the write speed of
the drive may have, or if it has an insufficient sustained write speed.
2.
It allows you to insert a drive to save the data log data at any time; before, during or after performing the data log.
The progress bar shown in the lower portion of the Data Logging Configuration and Status screen shows how much of this buffer is
presently used and also the maximum amount which has been used.
Note:
Data stored into this memory always has a binary format; the amount of this memory used per data log record is given by
(4 bytes x number of data shown in the SELECT DATA button).
Data logging always saves the captured data into this internal buffer. At any time, if data has been stored in this internal
buffer and the drive is available and not busy, then data is written from this buffer to the drive with the format configured.
This memory is volatile, so turning off the XT2640 will lose any data stored in it.
If this buffer is overrun then data logging continues, but some records will be lost. It will always be entire records which
are lost if this occurs, not data within records, so the integrity of the resulting file is unaffected.
Because writing data to the drive can lag behind the rate at which data is being collected, data will continue to be saved to
the drive after data logging has been stopped manually or the configured run time has elapsed. Since the sustained write
speed of a USB Flash Drive may be <500Kbytes/sec and the buffer may contain up to 32Mbytes and the data written to the
drive can be several times larger than the data in the memory, this could continue for several minutes or more after
stopping data logging.
23.7.9
OPTIMIZING
AND
TESTING
FILE
WRITE
SPEED
Generally the XT2640 is not the limitation to the maximum achievable data logging rate to an external USB drive. The drive average
sustained write speed and the USB speed itself are typically the main limitations.
If the total data log will be less than 8Mdata then speed is not of concern as the internal buffer is large enough to accommodate this.
The internal memory in the XT2640 has a much faster average sustained write speed than external USB drives, but still needs to be
considered when logging at very high rates and with large data counts. The typical maximum sustained speed for the internal
memory is over 5Mbytes/sec (1.25Mdata/sec), so if data logging at the maximum rate (0.002sec or 500/sec) the maximum amount
of data per record which can be logged without record loss is 2500 data (higher at slower data logging rates).
Drives are not consistent in their timing; a typical drive will occasionally pause while writing data which will cause the buffer usage
bar to move in an inconsistent manner. It is recommended to perform a test data log to a drive before attempting to create a
substantial data log file to ensure that the drive can support the required average data write rate. This test run should be for at least
a few minutes.
If the drive will not support the required mean sustained write speed required for the desired data log interval and data then the
internal buffer will fill up and records will be lost.
To achieve the fastest sustained average write speed with an external USB drive the following recommendations are made‐
For most drives a large allocation unit size (or cluster size) will achieve the fastest sustained write speed. You may wish to
reformat the drive to have a larger allocation unit size than was present when purchased (16kbyte is recommended for
data logging). As an example the following results were obtained using a typical USB Drive (4Gbyte size, writing a 70Mbyte
file) –
4kbyte allocation unit (as purchased): 330kbytes/sec sustained speed (82.5Kdata/sec in binary format)
8kbyte allocation unit: 511kbytes/sec sustained speed (127.75Kdata/sec in binary format)
16kbyte allocation unit: 670kbytes/sec sustained speed (167.5Kdata/sec in binary format)
32kbyte allocation unit: 715kbytes/sec sustained speed (176.25Kdata/sec in binary format)
Note that these figures are far less than the published maximum write speed for this device (3Mbytes/sec), but
neither the bus speed nor the XT2640 were the limiting factors for the above tests.