A.2 frame transmission – Campbell Scientific SDM-CAN Datalogger to CANbus Interface User Manual

Page 54

Advertising
background image

Appendix A. Principles of Operation

A-2

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.

On receiving the frame data from the datalogger the SDM-CAN will convert
and shift the data into the correct position and then place it into the read buffer
which is set as a 64 bit frame. Depending on your program, you could then
continue to build a frame or decide to transmit it onto the CAN-Bus. If you
have completed the building of a frame then you have the choice to either
transmit it onto the CAN-Bus or set it up as a Remote Frame Response. For the
transmitted frames, the SDM-CAN will set a flag in the buffer to indicate new
data is ready for transmission. The SDM-CAN will scan the buffers, checking
this flag in each buffer that is set for transmission. When it finds a flag that is
set, it will first check if the transmitter is busy, and if it is will wait until it is
free. The frame will then be transferred to the transmitter which will transmit it
onto the bus. Finally the transmit data flag will be cleared.

When a frame is set up for a remote frame response, the frame is transferred
into the working buffer ready for reception of a Remote Frame Request. When
a Remote Frame Request is received, and is accepted as a valid frame, the
SDM-CAN will find the relevant buffer, and will then set the data transmit
flag. From then on it will follow the normal frame transmission protocol as
described above.

Advertising