UTC-Time-Quality BYTE format specification

The TwinCAT UTC-Time-Quality components are coded in BYTE in the following way:

Bit

Component

Type

Value range

Description

0

LeapSecondsKnown

BIT

0..1

Quality of the leap second (0:=unknown, 1:=known).

1

ClockFailure

BIT

0..1

Quality of the timer (0:=good, 1:=erroneous).

2

ClockNotSynchronized

BIT

0..1

Quality of the time synchronization (0:=synchronized, 1:=not synchronized).

3

Accuracy0

BIT

0..1 (MSB)

Accuracy of the time information (precision of the fraction of a second). Max. number of significant bits in the T_UtcTime.fractionOfSecond component.
In the precision, Accuracy0 is the most significant bit and Accuracy4 the least significant bit.

4

Accuracy1

BIT

0..1

5

Accuracy2

BIT

0..1

6

Accuracy3

BIT

0..1

7

Accuracy4

BIT

0..1 (LSB)

Coding of the precision in the UTC-Time.Quality.Accuracy0..4 bits.

Precision

Accuracy0

Accuracy1

Accuracy2

Accuracy3

Accuracy4

E_UtcTimeAccuracy

0-bit

0

0

0

0

0

Zero

1-bit

0

0

0

0

1

_01

2-bit

0

0

0

1

0

_02

3-bit

0

0

0

1

1

_03

4-bit

0

0

1

0

0

_04

5-bit

0

0

1

0

1

_05

6-bit

0

0

1

1

0

_06

7-bit

0

0

1

1

1

_07

8-bit

0

1

0

0

0

_08

9-bit

0

1

0

0

1

_09

10-bit

0

1

0

1

0

_10

11-bit

0

1

0

1

1

_11

12-bit

0

1

1

0

0

_12

13-bit

0

1

1

0

1

_13

14-bit

0

1

1

1

0

_14

15-bit

0

1

1

1

1

_15

16-bit

1

0

0

0

0

_16

17-bit

1

0

0

0

1

_17

18-bit

1

0

0

1

0

_18

19-bit

1

0

0

1

1

_19

20-bit

1

0

1

0

0

_20

21-bit

1

0

1

0

1

_21

22-bit

1

0

1

1

0

_22

23-bit

1

0

1

1

1

_23

24-bit

1

1

0

0

0

_24

Impermissible

1

1

n

n

n

_25_invalid.._30_invalid

Not specified

1

1

1

1

1

Unspecified

Samples

The table below contains some BYTE numerical values and the values after conversion to the formatted UTC Time-Quality string and the structured type: T_UtcTimeQuality.

BYTE

STRING(9)

T_UtcTimeQuality

Description

2#00000000

'UQ#000|0'

STRUCT(0)

All components have the value: 0. Precision: 0-bit.

2#11000000

'UQ#000|3'

STRUCT(Accuracy3:=1, Accuracy4:=1)

Precision: 3-bit. All other components have the value 0.

2#10100100

'UQ#001|5'

STRUCT(ClockNotSynchronized:=1, Accuracy2:=1, Accuracy4:=1)

Timer is not synchronized.
Precision: 5-bit. All other components have the value 0.

2#11111010

'UQ#010|31'

STRUCT(ClockFailure:=1, Accuracy0:=1, Accuracy1:=1, Accuracy2:=1, Accuracy3:=1, Accuracy4:=1)

Timer signals an error. Precision: Not specified. All other components have the value 0.