Specifications
Section 7. Measurement Instructions
Parameter
& Data Type
Enter
NumBits
The NumBits parameter is used to specify the number of bits that will be
used in a transaction. The number can range from 1 to 64 (there are 64 bits
in a CAN data frame).
The SDM-CAN can be configured to notify the datalogger when new data is
available by setting a control port high. This allows data to be stored in the
datalogger tables faster than the program execution interval. This interrupt
function is enabled by entering a negative value for this parameter.
Note: This parameter may be overridden by a fixed number of bits,
depending upon the data type selected.
NumVals
The NumVals parameter defines the number of values (beginning with the
value stored in the Dest array) that will be transferred to or from the
datalogger during one operation. For each value transferred, the Number of
Bits (NumBits) will be added to the Start Bit number so that multiple values
can be read from or stored to one data frame.
Mult, Offset
The Mult and Offset parameters are each a constant, variable, array, or
expression by which to scale the results of the measurement.
If more than one Canbus Instruction is used within a datalogger
program, the values used for TimeQuanta, TSEG1 and TSEG2
must be the same for each instruction.
NOTE
CANBUS Example
The following example reads a 16-bit engine speed value from a CAN-bus
network running at 250K baud.
'Set Scan Rate
Const Period=1
Const P_Units=2
' \ \ \ \ \ \ \ \ \ \ \ \ CANBUS Constants / / / / / / / / / / / /
'------------------------- Physical Network Parameters ------------
'Set SDM-CAN to 250K
Const TQUANT=4
Const TSEG1=5
Const TSEG2=2
'------------------------ Data Frame Parameters -------------------
'___________________ Canbus Block1_____________________
'Collect and retrieve 16-bit data value
'Data Type 1, unsigned integer, most significant byte first
Const CANREP1=1 'Repetitions
Const ADDR1=0 'Address of SDM-CAN module
Const DTYPE1=1 'Data values to collect
Const STBIT1=33 'Start position in data frame
Const NBITS1=16 'Number of bits per value
Const NVALS1=1 'Number of values
Const CMULT1=0.4 'Multiplier
7-39