5.1.81. Processor loading (psc_CpuLoading)

Get the average processor loading for the running application.

5.1.81.1. Supported targets

All targets

5.1.81.2. Required license

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

5.1.81.3. Description

Determines the load on the main processor over the last 50 milliseconds and the maximum load since the ECU was powered on (or last reset).

The load is calculated as the time used by any running task or interrupt over a 50 millisecond window, expressed as a percentage. The calculation is an estimate as the 50 millisecond window can extend over a wider duration if the processor is heavily loaded. As the 50 millisecond window does not synchronise with the model rate tasks, some aliasing can occur as well (for instance, one 50 millisecond window may contain only a small percentage of work done by the model, while another window may contain a higher percentage).

There is no provision to change the window duration for the loading calculation.

5.1.81.4. Inports

  • sim_loading

    Only used under simulation and when the parameter Provide simulation inports is ticked. The outport loading is set to the value of this inport for simulation purposes.

    Range: [0, 100] %

5.1.81.5. Outports

  • loading

    The processor loading over the last 50 milliseconds or the maximum processor loading seen since the ECU powered on (or reset). Under simulation, if the Provide simulation inports parameter isn't ticked, the outport is set to the minimum of its range.

    Range: [0, 100] %

5.1.81.6. Mask parameters

  • Output mode

    Whether the loading outport is set to the processor loading over 50 milliseconds, or the maximum loading since power on (or reset).

  • Sample time

    The periodicity of the block execution.

    Range: [0.001, 3600] seconds

  • Provide simulation inports

    Tick to enable inport sim_loading.

5.1.81.7. Notes

None.