CAPL Script

Can Configure Bus Off

This reference collection includes Vector documentation reproduced with permission. Snippets may require configuration-specific symbols and are not all standalone programs. Sources and validation limits.

Syntax

long canConfigureBusOff(long channel, long canId, long flags);

Function

Uses the defined ID of a message to set the bus state toBusOff.

Parameters

Channel The CAN channel.

canId

Message ID that is used to set the bus state toBusOff.

flags

0 = Switches off the disturbance1 = Switches on the disturbance

Return Values

1 = The disturbance for the defined ID was switched on successfully.0 = The disturbance for the defined ID could not switched on.

Reference example from the CANoe 12 help. Check the required configuration, database objects and API availability in your installed version; this is not a recorded compiler or runtime test.

variables
{
  message 0x1 msg;  // define CAN message
}

on key '1'
{
  canConfigureBusOff(msg.msgChannel, msg.Id, 1); // enable disturbance
}
on key '2'
{
  output(msg);
}
on key '3'
{
  canConfigureBusOff(msg.msgChannel, msg.Id, 0); // disable disturbance
}
on key 'r'
{
  resetCanEx(1);
}