Engee documentation

Digital Clock

Outputs the simulation time at the specified interval.

digital clock

Description

The Digital Clock block outputs the simulation time only at times that are multiples of the specified interval. At all other times, the block holds the previous value in the output. To control the accuracy of this block, use the Sample time parameter in the block dialogue box.

Use this block rather than the Clock block (which outputs continuous time) when you need the current simulation time in a discrete system.

Ports

Output

Port_1 - current time
scalar

Current time in seconds, updated at the specified interval. The block holds the previous value at the output for the rest of the time.

Data types: Float64.

Parameters

Sample time - interval between calculation steps
1.0 (by default) | scalar

Specify the interval between calculation steps as a non-negative number.

Do not specify a continuous calculation step 0 or [0,0]. Also, avoid specifying -1 (calculation step inheritance) because this block is the source.

Usage in program code

Block parameter

SampleTime

Value

scalar | vector

By default

1.0