Data collection, 1 datalogger storage organization, Datalogger storage organization – Campbell Scientific Java PakBus Software Development Kit User Manual
Page 15

Java PakBus® Software Development Kit
System.out.println("The round trip time was " +
transaction.get_round_trip_time() + " msec");
}
else
System.out.println("clock check/set failed");
complete = true;
}
}
Note that our example has become somewhat of a boiler-plate. We replaced the
GetTableDefsTran with a new ClockSetTran. We also made a few
modifications so that the
run() method will exit after the complete flag is set
and the low level links are shut down.
When the transaction is complete, the application can access some transaction
specific information by calling
get_logger_time(). This method will return an
object of type
LoggerDate. This class maintains a time stamp in terms of
nanoseconds elapsed since midnight 1 January 1990 and can be easily
converted to the more standard
java.util.GregorianCalendar object (although
precision will be lost). This class is used anywhere in the API where time
information needs to be stored or reported. Note that the example also invoked
get_round_trip_time() to determine the amount of time required for the
exchange of transaction messages. This is available for all transactions but is of
particular value in determining the current datalogger time.
5. Data Collection
Data collection adds the largest number of “helper” classes to the API. These
helpers include meta-classes like
class TableDef and class ColumnDef and
concrete classes like
class Record. In order to understand how data collection
works, we must first discuss how Campbell Scientific dataloggers that
implement the PakBus® protocol store their data.
5.1 Datalogger Storage Organization
The programs that execute on PakBus® dataloggers can organize the final
storage memory of the datalogger (as well as its card storage if the datalogger
is equipped with a card interface) into various tables. Each table thus created
has the following attributes:
•
A unique name
•
An estimated size (number of records)
•
An output interval (an event driven table would specify an interval of
zero)
•
A collection of columns
The columns of the output table will be specified by various output processing
instructions in the datalogger program. These columns are described as pieces
of array objects (a scalar value can be defined as an array having one element).
Each column has a name, data type, units string, process string, array
dimensions, beginning linear index, and piece size. The storage size of a record
can be calculated by adding up the storage requirements for all of these
“pieces”.
7