Skip to main content

GetCanBittimingConfiguration, SetCanBittimingConfiguration

Valid for: CANoe DE • CANoe:lite DE

Function Syntax

  • int GetCanBittimingConfiguration(dword channel, BitTiming timing);
  • int GetCanBittimingConfiguration(dword channel, BitTiming[] timings, dword countOfBittimings);
  • int SetCanBittimingConfiguration(dword channel, BitTiming timing);
  • int SetCanBittimingConfiguration(dword channel, BitTiming[] timings, dword countOfBittimings);

Description

The CAN, CAN FD or CAN-XL controller parameters can be set or read. An automatic reset of the controller is performed.

Parameters

  • Channel: The CAN channel.
  • BitTiming: The bit timing for the defined phase.
  • BitTimings: The bit timings for more than one defined phase.
  • countofBittimings: Number of bit timings contained in the array.

Selectors

  • struct BitTiming
    • BitTiming.BitTimingPhase: The bit timing phase. Type: BitTimingPhase, Access: r/w
    • BitTiming.Bitrate: The bitrate for the defined phase. Type: double, Access: r/w
    • BitTiming.TSEG1: The time quanta count of the time segment 1. Type: dword, Access: r/w
    • BitTiming.TSEG2: The time quanta count of the time segment 2. Type: dword, Access: r/w
    • BitTiming.SJW: The synchronization jump width for the phase error correction. Type: dword, Access: r/w
  • enum BitTimingPhase
    • eCANInvalidPhase: Invalid value for a phase within the bit timing structure. Type: int, Access: r
    • eCANNominalPhase: BitTiming values represent the nominal phase of CAN, CAN-FD or CAN-XL frame. Type: int, Access: r
    • eCANFDPhase: BitTiming values represent the data phase of a fd frame. Type: int, Access: r
    • eCANXLPhase: BitTiming values represent the data phase of a xl frame. Type: int, Access: r

Return Values

  • 0: Successful
  • -1: Invalid bit timing phase
  • -2: Invalid parameter
  • -3: No bit timings available for defined phase
  • -4: No bit timings available for defined channel
  • -255: Unknown error

Example

Example 1
Example 2