Buildings.Obsolete.Controls.OBC.CDL.Logical

Package with obsolete models of logical blocks

Information

Package with obsolete blocks for elementary mathematical functions for boolean variables.

Package Content

Name Description
Buildings.Obsolete.Controls.OBC.CDL.Logical.And3 And3 Logical 'and3': y = u1 and u2 and u3
Buildings.Obsolete.Controls.OBC.CDL.Logical.OnOffController OnOffController On-off controller
Buildings.Obsolete.Controls.OBC.CDL.Logical.Or3 Or3 Logical 'or': y = u1 or u2 or u3
Buildings.Obsolete.Controls.OBC.CDL.Logical.Timer Timer Timer measuring the time from the time instant where the Boolean input became true
Buildings.Obsolete.Controls.OBC.CDL.Logical.TriggeredTrapezoid TriggeredTrapezoid Triggered trapezoid generator
Buildings.Obsolete.Controls.OBC.CDL.Logical.ZeroCrossing ZeroCrossing Trigger zero crossing of input u
Buildings.Obsolete.Controls.OBC.CDL.Logical.Validation Validation Collection of models that validate the logical blocks of the CDL

Buildings.Obsolete.Controls.OBC.CDL.Logical.And3 Buildings.Obsolete.Controls.OBC.CDL.Logical.And3

Logical 'and3': y = u1 and u2 and u3

Buildings.Obsolete.Controls.OBC.CDL.Logical.And3

Information

Block that outputs true if all inputs are true. Otherwise the output is false.

Extends from Modelica.Icons.ObsoleteModel (Icon for classes that are obsolete and will be removed in later versions).

Connectors

TypeNameDescription
input BooleanInputu1Connector of first Boolean input signal
input BooleanInputu2Connector of second Boolean input signal
input BooleanInputu3Connector of third Boolean input signal
output BooleanOutputyConnector of Boolean output signal

Modelica definition

block And3 "Logical 'and3': y = u1 and u2 and u3" extends Modelica.Icons.ObsoleteModel; Buildings.Controls.OBC.CDL.Interfaces.BooleanInput u1 "Connector of first Boolean input signal"; Buildings.Controls.OBC.CDL.Interfaces.BooleanInput u2 "Connector of second Boolean input signal"; Buildings.Controls.OBC.CDL.Interfaces.BooleanInput u3 "Connector of third Boolean input signal"; Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput y "Connector of Boolean output signal"; equation y=u1 and u2 and u3; end And3;

Buildings.Obsolete.Controls.OBC.CDL.Logical.OnOffController Buildings.Obsolete.Controls.OBC.CDL.Logical.OnOffController

On-off controller

Buildings.Obsolete.Controls.OBC.CDL.Logical.OnOffController

Information

Block that represents and on/off controller.

The block outputs true when the input signal u falls below the reference signal minus half of the bandwidth. It sets the output signal to false when the input signal u exceeds the reference signal plus half of the bandwidth. The parameter pre_y_start is used to initialize the previous value of the output pre(y).

Extends from Modelica.Icons.ObsoleteModel (Icon for classes that are obsolete and will be removed in later versions).

Parameters

TypeNameDefaultDescription
Realbandwidth Bandwidth around reference signal
Booleanpre_y_startfalseValue of pre(y) at initial time

Connectors

TypeNameDescription
input RealInputreferenceConnector of Real input signal used as reference signal
input RealInputuConnector of Real input signal used as measurement signal
output BooleanOutputyConnector of Real output signal used as actuator signal

Modelica definition

block OnOffController "On-off controller" extends Modelica.Icons.ObsoleteModel; parameter Real bandwidth( min=0) "Bandwidth around reference signal"; parameter Boolean pre_y_start=false "Value of pre(y) at initial time"; Buildings.Controls.OBC.CDL.Interfaces.RealInput reference "Connector of Real input signal used as reference signal"; Buildings.Controls.OBC.CDL.Interfaces.RealInput u "Connector of Real input signal used as measurement signal"; Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput y "Connector of Real output signal used as actuator signal"; initial equation pre(y)=pre_y_start; equation y=pre(y) and (u < reference+bandwidth/2) or (u < reference-bandwidth/2); end OnOffController;

Buildings.Obsolete.Controls.OBC.CDL.Logical.Or3 Buildings.Obsolete.Controls.OBC.CDL.Logical.Or3

Logical 'or': y = u1 or u2 or u3

Buildings.Obsolete.Controls.OBC.CDL.Logical.Or3

Information

Block that outputs true if at least one input is true. Otherwise the output is false.

Extends from Modelica.Icons.ObsoleteModel (Icon for classes that are obsolete and will be removed in later versions).

Connectors

TypeNameDescription
input BooleanInputu1Connector of first Boolean input signal
input BooleanInputu2Connector of second Boolean input signal
input BooleanInputu3Connector of third Boolean input signal
output BooleanOutputyConnector of Boolean output signal

Modelica definition

block Or3 "Logical 'or': y = u1 or u2 or u3" extends Modelica.Icons.ObsoleteModel; Buildings.Controls.OBC.CDL.Interfaces.BooleanInput u1 "Connector of first Boolean input signal"; Buildings.Controls.OBC.CDL.Interfaces.BooleanInput u2 "Connector of second Boolean input signal"; Buildings.Controls.OBC.CDL.Interfaces.BooleanInput u3 "Connector of third Boolean input signal"; Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput y "Connector of Boolean output signal"; equation y=u1 or u2 or u3; end Or3;

Buildings.Obsolete.Controls.OBC.CDL.Logical.Timer Buildings.Obsolete.Controls.OBC.CDL.Logical.Timer

Timer measuring the time from the time instant where the Boolean input became true

Buildings.Obsolete.Controls.OBC.CDL.Logical.Timer

Information

Timer with option to accumulate time until it is reset by an input signal.

Each time the Boolean input u becomes true, the timer runs, otherwise it is dormant.

Extends from Modelica.Icons.ObsoleteModel (Icon for classes that are obsolete and will be removed in later versions).

Parameters

TypeNameDefaultDescription
BooleanaccumulatefalseIf true, accumulate time until Boolean input 'reset' becomes true, otherwise reset timer whenever u becomes true

Connectors

TypeNameDescription
input BooleanInputuConnector for signal that switches timer on if true, and off if false
input BooleanInputresetConnector for signal that sets timer to zero if it switches to true. The input value will be ignored if the timer does not accumulate time
output RealOutputyTimer output [s]

Modelica definition

block Timer "Timer measuring the time from the time instant where the Boolean input became true" extends Modelica.Icons.ObsoleteModel; parameter Boolean accumulate = false "If true, accumulate time until Boolean input 'reset' becomes true, otherwise reset timer whenever u becomes true"; Buildings.Controls.OBC.CDL.Interfaces.BooleanInput u "Connector for signal that switches timer on if true, and off if false"; Buildings.Controls.OBC.CDL.Interfaces.BooleanInput reset "Connector for signal that sets timer to zero if it switches to true. The input value will be ignored if the timer does not accumulate time"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput y( final quantity="Time", final unit="s") "Timer output"; protected discrete Modelica.Units.SI.Time entryTime "Time instant when u became true"; discrete Modelica.Units.SI.Time yAcc "Accumulated time up to last change to true"; Buildings.Controls.OBC.CDL.Interfaces.BooleanInput reset_internal( final start=false, final fixed=true) "Internal connector"; initial equation pre(entryTime) = time; yAcc = 0; equation if not accumulate then reset_internal = true; else reset_internal = reset; end if; when u and (not edge(reset_internal)) then entryTime = time; elsewhen reset then entryTime = time; end when; when reset then yAcc = 0; elsewhen (not u) then yAcc = pre(y); end when; if not accumulate then y = if u then time - entryTime else 0.0; else y = if u then yAcc + (time - entryTime) else yAcc; end if; end Timer;

Buildings.Obsolete.Controls.OBC.CDL.Logical.TriggeredTrapezoid Buildings.Obsolete.Controls.OBC.CDL.Logical.TriggeredTrapezoid

Triggered trapezoid generator

Buildings.Obsolete.Controls.OBC.CDL.Logical.TriggeredTrapezoid

Information

Block that represents a triggered trapezoid.

The block has a Boolean input and a Real output signal and requires the parameters amplitude, rising, falling and offset. The output signal y represents a trapezoidal signal dependent on the input signal u.

The behaviour is as follows: Assume the initial input to be false. In this case, the output will be offset. After a rising edge (i.e., the input changes from false to true), the output is rising during rising to the sum of offset and amplitude. In contrast, after a falling edge (i.e., the input changes from true to false), the output is falling during falling to a value of offset.

TriggeredTrapezoid.png

Note, the case of edges before expiration of rising or falling is handled properly.

Extends from Modelica.Icons.ObsoleteModel (Icon for classes that are obsolete and will be removed in later versions).

Parameters

TypeNameDefaultDescription
Realamplitude Amplitude of trapezoid
Realrising0Rising duration of trapezoid [s]
RealfallingrisingFalling duration of trapezoid [s]
Realoffset0Offset of output signal

Connectors

TypeNameDescription
input BooleanInputuConnector of Boolean input signal
output RealOutputyConnector of Real output signal

Modelica definition

block TriggeredTrapezoid "Triggered trapezoid generator" extends Modelica.Icons.ObsoleteModel; parameter Real amplitude "Amplitude of trapezoid"; parameter Real rising( final quantity="Time", final unit="s", final min=0)=0 "Rising duration of trapezoid"; parameter Real falling( final quantity="Time", final unit="s", final min=0)=rising "Falling duration of trapezoid"; parameter Real offset=0 "Offset of output signal"; Buildings.Controls.OBC.CDL.Interfaces.BooleanInput u "Connector of Boolean input signal"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput y "Connector of Real output signal"; protected discrete Real endValue "Value of y at time of recent edge"; discrete Real rate "Current rising/falling rate"; discrete Real T( final quantity="Time", final unit="s") "Predicted time of output reaching endValue"; equation y=if time < T then endValue-(T-time)*rate else endValue; when {initial(),u,not u} then endValue= if u then offset+amplitude else offset; rate= if u and (rising > 0) then amplitude/rising else if not u and (falling > 0) then -amplitude/falling else 0; T=if u and not(rising > 0) or not u and not(falling > 0) or not abs(amplitude) > 0 or initial() then time else time+(endValue-pre(y))/rate; end when; end TriggeredTrapezoid;

Buildings.Obsolete.Controls.OBC.CDL.Logical.ZeroCrossing Buildings.Obsolete.Controls.OBC.CDL.Logical.ZeroCrossing

Trigger zero crossing of input u

Buildings.Obsolete.Controls.OBC.CDL.Logical.ZeroCrossing

Information

Block that detects zero crossings.

The output y is true at the time instant when the input u becomes zero, provided the input enable is true. At all other time instants, the output y is false. If the input u is zero at a time instant when the enable input changes its value, then the output y is false.

Note, that in the plot window of a Modelica simulator, the output of this block is usually identically to false, because the output may only be true at an event instant, but not during continuous integration. In order to check that this component is actually working as expected, one should connect its output to, e.g., component Buildings.Controls.OBC.CDL.Discrete.TriggeredSampler.

Extends from Modelica.Icons.ObsoleteModel (Icon for classes that are obsolete and will be removed in later versions).

Connectors

TypeNameDescription
input RealInputuConnector of Real input signal
output BooleanOutputyConnector of Boolean output signal
input BooleanInputenableZero input crossing is triggered if the enable input signal is true

Modelica definition

block ZeroCrossing "Trigger zero crossing of input u" extends Modelica.Icons.ObsoleteModel; Buildings.Controls.OBC.CDL.Interfaces.RealInput u "Connector of Real input signal"; Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput y "Connector of Boolean output signal"; Buildings.Controls.OBC.CDL.Interfaces.BooleanInput enable "Zero input crossing is triggered if the enable input signal is true"; protected Boolean disable=not enable "Boolean not of enable input"; Boolean u_pos "Positive real input"; initial equation pre(u_pos)=false; pre(enable)=false; pre(disable)=not pre(enable); equation u_pos=enable and u >= 0; y=change(u_pos) and not edge(enable) and not edge(disable); end ZeroCrossing;