Function F_Cx81Xx_Address; Real Time Clock (Rtc); Table 15 Description Of The Softrtc Registry Key - Beckhoff CX8180 Manual

Embedded pc with rs232/rs485
Hide thumbs Also See for CX8180:
Table of Contents

Advertisement

Programming
7.3

Function F_CX81xx_ADDRESS

This function reads the position of the address selection switch of the CX8180. One possible application is
that you can activate different program parts in the PLC depending on the switch position.
VAR_INPUT
VAR_INPUT
    iCX_Typ      : INT;          (* Use product code without 'CX' e.g.: CX8180 -> 8180 *)
END_VAR
VAR_OUTPUT
F_CX80xx_ADDRESS     : INT;
F_CX80xx_ADDRESS                       : -1, non-implemented CX, address of the switch
Requirements
Development environ-
ment
TwinCAT v3.1 Build
4022.30
7.4

Real Time Clock (RTC)

The real-time clock (RTC) is read out via the function blocks FB_LocalSystemTime and can be set with the
function block NT_SetLocalTime (see TcUtilities.lib). The RTC is supplied by the battery and can thus
continue to run in the power-off state.
Real-time clock (RTC) running too slow
TwinCAT uses its own real-time driver. This has the advantage that the quality of the real-time has been
much improved, and the jitter of the task has been reduced to a minimum. This calls the operating system
from TwinCAT. The RTC on the operating system is controlled via TwinCAT and must be called at certain
times.
If the task cycle time on the TwinCAT side is very long and the CPU load is high, the operating system is no
longer called with sufficient frequency. As a result, the RTC on the operating system is slow. If you have
noticed that the RTC is slow and the time on the CX8180 is also slow, you can apply the following
troubleshooting procedure.
Remedy
The call of the RTC is always linked to a reading of the hardware RTC. This has the disadvantage of a
slightly higher CPU load, but since the CPU load is already high due to your application, the additional CPU
load is negligible. Adjust the settings in the registry:
[HKEY_LOCAL_MACHINE\Platform]
    "SoftRTC"=dword:0
Table 15: Description of the SoftRTC registry key
Value
Description
0
The hardware RTC is always read out when the Windows time is
requested.
1
The hardware RTC is read out once at startup. From then on, the
Windows clock continues to run via the internal system tick.
50
Target platform
ARM
Version: 1.5
Hardware
CX8180
PLC libraries to include
Tc2_SystemCX
CX8180

Advertisement

Table of Contents
loading

Table of Contents