Skip to main content

Configuring Real-Time Behavior on Special Platforms

Real-time behavior of CODESYS Control RTE on special platforms

The time behavior of CODESYS Control RTE depends on the consistency of the CPU clock and the cycle of the front-side bus. With specific settings in the BIOS and in Windows, you can adapt the time behavior to the conditions of different platforms.

Settings in the BIOS

Because most platforms have different types of BIOS, only general recommendations can be provided for optimizing the time behavior of CODESYS Control RTE.

Settings in Windows

Recommendation: The power scheme should always be set to "Always on".

Automatic Updates: Updates should always be performed manually for an industrial controller because the PC is rebooted by an automatic mechanism without any user prompt.

Adaptations for the "APIC" (single- and multi-processor) and "AMP" (operation of the RTE on individual CPU core)

The general adaptation to the specific characteristics of the platforms is done by the CmpDrvSchedulerAMP and CmpDrvSchedulerAPIC components (no longer relevant since the discontinuation of Windows 7).

By default, the CmpDrvSchedulerAMP is installed from the setup of the CODESYS Control RTE. CmpDrvSchedulerAPIC is still included for compatibility reasons only and can only be installed manually on old Windows 7 PCs.

In general, the CODESYS Control RTE can be run only on PCs with more than one processor core (CmpDrvSchedulerAMP). The only exception is the "Windows 7 (32 bit)" Windows platform. The CmpDrvSchedulerAPIC can still be used on this platform only. With this component, the CODESYS Control RTE can use time slicing to share CPU core 0 with Windows.

When the CODESYS Control RTE is started for the first time, complicated measurements are performed in order to scale the clock speeds to microseconds. The results of this measurement are saved in the Windows Registry: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\CmpDrvSchedulerAMP\Params or HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\CmpDrvSchedulerAPIC\Params; values SetClocksPerUS and SetCountsPerMS.

For each subsequent start of the CODESYS Control RTE, the measurements are not performed again if the values obtained from the measurement at the first startup can be read from the Registry. If an adaptation performed in the system (for example, the power-saving setting in BIOS) has caused the CPU clock to change from the measured value, then these values have to be deleted from the Windows Registry. Only then are the clock speeds rescaled when the CODESYS Control RTE is started again.

For more information, see: Hardware Configuration – Recommendations