Skip to main content

Tab: Settings

The Settings tab in the editor of the Profiler object is used to configure the profiling in online mode. It contains the setting options that correspond to the set method:

Table 1. Recording

Task:

In online mode, CODESYS Profiler records the runtime behavior for the POUs that are called by this task.

Condition:

(Boolean expression) The value TRUE is a requirement for recording. For example, you can use the Input Assistant to set a Boolean variable for this.

If the field is blank, then every cycle is recorded.

Watch first cycle

Available only when the profiling method is set to Instrumentation.

The first cycle often has special tasks and therefore takes a particularly long time, but in most cases it is not interesting for the measurement. Therefore, it is excluded from the measurement by default.

Instrumentation parameters

Available only when the profiling method is set to Instrumentation.

  • Instrument whole application: _prf_icon_option_activated.png: All POUs of the application are instrumented, including the POUs from the referenced, compiled libraries. In this case, the POU selection is not available in the lower part of the tab.

  • Recording mode:

    • Record next cycle: When the application starts, the first PLC cycle is recorded. No additional cycle is recorded. An additional measurement is performed only after a recording is uploaded from the controller either by opening the Online tab for the first time, or by clicking Refresh snapshot.

    • Record max cycle: Every cycle is recorded. The result of a recording is saved when the cycle has lasted longer than the last saved recording. When a recording is uploaded from the controller, the longest recording to date is deleted and the recording starts all over again.

  • Buffer size: Maximum number of individual recordable run times per cycle. These are the runtimes of all POU calls for the task specified above. For a correct configuration of the buffer size, also note the selected Recording mode.

Sampling parameters

Available only when the profiling method is set to Sampling.

For background information about these settings, see also the help page "Profiling by Sampling", "Functionality of the measurement" section.

  • Profiler task group: Task group that contains the Profiler task. The list box shows the task groups available in your multicore system.

    Note: Make sure that the sampling task of the Profiler is on a different core than the task of the application to be measured. Optimal: No other task is running on the same core as the Profiler task.

  • Sampling interval: Time period when a random measurement should be taken.

    Background: Within this period, sampling is performed at a random time. For this purpose, the task to be sampled is halted and the call tree is recorded. The remaining time of the specified interval elapses, and only then is the next random sampling time generated. At a sampling interval of 1 ms, 100 samples are performed in 100 ms. In general, no different results are obtained with a shorter interval than with a longer interval. It makes sense, for example, to specify the task cycle time as the sampling interval. Then the sampled task is interrupted no more than one time per cycle so that the influence of the sampling on the runtime is limited.

    Note: The value can also be modified in online mode in the Online view.

  • Maximum depth of call stack: Number of levels of the nested call tree that are recorded in the samples. Selection between 20 and 100.

    This is the maximum nesting depth for which the call tree of the POU is determined during a measurement.

    Note: The greater the nesting depth to be recorded, the more extensive the individual measurement will be and the fewer measurements will fit into the memory that is reserved for this purpose. In this case, the Profiler task may fill the list of samples faster than this list can be transferred to the development system. This can cause samples to be lost, which will not corrupt the result, but will unnecessarily slow down the cycles. You should avoid this by reducing the sampling rate.



Table 2. Snapshot appearance

Time format

  • tick: Time unit defined by the processor.

  • ms: Milliseconds

  • µs: Microseconds

  • ms/µs: Milliseconds or microseconds (depending on size)

Note: Implicit code calculates the approximate assignment of the time formats "ms" and "µs" to system ticks. On the Online tab, in the Profiler results category, you can see the calculated value displayed in the Time entry. Example: 1 ms = 3398810 ticks.

Determining critical limits

  • prf_icon_critical_total_time.png Critical limit total time

  • prf_icon_critical_end_chain.png Critical limit end of call chain

  • prf_icon_critical_own_time.png Critical limit high own time

Critical upper limits for the times measured in the current cycle. If the time of a call in the cycle exceeds the percentage defined here for the total cycle time, then this is indicated in the Profiler results with a symbol at the beginning of the respective lines.

Total time: Time spent by the POU call, including all calls from this POU.

End of the call chain: Last call in the call tree. In this case: total time = "Own time"

"Own time": Time spent by the POU call, excluding the time spent on all POU calls made by this POU itself.



Table 3. POU selection

In a tree structure:

POUs of the application

POUs from the POU pool

Available only when the Instrumentation or Code Coverage profiling method is set and the Instrument whole application option is not selected.

Selection of desired POUs

POUs from integrated libraries can only be instrumented all together with all POUs of the application by selecting the Instrument whole application option.



For more information, see: Profiling by Instrumentation or Sampling