Campbell Hausfeld SDM-CAN Manual Do Utilizador

Página de 74
Appendix C.  Using SDM-CAN on J1939 Networks  
 
Table C-4  Mapping of J1939 Identifier Field values into a 29-Bit Identifier 
Bit 
28 
27 
26 
25 24 
23 
22 
21 
20 19 18 17 16 15 14 13 12 11 10
9 8 7 6 5 4 3 2 1 0 
SOF P 


R
D
P

P

P

P

P

P

P

P

P

P

P

P

P

P

P

P

S

S

S

S

S

S

S

S

Value 0 1 1 0 0 1 1 1 1 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0
 
This gives a binary value of 01100111100000000001100000000 that can then be 
converted to 217056000
10
 and used as the ID parameter. 
C.4.2  Finding the Start Bit  
The byte number of the Accelerator pedal position value is 2 
Table C-5  Accelerator Pedal Position Value Byte Number 
2 3 4 5 6 7 8 
87654321 
87654321 87654321 87654321 87654321 87654321 87654321 87654321 
 
The start bit for this value is 49, as it is the least significant bit of the data value 
within the data frame that this parameter refers to.  
An example for Accelerator pedal position is shown below. 
'Set scan rate 
Const PERIOD = 1                     'Scan interval number 
Const P_UNITS = 2                    'Scan interval units (Secs)
 
'\\\\\\\\\\\\\\\\\\\\\\\\\ CANBUS CONSTANTS ////////////////////// 
'------------------- Physical Network Parameters ----------------- 
Const TQUANT = 4                     ')Set SDM-CAN to 250K 
Const TSEG1 = 5                      ')Network speed 
Const TSEG2 = 2                      ') 
'---------------------- Data Frame Parameters -------------------- 
'___________________________CANbus Block1_________________________ 
'Collect and retrieve 16 bit data value 
'Data type 2, unsigned integer, least significant byte first  
Const CANREP1 = 1                 'Repetitions 
Const ADDRESS1 = 0                'SDM address of SDM-CAN 
Const DATATYPE1 = 2               'Collect and retrieve data values   
Const STARTBIT1 = 49              'Start position in data frame 
Const NUMBITS1 = 8                'Number of bits/value 
Const NUMVALS1 = 1                'Number of values  
Dim CANBlk1(CANREP1)              'Dimensioned source 
C-3