canCfg - Configure CAN interface
Configure a CAN interface. This command can be used to adjust the speed bit settings of a CAN port. Additionally, it can be used to configure additional CAN ports via USB.
Usage:
- command: canCfg <port> <bitrate> [fd]
[retry: <retryCount>]
[id: <usbDeviceID>]
[path: <usbDevicePath>]
[interface: <usbDeviceInterface>]
[with:
[- tq <tq>]
[- phaseSeg1 <phaseSeg1>]
[- phaseSeg2 <phaseSeg2>]
[- propSeg <progSeg>]
[- samplePoint <samplePoint>]
[- sjw <sjw>]
[- dataBitrate <dataBitrate>]
[- dataTQ <dataTQ>]
[- dataPropSeg <dataProgSeg>]
[- dataPhaseSeg1 <dataPhaseSeg1>]
[- dataPhaseSeg2 <dataPhaseSeg2>]
[- dataSamplePoint <dataSamplePoint>]
[- dataSJW <dataSJW>]]
Argument |
Description |
|---|---|
port |
CAN port name: |
bitrate |
Nominal (arbitration-phase) CAN bit rate, in bits per second. Maximum |
|
Added in version pltOS: v2.0 Enable CAN-FD on the port. Only supported on externally attached USB CAN-FD
dongles — the built-in |
retryCount |
Optional: Number of times to retry the test step |
usbDeviceID |
Optional: USB device identifiers: |
usbDevicePath |
Optional: USB device path: |
usbDeviceInterface |
Optional: USB device interface: |
with |
Additional command parameters, used to fine-tune CAN bit timing beyond the nominal bitrate (and, for CAN-FD, the with: dataBitrate data-phase rate). All fields are optional and apply only to externally attached USB CAN dongles. (optional)
|
External USB CAN dongles can be configured as CAN ports by using the usbDeviceID, usbDevicePath, or
usbDeviceInterface fields. The first canCfg step for a given USB port attaches and configures the
underlying interface; a later canCfg step for the same port reconfigures it in place.
Note
The built-in CAN0 port, which does not support CAN-FD and is limited to a 1 Mbit/s maximum
bit rate, can not be redefined. This means that the usbDeviceID, usbDevicePath, and/or
usbDeviceInterface parameters can’t be set on CAN0.
Examples