Simple Module Timer

Package: core4inet.scheduler.timer
File: src/core4inet/scheduler/timer/Timer.ned

C++ definition

Timer Module: Implements a timer with an attached oscillator with adjustable precision that may be synchronized by a synchronization module

See also: ~IOscillator, ~IPeriod

Author: Till Steinbach

Timer

Usage diagram:

The following diagram shows usage relationships between types. Unresolved types are missing from the diagram. Click here to see the full picture.

Inheritance diagram:

The following diagram shows inheritance relationships for this type. Unresolved types are missing from the diagram. Click here to see the full picture.

Used in compound modules:

Name Type Description
Scheduler compound module

The Scheduler provides timing events for other modules.

Parameters:

Name Type Default value Description
allowedEventDelay int -1tick

Maximum delay in ticks that an time-triggered event is allowed to be "delayed" or off-schedule due to clock correction. This can occur if the clock is late and is being corrected. The timer may jump over upcoming events without triggering. This parameter allows to immediately schedule events that are in the past after clock correciton.

Properties:

Name Value Description
display i=block/timer

Gates:

Name Direction Size Description
period_in [ ] input

Input from the period modules (currently unused)

oscillator_in input

Signals:

Name Type Unit
clockCorrection long

Statistics:

Name Title Source Record Unit Interpolation Mode
clockCorrection Clock correction vector tick

Source code:

//
// Timer Module:  Implements a timer with an attached oscillator with adjustable precision that may be synchronized by a
// synchronization module
//
// @see ~IOscillator, ~IPeriod
//
// @author Till Steinbach
//
simple Timer
{
    parameters:
        @display("i=block/timer");

        //Signal emitted when the clock is corrected, contains the signed number of ticks that is added to the clock
        @signal[clockCorrection](type=long);
        //Statistic of the clock correction in ticks
        @statistic[clockCorrection](title="Clock correction"; unit=tick; record=vector);

        //Maximum delay in ticks that an time-triggered event is allowed to be "delayed" or off-schedule due to clock
        //correction. This can occur if the clock is late and is being corrected. The timer may jump over upcoming events
        //without triggering. This parameter allows to immediately schedule events that are in the past after clock correciton.
        int allowedEventDelay @unit(tick) = default(-1tick);

    gates:
        //Input from the period modules (currently unused)
        input period_in[];
         //Input from the oscillator module (currently unused)
        input oscillator_in;
}