TC – Timer control and status

Block SymbolLicensing group: STANDARD
Qt SVG Document Exported by REXYGEN Studio OsPer TsPer OsAdj TsAdj per over ticks SIM TC

Function Description
The TC function block controls the internal timer of REXYGEN. It is possible to modify the actual basic tick period (e.g. the value set in the tick parameter of the EXEC block) or logical tick period (e.g. the time added to the timestamp of each tick if timer = CORETIMER is selected). By default, the logical and physical period is the same and is the EXEC:tick parameter. The discretization period of the blocks in the control algorithm is not affected by the TC block.

The actual period can be changed in two ways: set the desired value to the OsPer input or set OsAdj for one tick. OsAdj will temporarily increase or decrease the actual period until the total shift set on the OsAdj input is realized. How much the period increases is controlled by the OsMax parameter.

Example: Let’s expect the tick period to be 0.1s and OsMax=0.2, so let’s set OsAdj=1.0 to temporarily increase the real period to 0.12s (e.g. 20% defined in the OsMax parameter) until a total shift of 1s is realized, e.g. for 50 ticks.

Logical period control is the same using inputs/parameter TsPer, TsAdj, TsMax.

Note 1: The unconnected input or the input with a value of 0 is ignored.

Note 2: The actual period adjustment is not supported on Windows targets.

Note 3: The primary reason for this block is to synchronize with another controller in time-critical application, so the period should only be changed by a few percent. For simulation and debugging purposes, it is possible to change the period significantly to speed up a slow process (or slow down a fast process). This should be done with caution, as the synchronization with other controllers will not work and all calculations must be done in the shortened period. Also, in this case, warnings about missing ticks, incorrect period, etc. will appear in the log. For these purposes, it is better to use the simulation mode.

This block does not propagate the signal quality. More information can be found in the 1.4 section.

Input

OsPer

Physical tick period [s]

Double (F64)

TsPer

Logical (timestamp) tick period [s]

Double (F64)

OsAdj

Physical tick shift [s]

Double (F64)

TsAdj

Logical (timestamp) tick shift [s]

Double (F64)

Parameter

OsMax

Maximal relative quantum for physical adjustment   0.0  1.0 0.1

Double (F64)

TsMax

Maximal relative quantum for logical adjustment   0.0  1.0 0.1

Double (F64)

Output

per

Last real physical tick period [s]

Double (F64)

over

Number of lose periods in last tick

Long (I32)

ticks

Number of ticks since start

Large (I64)

SIM

Timer in simulation mode

Double (F64)

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