Appendix a. principles of operation, A.1 data collection – Campbell Scientific SDM-CAN Datalogger to CANbus Interface User Manual

Page 53

Advertising
background image

Appendix A. Principles of Operation

A.1 Data Collection

The SDM-CAN operation is based on a number of sequential buffers. The
hardware has a dedicated CAN controller chip connected to a microprocessor
which analyses and processes the raw CAN data and then transmits it to the
datalogger.

When the CAN-Bus controller receives a good frame first of all it uses its
internal hardware to filter out the frames of no interest to the user. If the frame
ID satisfies the filter requirements then it allows the frame to be transferred to a
hardware FIFO. This FIFO can hold up to 3 CAN frames. Whenever data is in
this FIFO an interrupt mechanism will cause the SDM-CAN processor to read
the data from the CAN controller.

When the processor reads the CAN frame it will do a more detailed check to
see if the CAN frame ID is one of the ones required. This is because the
hardware filter only matches an overall pattern and may let some CAN frames
through that are not required. If the CAN frame ID is accepted, it will then be
placed into the ‘Working Buffer’ of a ‘Buffer Set’, which is made up of a set of
small buffers in memory, each set being dedicated to a specific packet ID.

The ‘Buffer Set’ consist of ‘some configuration data’, ‘ID Buffer’, ‘Working
Buffer’ and a ‘Read Buffer’. When the datalogger program is compiled it will
configure the buffers with a specific ID in the ‘ID Buffer’ and also set up the
buffer configuration. Many SDM-CAN instructions may share buffers because
the CAN frame ID and configuration is the same.

Each SDM-CAN instruction will create what is called a BIN within the SDM-
CAN. This BIN holds information such as which ‘data type’ to use, which
‘Buffer Set’ it should get the data from and where its ‘New data flag’ is located
plus a large amount of other information.

The ‘New data’ flags are set when new data arrives into the ‘Working Buffer’
of the ‘Buffer Set’. Because there could be multiple BINs using one ‘Buffer
Set’ there will be multiple ‘New data’ flags as well, so all the relevant ‘New
data’ flags will be set at the same time. When the datalogger program reaches a
point where it needs to read the data, the SDM-CAN will first check the ‘New
data flag’. If this flag is clear, the datalogger will read the previous data value
unless the switch is set to detect/prevent multiple reads (see Section 3,
Programming CR10X, CR7 and CR23X Dataloggers to use the SDM-CAN) in
which case an over-range value is read (-99999 on some dataloggers). The
SDM-CAN will then clear the appropriate ‘New data’ flag relevant to the BIN
and instruction that requested the data. Because there is effectively one ‘New
data’ flag per call of P118 this means that you could read the same new data to
many different locations. However, you should be aware that different data
could be returned by the different calls of the instruction, as a new data frame
could be captured as the datalogger works through the program table. This
problem can be avoided by using the Global trigger function.

A-1

Advertising