3 the datalogger instruction, The datalogger instruction – Campbell Scientific SDM-CAN Datalogger to CANbus Interface User Manual

Page 22

Advertising
background image

SDM-CAN Datalogger-to-CANbus Interface


Data stored in packets on the CAN-Bus can be encoded in a number of
different ways. The SDM-CAN itself can cater for many different types of
data, but there are some limitations imposed by the way in which the data
is stored in the datalogger. The prime limitation is that data read into the
datalogger is first converted into a 4 byte floating point format which can
only resolve, at most, 23 bits, or roughly 7 digits, of the decimal equivalent
of any number stored. Furthermore, when data is stored to final storage,
the resolution is truncated again to either 4 or 5 digits (with the exception
of the CR5000/9000 dataloggers which also support storage in IEEE4
format).

To avoid over-running the datalogger’s internal floating point resolution,
the maximum length of integer that the SDM-CAN can send or receive is
therefore limited to 16 bits. This limited resolution can cause problems
when reading CAN data where data is encoded as 32 or 64 bit integers.

The simplest solution, in those cases, is to read the value as a series of 16
bit integers written to separate input locations in the datalogger. These can
then either be combined once the data has been recovered to a computer
or, if some of the resolution is not needed, the data values can be
combined in the datalogger using its normal maths functions. You must
bear in mind, however, the limitations of the 4-byte floating point
calculations and the output resolution of the datalogger.

The CAN standard also allows some types of data to be spread across
several data packets, where those data packets all have the same identifier.
Such data normally would consist of fixed identifiers stored as ASCII data,
which do not normally have to be logged. Reliably capturing such data
with the SDM-CAN is not possible, with the current software, unless the
sequential packets are transmitted relatively slowly. Please contact
Campbell Scientific for further information if you have a requirement to
do this.

3) When transmitting CAN frames from the SDM-CAN there are situations

where some frames are not transmitted. This is because the SDM-CAN has
a two layer buffer for transmitted frames. This allows a frame to be
transmitted whilst a new frame is being built. However if your program
tries to send frames too quickly, before earlier frames are sent, the frames
will be overwritten and lost.

This scenario generally does not happen with CR10X / CR23X loggers as
they are not fast enough. But with the CR5000 / CR9000 loggers it is
possible to overrun the double buffer especially in pipe line mode if you
are transmitting more than 2 frames per scan. It is recommended to use
sequential mode in this case as it allows a delay between CAN-BUS
instructions.

3.3 The Datalogger Instruction

The instruction used by all of the dataloggers covered in this chapter is
Instruction 118. The structure of the instruction and parameter types is shown
below. This structure is given in the same format that normal instructions are
shown in the datalogger manuals. Please refer to the datalogger manual for a

14

Advertising