REXGEN 1REXGEN 2REXGEN 2 IMU GNSSREXGEN AirREXGEN ProDeveloper
REXGEN XML reference: CAN interfaces and bit timing
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.
| 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) orCAN_FD. REXGEN 1 supportsCANonly. 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
TypeisCAN_FD. The example files leave8000000in classic interfaces. Required. Unsigned int. CANFDNonISO-
truefor a non-ISO (Bosch) CAN FD bus,falsefor ISO CAN FD and for classic CAN. Required. Boolean. SilentMode-
trueputs 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. Normallyfalse. Autodetect-
truemakes the logger detect the bit rate itself. Detection needs traffic on the bus. Required. Boolean. WakeUpOption-
WAKE_UPlets traffic on this port wake the logger.NO_WAKE_UPdoes not. Required. DefaultNO_WAKE_UP. SleepOption- Sleep behaviour for this port:
NO_SLEEP,NORMAL_SLEEPorDEEP_SLEEP. Required. DefaultNO_SLEEP. SleepNoActivityTime- Seconds without bus activity before the logger sleeps, when
SleepOptionallows sleep. Required. Unsigned short. UseBitTiming-
trueapplies your own prescaler, segment and SJW values instead of timing worked out from the bit rates. Required. Boolean. Normallyfalse. -
Prescaler,TSeg1,TSeg2,SJW - Classic or arbitration-phase bit timing, used only when
UseBitTimingistrue. Required. Unsigned byte each.0when unused. -
PrescalerFD,TSeg1FD,TSeg2FD,SJWFD - CAN FD data-phase bit timing, used only when
UseBitTimingistrue. Required. Unsigned byte each.0when unused. FilterCount- Number of hardware acceptance filters. Optional. Unsigned short. Default
0. HW_FILTER_LIST- Hardware acceptance filters. Each is a
HW_FILTERwithFilterType(RANGE,DUALorCLASSIC),ID1,ID2,ExtendedandAccept. The example files filter with the identifier ranges onCANMESSAGEinstead. 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.
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
CANINTERFACEit 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
PhysicalNumberthe model does not have. The file still validates, but the port never comes up. - Setting timing values while
UseBitTimingisfalse. The logger ignores them until it istrue. -
SilentModeset totrueon a bus where the logger is the only other node. With nobody to acknowledge frames, the sender keeps repeating them.
Products in this guide
Still stuck?
Our engineers answer support questions on every Influx Technology product.