C.4.2 finding the start bit – Campbell Hausfeld SDM-CAN User Manual

Page 57

Advertising
background image

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

3

P
2

P
1

R
1

D
P

P
F
8

P
F
7

P
F
6

P
F
5

P
F
4

P
F
3

P
F
2

P
F
1

P
S
8

P
S
7

P
S
6

P
S
5

P
S
4

P
S
3

P
S
2

P
S
1

S
A
8

S
A
7

S
A
6

S
A
5

S
A
4

S
A
3

S
A
2

S
A
1

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

1

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

Advertising