5.1.12. CAN bus status (pcx_BusStatus)

Provide information about the error status of a CAN bus.

5.1.12.1. Supported targets

All targets

5.1.12.2. Required license

None (Main library). (See Section 2.3, “Licensed Features”.)

5.1.12.3. Description

Provide the current error state of a CAN bus, one of error-active, error-passive or bus-off. See the Bosch CAN specification from their web site (http://www.can.bosch.com) or the ISO specification for more details.

In addition to the usual CAN bus-off error handling performed by the CAN controller, when a CAN bus-off condition is detected by the software, the software temporarily suspends CAN message transmission. A transmission is then attempted periodically in order to check whether the bus-off condition has been resolved. After the bus-off condition has been resolved, the software resumes message transmission as normal.

5.1.12.4. Inports

  • sim_bus_state

    A dummy input for simulation purposes only. Set to zero to simulate an error-active state, set to 1 to simulate an error-passive state, and set to 2 to simulate a bus-off state. Only available if the mask parameter Provide simulation inputs is checked.

    Value type:Integer
    Calibratable:No

5.1.12.5. Outports

  • bus_state

    Set to zero if the CAN bus selected through mask parameter CAN Bus Identifier is in the error-active state, set to 1 if in the error-passive state, and set to 2 if in the bus-off state.

    Range: [0, 2]

    Value type:Integer
    Calibratable:No

5.1.12.6. Mask parameters

  • CAN Bus Identifier

    Which CAN bus to provide error state information about.

    Value type:List
    Calibratable:No
  • Sample time

    The periodicity of the block execution.

    Range: [0.001, 3600] seconds

    Value type:Real
    Calibratable:No
  • Provide simulation inputs

    If selected then simulation inport sim_bus_state is made available.

    Value type:Boolean
    Calibratable:No

5.1.12.7. Notes

None.