blockAssignClockToSquareWaveHold
Generate a Boolean continuous-time square-wave output from a clocked Real input
Extends from Modelica_Synchronous.ClockSignals.Interfaces.ClockedBlockIcon (Basic graphical layout of block where at least one input or output is a clocked variable).
Information
This block creates a Boolean, continuous time, square-wave output. Whenever the clock of the input signal is active the Boolean output value changes.
Example
The following
example
samples a sine signal with a periodic clock of 20 ms period. After that a Boolean, continuous time, square-wave signal is generated that changes its value at every clock tick of the sampled signal:
![]() |
![]() |
|
| model | simulation result |
Parameters
| Type | Name | Default | Description |
|---|---|---|---|
| Boolean | y_start | false | Initial value of output signal |
Connectors
| Type | Name | Default | Description |
|---|---|---|---|
| Modelica.Blocks.Interfaces.RealInput | u | ||
| Modelica.Blocks.Interfaces.BooleanOutput | y | Connector of Boolean output signal |

