Skip to main content

7.14.2 RD_CLOLCKINFO

Function

This instruction reads the system clock status and outputs it, as well as returning the execution status of the instruction.

LD graphics

RD_CLOCKINFO

Parameter description

Interface variablesDeclarationData typeDescription
RD_CLOCKINFOReturn valueINTReturn command status
CLOCKINFOOut_PutWORDStatus of the internal CPU clock

Internal CPU clock status description:

  • Bit0: Information about whether time synchronization is lost
    • Bit0 = 1: One or more time synchronizations are lost.
    • Bit0 = 0: Time synchronization is not lost.

Bit0 will be reset to 0 in the following cases: No time synchronization is started, or after a CPU restart, or after setting the time

  • Bit1 = 1: Time synchronization is enabled.

  • Bit2: Information about currently activated daylight saving time or standard time

    • Bit2 =1: Activate Daylight Saving Time (DST)

    • Bit2 =0: Activate Standard Time

  • Bit3 to Bit15: 0 (reserved)

Return value: RD_CLOCKINFO (...)

Return command status (W#16#....)

Return instruction status description:

  • 0000 No error.
  • FF00 Unable to read system clock status.
  • In the program editor, error codes can be displayed as integers or hexadecimal.

Example

  • An LD example is shown in the following animation:

RD_CLOCKINFO_GIF

  • ST example is shown in the following code:
Definition reference
Out:INT;
Word1:WORD;

Code implementation:
OUT2:=RD_CLOCKINFO(CLOCKINFO=>Word1);