B.1 byte pairs, B.2 file structure, B.3 program files – Campbell Scientific CSM1 Card Storage Module User Manual

Page 23: B.4 data pointers

Advertising
background image

B-1

Appendix B. Internal Data Formats and
Pointers in the Card Memory

Knowledge of the format in which data is stored in the card memory is not normally
necessary to use the CSM1. However, if you intend to save text files in the card or need to
try to extract corrupted data, the following information may be useful.

B.1 Byte Pairs

All data stored in the card is stored in byte pairs. If you transmit a file to the
module that has an uneven number of bytes, the remaining odd byte at the end
of the file is filled with an ASCII null (0 Hex) character.

B.2 File Structure

Data files are delimited in the card using markers called filemarks. A filemark
is written to the card when either a CSM1 with card is powered up or if a card
is plugged into a CSM1 that is powered up. Filemarks can also be written into
a card under software control in telecommunications mode or with some
dataloggers. Filemarks are also written into the card, with dataloggers that fully
support the Storage Modules, when a program is recompiled in the datalogger.
A filemark is not written into the card if a filemark already exists in the
preceding data location.

A filemark is the byte pair 7C 01 Hex stored in the card. If you send this
sequence to the CSM1 as data it is interpreted as a filemark.

To allow for future developments the CSM1 always places a filemark in the
first location in a card during the process of erasing a card. It is necessary to
jump over this filemark, by placing the display pointer at location 2, before
you can read the first data file in the card.

B.3 Program Files

Datalogger programs are stored in the card in the next available area of
memory (as would be new data). Datalogger programs always start with the
byte sequence 011111101 XXXXXXXX 1XXXXXXX (X = don't care). A
filemark may also be found before this sequence if no data has been stored in
the card since the card was last powered down. To enable the CSM1 to find
each program quickly without having to scan through the whole card, the card
holds a record (in the reserved memory) of where each program starts.

B.4 Data Pointers

256 bytes of the card are reserved to hold working data relevant to the
management of data in the card. Within this area are stored three pointers you
can observe or control via the status line:

Advertising