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: CAN0, CAN1, CAN2, etc.

bitrate

CAN bit rate, in bits per second.

fd

Added in version PLT-OS: v2.0

Enable CAN-FD.

retryCount

Optional: Number of times to retry the test step

usbDeviceID

Optional: USB device identifiers: VID:PID.

usbDevicePath

Optional: USB device path: port. .port.

usbDeviceInterface

Optional: USB device interface: interface_number.

with

Additional command parameters. (optional)

  • tq - TQ value

  • phaseSeg1 - PHASE-SEG1 value (1…8)

  • phaseSeg2 - PHASE-SEG1 value (1…8)

  • propSeg - PROP_SEG value (1…8)

  • samplePoint - SAMPLE-POINT value (0.000…0.999)

  • sjw - SWJ value (1…4)

  • dataBitrate - data bitrate (1…1000000)

  • dataTQ - Data TQ value

  • dataPropSeg - Data PROP_SEG value (1…8)

  • dataPhaseSeg1 - Data PHASE-SEG1 value (1…8)

  • dataPhaseSeg2 - Data PHASE-SEG2 value (1…8)

  • dataSamplePoint - Data SAMPLE-POINT value (0.000…0.999)

  • dataSJW - Data SWJ value (1…4)

External USB CAN dongles can be configured as CAN ports by using the usbDeviceID, usbDevicePath, or usbDeviceInterface fields.

Note

The built-in CAN0 port, which does not support CAN-FD, can not be redefined. That is, the usbDeviceID, usbDevicePath, and/or usbDeviceInterface parameters can’t be set on CAN0.

Examples