DATETIME – Get, set and convert time

Block SymbolLicensing group: STANDARD
PIC

Function Description
The DATETIME block is intended for advanced date/time operations in the REXYGEN system.

It allows synchronization of the operating system clock and the clock of the REXYGEN system. When the executive of the REXYGEN system is initialized, both clocks are the same. But during long-term operation the clocks may loose synchronization (e.g. due to daylight saving time). If re-synchronization is required, the rising edge (off on) at the SET input adjusts the clock of the REXYGEN system according to the block inputs and parameters.

It is highly recommended not to adjust the REXYGEN system time when the controlled machine/process is in operation. Unexpected behavior might occur.

If date/time reading or conversion is required, the rising edge (off on) at the GET input triggers the action and the block outputs are updated. The outputs starting with ’t’ denote the total number of respective units since January 1st, 2000 UTC.

Both reading and adjusting clock can be repeated periodically if set by getper and setper parameters.

If the difference of the two clocks is below the tolerance limit settol, the clock of the REXYGEN system is not adjusted at once, a gradual synchronization is used instead. In such a case, the timing of the REXYGEN system executive is negligibly altered and the clocks synchronization is achieved after some time. Afterwards the timing of the REXYGEN executive is reverted back to normal.

For simple date/time reading use the DATE_ and TIME function blocks.

Inputs

uyear

Input for setting year  0.00E+00

Long(I32)

umonth

Input for setting month  0.00E+00

Long(I32)

uday

Input for setting day  0.00E+00

Long(I32)

uhour

Input for setting hours  0.00E+00

Long(I32)

umin

Input for setting minutes  0.00E+00

Long(I32)

usec

Input for setting seconds  0.00E+00

Long(I32)

unsec

Input for setting nanoseconds   -9.22E+18  9.22E+18 0.00E+00

Large (I64)

SET

Trigger for setting time

Bool

GET

Trigger for getting time

Bool

Outputs

yyear

Year

Long (I32)

ymonth

Month

Long (I32)

yday

Day

Long (I32)

yhour

Hours

Long (I32)

ymin

Minutes

Long (I32)

ysec

Seconds

Long (I32)

ynsec

Nanoseconds

Long (I32)

ydow

Day of week

Long (I32)

ywoy

Week of year

Long (I32)

tday

Total number of days

Long (I32)

tsec

Total number of seconds

Long (I32)

tnsec

Total number of nanoseconds

Large (I64)

dsec

Number of seconds since midnight

Long (I32)

Parameters

isetmode

Source for setting time  1.00E+00

Long(I32)

1 ....

OS clock

2 ....

Block inputs

3 ....

The unsec input

4 ....

The usec input

5 ....

The unsec input, relative

igetmode

Source for getting or converting time  6.00E+00

Long(I32)

1 ....

OS clock

2 ....

Block inputs

3 ....

The unsec input

4 ....

The usec input

5 ....

The uday input

6 ....

REXYGEN clock

settol

Tolerance for setting the REXYGEN clock [s]  1.0

Double (F64)

setper

Period for setting time [s] (0=not periodic)  0.0

Double (F64)

getper

Period for getting time [s] (0=not periodic)  0.001

Double (F64)

FDOW

First day of week is Sunday

Bool

off ..

Week starts on Monday

on ...

Week starts on Sunday

tz

Timezone  1.00E+00

Long(I32)

1 ....

Local time

2 ....

UTC

2020 © REX Controls s.r.o., www.rexygen.com