blockToggle

Toggles output value whenever its input turns true

Information

Block that generates a true output when toggle input u rises from false to true, provided that the clear input clr is false or also became at the same time false. The output remains true until

  • the toggle input u rises from false to true again, or
  • the clear input clr rises from false to true.

If the clear input clr is true, the output y switches to false (if it was true) and it remains false, regardless of the value of the toggle input u.

At initial time, if clr = false, then the output will be y = u. Otherwise it will be y=false (because the clear input clr is true).

Toggle.png

Connectors

TypeNameDefaultDescription
Buildings.Controls.OBC.CDL.Interfaces.BooleanInputuToggle input
Buildings.Controls.OBC.CDL.Interfaces.BooleanInputclrClear input
Buildings.Controls.OBC.CDL.Interfaces.BooleanOutputyOutput with toggled signal

Revisions

  • October 13, 2020, by Jianjun Hu:
    Removed the parameter pre_y_start, and made the initial output to be equal to toggle input when the clear input is false.
    This is for Buildings, issue 2177.
  • March 9, 2020, by Michael Wetter:
    Simplified implementation, and made model work with OpenModelica.
  • April 4, 2019, by Jianjun Hu:
    Corrected implementation that causes wrong output at initial stage. This is for Buildings, issue 1402.
  • March 31, 2017, by Jianjun Hu:
    First implementation.