REXGEN 1REXGEN 2REXGEN 2 IMU GNSSREXGEN AirREXGEN ProDeveloper

REXGEN XML reference: CAN interfaces and bit timing

Updated

Set up each CAN port: its physical channel, bit rates, listen-only mode, sleep and wake behaviour and optional custom bit timing.

One block per CAN port

Add one CANINTERFACE to CANINTERFACE_LIST for every CAN port you use. Messages reach the port by naming the interface's UID in their InterfaceUID. Each block takes a UID attribute (required and unique in the file) and the optional Version, X and Y. Each entry in the settings lists gives the meaning, then whether the schema requires the element, its type and its default where one exists.

Valid PhysicalNumber values by model
Model CAN channels PhysicalNumber
REXGEN 1 1, CAN 2.0 0
REXGEN 2, REXGEN 2 IMU GNSS 2, CAN 2.0 and CAN FD 0 and 1
REXGEN Air Up to 4, CAN 2.0 and CAN FD 0 to 3
REXGEN Pro Up to 4, CAN 2.0 and CAN FD 0 to 3

Only one interface can use each physical number.

CAN ports (CANINTERFACE_LIST)

CANINTERFACE

This port, from the example files, runs CAN 0 at 500 kbit/s with automatic bit timing, acknowledges frames and never sleeps.

<CANINTERFACE UID="4">
  <Type>CAN</Type>
  <PhysicalNumber>0</PhysicalNumber>
  <CANBusSpeed>500000</CANBusSpeed>
  <CANFDBusSpeed>8000000</CANFDBusSpeed>
  <CANFDNonISO>false</CANFDNonISO>
  <TSeg1>0</TSeg1>
  <TSeg2>0</TSeg2>
  <SJW>0</SJW>
  <TSeg1FD>0</TSeg1FD>
  <TSeg2FD>0</TSeg2FD>
  <SJWFD>0</SJWFD>
  <SilentMode>false</SilentMode>
  <Autodetect>false</Autodetect>
  <WakeUpOption>NO_WAKE_UP</WakeUpOption>
  <SleepOption>NO_SLEEP</SleepOption>
  <SleepNoActivityTime>0</SleepNoActivityTime>
  <Prescaler>0</Prescaler>
  <PrescalerFD>0</PrescalerFD>
  <UseBitTiming>false</UseBitTiming>
  <FilterCount>0</FilterCount>
</CANINTERFACE>

For a CAN FD bus, set Type to CAN_FD and CANFDBusSpeed to the data-phase bit rate, for example 2000000.

Type
The protocol: CAN (classic CAN 2.0) or CAN_FD. REXGEN 1 supports CAN only. Required.
PhysicalNumber
The physical channel on the logger, counted from 0. The PhysicalNumber table lists the valid values for each model. Required. Unsigned byte.
CANBusSpeed
Classic CAN bit rate, or the arbitration-phase bit rate on CAN FD, in bit/s from 0 to 1,000,000. For example 500000. Required. Unsigned int.
CANFDBusSpeed
CAN FD data-phase bit rate in bit/s from 0 to 8,000,000. The logger applies it only when Type is CAN_FD. The example files leave 8000000 in classic interfaces. Required. Unsigned int.
CANFDNonISO
true for a non-ISO (Bosch) CAN FD bus, false for ISO CAN FD and for classic CAN. Required. Boolean.
SilentMode
true puts the port in listen-only mode: it neither acknowledges frames nor transmits. Use it on a bus where the logger must stay invisible. Required. Boolean. Normally false.
Autodetect
true makes the logger detect the bit rate itself. Detection needs traffic on the bus. Required. Boolean.
WakeUpOption
WAKE_UP lets traffic on this port wake the logger. NO_WAKE_UP does not. Required. Default NO_WAKE_UP.
SleepOption
Sleep behaviour for this port: NO_SLEEP, NORMAL_SLEEP or DEEP_SLEEP. Required. Default NO_SLEEP.
SleepNoActivityTime
Seconds without bus activity before the logger sleeps, when SleepOption allows sleep. Required. Unsigned short.
UseBitTiming
true applies your own prescaler, segment and SJW values instead of timing worked out from the bit rates. Required. Boolean. Normally false.
Prescaler, TSeg1, TSeg2, SJW
Classic or arbitration-phase bit timing, used only when UseBitTiming is true. Required. Unsigned byte each. 0 when unused.
PrescalerFD, TSeg1FD, TSeg2FD, SJWFD
CAN FD data-phase bit timing, used only when UseBitTiming is true. Required. Unsigned byte each. 0 when unused.
FilterCount
Number of hardware acceptance filters. Optional. Unsigned short. Default 0.
HW_FILTER_LIST
Hardware acceptance filters. Each is a HW_FILTER with FilterType (RANGE, DUAL or CLASSIC), ID1, ID2, Extended and Accept. The example files filter with the identifier ranges on CANMESSAGE instead. Optional.

Custom bit timing

With UseBitTiming at false, the logger works out the timing from CANBusSpeed and CANFDBusSpeed. Set your own values only when a bus needs a specific sample point that the default does not give.

Each bit is divided into time quanta: one synchronisation quantum, then TSeg1, then TSeg2. The bus samples the bit between the two segments. SJW limits how far the controller can stretch or shorten a segment to stay in step.

  • Bit rate = CAN clock / (Prescaler × (1 + TSeg1 + TSeg2))
  • Sample point = (1 + TSeg1) / (1 + TSeg1 + TSeg2)

The data phase of CAN FD uses the same formulas with the FD values.

One CAN bit in time quanta CAN · BIT TIMING One CAN bit in time quanta Nominal bit classic CAN, and the CAN FD arbitration phase Sync 1 tq TSeg1 12 tq TSeg2 3 tq Sample point 1 tq = Prescaler / CAN clock CAN FD data bit data phase, with the FD values Sync 1 tq TSeg1FD 7 tq TSeg2FD 2 tq Sample point 1 tq = PrescalerFD / CAN clock TSeg1 can stretch by up to SJW TSeg2 can shorten by up to SJW TSeg1FD can stretch by up to SJWFD TSeg2FD can shorten by up to SJWFD Bit rate = CAN clock / (Prescaler × (1 + TSeg1 + TSeg2)) Sample point = (1 + TSeg1) / (1 + TSeg1 + TSeg2) Drawn here: 1 + 12 + 3 = 16 tq, sample point 13 / 16 = 81.25%; data bit 1 + 7 + 2 = 10 tq, 8 / 10 = 80%. Quanta counts are examples, not recommended settings; the two rows are not to the same scale. The values apply only when UseBitTiming is true. The logger's CAN clock frequency is not published, so no bit rate is worked out here.

These Learn articles explain the theory:

CAN errors (CANERROR_LIST)

CANERROR

A CANERROR block attaches to one CAN interface.

<CANERROR UID="6">
  <InterfaceID>4</InterfaceID>
</CANERROR>
InterfaceID
UID of the CANINTERFACE it watches. Required. Unsigned short.

For what CAN error frames mean, see CAN errors explained.

Common mistakes

  • Two interfaces with the same PhysicalNumber. Only one block can claim each channel.
  • A PhysicalNumber the model does not have. The file still validates, but the port never comes up.
  • Setting timing values while UseBitTiming is false. The logger ignores them until it is true.
  • SilentMode set to true on a bus where the logger is the only other node. With nobody to acknowledge frames, the sender keeps repeating them.

Next: REXGEN XML reference: CAN messages and signals.

Products in this guide

REXGEN 1

Vehicle black box

View REXGEN 1 Ask an engineer

REXGEN 2

Evidence data logger

View REXGEN 2 Ask an engineer

REXGEN 2 IMU GNSS

Motion & location data logging

View REXGEN 2 IMU GNSS Ask an engineer

REXGEN Air

CAN to cloud

View REXGEN Air Ask an engineer

REXGEN Pro

Edge data platform

View REXGEN Pro Ask an engineer

Still stuck?

Our engineers answer support questions on every Influx Technology product.