What is it?

The data loggers made by Campbell Scientific store their data in a proprietary binary file format. The physical support is either a memory card or it is transmitted via a GSM modem, etc The tools presented here is an open source tool (covered by the GPL license) that allows to extract the data contained within these binary files. The output can be formatted to suit your needs and you can very precisely control how much data you want to extract

How to use it?

This is a command line program. Running it with the "-h" option shows a quick help explaining which options are available. Namely, the following options can be used:

  • -c Compatibility: produces the same amount of output as tob32
  • -a Extract data from all valid frames
  • -d [delimiter] Use [delimiter] as a field delimiter in the output
  • -h Show this help
  • -l Show the license
  • -n Number of invalid frames triggering a full stop (0=never stop)
  • -t Style to use for the output (grace, tob32, excel, sql)
  • -o [output] Output data to file [output]
  • -s Sort the output in chronological order (if necessary) (TODO)
  • -p Use stdin as input data
  • -k Do not output sub-seconds if equal zero
  • -z Copy valid frames to the output, as binary

Some explanations might be needed... First, you have to know that all data is enclosed within frames in such a binary file. A frame contains a header (frame timestamp, etc), a data segment (the data we are interested in) and a footer (flags, validation code...). This figure shows such a structure. A frame might contain several physical timestamps, they will be calculated by camp2ascii if needed. At first, when inserting a new memory card, the data logger fills the card with one big file that contains only empty/invalid frames. Then, when doing the data acquisition, the frames are filled and marked as valid frames. If the memory card gets full, the data logger will write over the begining of the file. The "-c" option forces the extraction of frames according to what the original tool would do (thus not outputing all valid frames). On the other hand, the tools usualy given by Campbell Scientific don't output all the frames, specifically when the begining of the file has been written over. Because extracting all the frames would show the (potentially) newest data first (at the begining of the file) and then the older one (not yet written over by the data logger), the "-s" option allows you to ask for a sorted extraction: the old section of the file is extracted first, then a new pass is done in order to extract the newest section of the file.

Where to get it?

Here! Currently, only the source code is distributed. Soon, binaries will also be given. Please be aware that some data types are not supported so far: "FP4" is still in progress (an example file is needed) while "UINT4", "INT2" and "BOOL2" need a final validation (example file needed here too). So, if you can send me files containing these data types, I would surely appreciate!

0.99.52007-10-12Changelogsupport for TOB1 format, more data types support, some cleanup and speed optimizations
0.972007-09-13Changelogcleaner data types processing, speed optimizations
0.92007-09-03Changelogbug fixes, more datatypes (big thanks to Andrea Pitacco for his sample files!)
0.852007-06-25ChangelogInitial release

A graph showing the function calls in this code is available here. It should be a good way to get a feeling on how the code is organized.

How to contribute?

What is currently the most needed is some binary files containing the datatypes that are not currently supported (such as fp4, uint4, int2 and bool2). All these files would allow to validate the code processing these data types. Please send your comments and offers for example files to bavay at slf dot ch. If you happen to stumble accros a file that is not correctly read with this tool (for minor frames issues, etc), please consider sending me the file so I could fix camp2ascii!