Campbell Scientific CR5000 Measurement and Control Module User Manual
Page 157

Section 7. Measurement Instructions
7-31
CANBUS (Dest, SDMAddress, TimeQuanta, TSEG1, TSEG2, ID, DataType,
StartBit, NumBits, NumVals, Multiplier, Offset)
The CANBUS instruction is used to measure and control the SDM-CAN 
interface. 
Multiple CANBUS instructions may be used within a program. The initial 
function of the instruction is to configure the SDM-CAN interface when the 
datalogger program is compiled. Subsequent instructions can be used to 
determine what data is passed between the CAN-bus network and the 
datalogger, set and/or read the SDM-CAN's internal switches, and read and/or 
reset detected errors. 
The SDMTrigger instructioncan be used to trigger simultaneous measurements 
from one or more SDM-CANs and other SDM devices connected to the 
datalogger. When the SDMTrigger instruction is encountered in a program, it 
broadcasts a special SDM message which causes all the SDM-CAN devices to 
copy the last data values captured from the CAN-bus into the working data 
buffers. Refer to the SDM-CAN manual for additional help. 
The CANBUS instruction has the following parameters:
Parameter 
& Data Type 
Enter
Dest 
 
The Dest parameter is a variable array in which to store the results of the 
measurement. It must be an array of sufficient size to hold all of the values 
that will be returned by the function chosen (defined by the DataType 
parameter). 
SDMAddress
The SDMAddress parameter defines the address of the SDM-CAN with 
which to communicate. Valid SDM addresses are 0 through 14. Address 15 
is reserved for the SDMTrigger instruction. 
The SDM address is entered as a base 10 number, unlike older, jumper-
settable SDM instruments that used base 4. 
TimeQuanta 
 
Three time segments are used to set the bit rate and other timing parameters 
for the CAN-bus network, TimeQuanta, TSEG1, and TSEG2. These 
parameters are entered as integer numbers. The relationship between the 
three time segments is defined as: 
t
t
t
t
bit
q
TSEG
TSEG
=
+
+
1
2
The first time segment, the synchronization segment (S-SG), is defined by 
the TimeQuanta parameter. To calculate a suitable value for TiimeQuanta, 
use the following equation: 
TimeQuanta
t
q
=
* *
8 10
6
where tq = the TimeQuanta. There are between 8 and 25 time quanta in the 
bit time. The bit time is defined as 1/baud rate. 
TSEG1 
 
The second time segment, TSEG1, is actually two time segments known as 
the propagation segment and phase segment one. The value entered is 
determined by the characteristics of the network and the other devices on the 
network. It can be calculated as: 
T
t
t
SEG
TSEG
q
1
1
=
/
