SDM-CAN CAN-Bus Interface User Guide
'\\\\\\\\\\\\\\\\\\ ALIASES & OTHER VARIABLES //////////////////
Alias CANBlk1(1) = Accel_Pedal 'Assign an alias name to CANBlk2(1)
'\\\\\\\\\\\\\\\\\\\\\\\\\\\ PROGRAM ///////////////////////////
BeginProg 'Program begins here
'MainSequence
Scan(PERIOD,P_UNITS,0,0) 'Scan once every 1 Secs, non-burst
'__________________________ CAN Blocks __________________________
'Retrieve Accelerator pedal position Data from CAN network
CanBus(CANBlk1(),ADDRESS1,TQUANTA,TSEG1,TSEG2,217056000,
DATATYPE1,STARTBIT1,NUMBITS1,NUMVALS1,0.4,0)
Next Scan 'Loop up for the next scan
EndProg 'Program ends here
Due to current system constraints the ID parameter must be entered
directly into the CanBus instruction.
NOTE
C.5 Retrieving J1939 Accelerator Pedal Position Data using a CR23X/CR10X (Bus Speed 250k Baud) C.5.1 Encoding the Identifier Field Values
The following example shows how to encode the identifier field values into the
format for the CR23X/CR10X ID parameter.
The identifier field values for the CAN Data Frame are as follows:
Priority 310
Reserved 010
Data Page 010
PDU Format 24010
PDU Specific 310
Source Address 010
These decimal values then need to be converted to binary and encoded into the 29
bit identifier.
Priority 0112
Reserved 02
Data Page 02
PDU Format 111100002
PDU Specific 000000112
Source Address 000000002
C-4