Skip to content
LIBRARY
PeriodicClock.md

PeriodicClock ​

A periodic clock that ticks once every dt time units.

Connect any real output to the input y here, to force it to be on the clock defined by dt.

Usage ​

DiscreteComponents.PeriodicClock()

Parameters: ​

NameDescriptionUnitsDefault value
dtThe period between ticks, in the same units as time.–
offsetDoesn't work yet - don't set this to anything other than 0!–0.0

Connectors ​

  • y - This connector represents a real signal as an input to a component (RealInput)

Behavior ​

Behavior of this component cannot be rendered because it includes path variables.

Source ​

dyad
"""
A periodic clock that ticks once every `dt` time units.

Connect any real output to the input `y` here, to force it to be on the clock defined by `dt`.
"""
external component PeriodicClock@[output clk extends Periodic]
  "Connect any output here, to force it to be on the clock defined in this component."
  y = RealInput@[clk]() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 50, "y1": 450, "x2": -50, "y2": 550, "rot": 0}
      },
      "tags": []
    }
  }
  "The period between ticks, in the same units as `time`."
  structural parameter dt::Real
  "Doesn't work yet - don't set this to anything other than 0!"
  structural parameter offset::Real = 0.0
relations
metadata {
  "Dyad": {
    "icons": {"default": "dyad://DiscreteComponents/PeriodicClock.svg"},
    "doc": {"behavior": false}
  }
}
end
Flattened Source
dyad
"""
A periodic clock that ticks once every `dt` time units.

Connect any real output to the input `y` here, to force it to be on the clock defined by `dt`.
"""
external component PeriodicClock
  "Connect any output here, to force it to be on the clock defined in this component."
  y = RealInput@[clk]() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 50, "y1": 450, "x2": -50, "y2": 550, "rot": 0}
      },
      "tags": []
    }
  }
  "The period between ticks, in the same units as `time`."
  structural parameter dt::Real
  "Doesn't work yet - don't set this to anything other than 0!"
  structural parameter offset::Real = 0.0
relations
metadata {
  "Dyad": {
    "icons": {"default": "dyad://DiscreteComponents/PeriodicClock.svg"},
    "doc": {"behavior": false}
  }
}
end


Test Cases ​

No test cases defined.