Skip to main content

linGetFrameCycleTime

Open topic with navigation CAPL Functions » LIN » linGetFrameCycleTime Valid for: CANoe DE Note
LIN bus statistics is deactivated by default and must be activated before calling this function. You can do this by calling function linEnableStatistics in an on start handler, see example below.

Function Syntax

long linGetFrameCycleTime(long channel, ValueSelector selector);

Description

Gets the cycle time of valid unconditional frames of a LIN channel in milliseconds. The kind of value to be returned (average, current, maximum or minimum) can be selected.

Parameters

  • channel
    LIN channel (1…64).
  • selector
    Value selector:
    • eCurrValue = current
    • eMinValue = minimum
    • eMaxValue = maximum
    • eAvgValue = average

Return Values

Cycle time in milliseconds, if LIN statistics is enabled; 0 otherwise.

Example

on start
{
  linEnableStatistics(1, 1); // Enable LIN statistics on channel 1
}

void myStatisticFunc()
{
  long value;

  value = linGetFrameCycleTime(1, eCurrValue); // Current frame cycle time on channel 1
  // … do something with the value …
}