Campbell Hausfeld SDM-CAN Network Card User Manual


 
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) 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.2 Frame Transmission
When the datalogger program is first run it will set-up the SDM-CAN BINs and
buffers. If the program has some P118 instructions that transmit to the CAN-Bus,
then some of the Buffers will be set-up for transmission. When an instruction
indicates that a transmission should take place, the datalogger first sends a BIN
number. This number tells the SDM-CAN which BIN to use and, from the
compile-time set up, what operation is required. In the case of transmission it
would expect frame data to be sent from the datalogger.
A-1