Buildings.Controls.OBC.CDL.Logical.Validation

Collection of models that validate the logical blocks of the CDL

Information

This package contains models that validate the blocks in Buildings.Controls.OBC.CDL.Logical.

The examples plot various outputs, which have been verified against analytical solutions. These model outputs are stored as reference data to allow continuous validation whenever models in the library change.

Extends from Modelica.Icons.ExamplesPackage (Icon for packages containing runnable examples).

Package Content

Name Description
Buildings.Controls.OBC.CDL.Logical.Validation.And And Validation model for the And block
Buildings.Controls.OBC.CDL.Logical.Validation.And3 And3 Validation model for the And3 block
Buildings.Controls.OBC.CDL.Logical.Validation.Change Change Validation model for the Change block.
Buildings.Controls.OBC.CDL.Logical.Validation.Edge Edge Validation model for the Edge block
Buildings.Controls.OBC.CDL.Logical.Validation.FallingEdge FallingEdge Validation model for the falling edge block
Buildings.Controls.OBC.CDL.Logical.Validation.Latch Latch Validation model for the Latch block
Buildings.Controls.OBC.CDL.Logical.Validation.LogicalSwitch LogicalSwitch Validation model for the LogicalSwitch block
Buildings.Controls.OBC.CDL.Logical.Validation.MultiAnd MultiAnd Model to validate the application of MultiAnd block
Buildings.Controls.OBC.CDL.Logical.Validation.Nand Nand Validation model for the Nand block
Buildings.Controls.OBC.CDL.Logical.Validation.Nor Nor Validation model for the Nor block
Buildings.Controls.OBC.CDL.Logical.Validation.Not Not Validation model for the Not block
Buildings.Controls.OBC.CDL.Logical.Validation.OnOffController OnOffController Validation model for the OnOffController block
Buildings.Controls.OBC.CDL.Logical.Validation.Or Or Validation model for the Or block
Buildings.Controls.OBC.CDL.Logical.Validation.Or3 Or3 Validation model for the Or3 block
Buildings.Controls.OBC.CDL.Logical.Validation.Switch Switch Validation model for the Switch block
Buildings.Controls.OBC.CDL.Logical.Validation.Timer Timer Validation model for the Timer block
Buildings.Controls.OBC.CDL.Logical.Validation.Toggle Toggle Validation model for the Toggle block
Buildings.Controls.OBC.CDL.Logical.Validation.TriggeredTrapezoid TriggeredTrapezoid Validation model for the TriggeredTrapezoid block
Buildings.Controls.OBC.CDL.Logical.Validation.TrueDelay TrueDelay Validation model for the TrueDelay block
Buildings.Controls.OBC.CDL.Logical.Validation.TrueFalseHold TrueFalseHold Validation model for the TrueFalseHold block
Buildings.Controls.OBC.CDL.Logical.Validation.TrueHoldWithReset TrueHoldWithReset Validation model for the TrueHoldWithReset block
Buildings.Controls.OBC.CDL.Logical.Validation.Xor Xor Validation model for the Xor block
Buildings.Controls.OBC.CDL.Logical.Validation.ZeroCrossing ZeroCrossing Validation model for the zero crossing block

Buildings.Controls.OBC.CDL.Logical.Validation.And Buildings.Controls.OBC.CDL.Logical.Validation.And

Validation model for the And block

Buildings.Controls.OBC.CDL.Logical.Validation.And

Information

Validation test for the block Buildings.Controls.OBC.CDL.Logical.And.

Extends from Modelica.Icons.Example (Icon for runnable examples).

Modelica definition

model And "Validation model for the And block" extends Modelica.Icons.Example; Buildings.Controls.OBC.CDL.Logical.Sources.Pulse booPul1(width=0.5, period=1.5) "Block that outputs cyclic on and off"; Buildings.Controls.OBC.CDL.Logical.Sources.Pulse booPul2(width=0.5, period=5) "Block that outputs cyclic on and off"; Buildings.Controls.OBC.CDL.Logical.And and1; equation connect(booPul2.y, and1.u2); connect(booPul1.y, and1.u1); end And;

Buildings.Controls.OBC.CDL.Logical.Validation.And3 Buildings.Controls.OBC.CDL.Logical.Validation.And3

Validation model for the And3 block

Buildings.Controls.OBC.CDL.Logical.Validation.And3

Information

Validation test for the block Buildings.Controls.OBC.CDL.Logical.And3.

Extends from Modelica.Icons.Example (Icon for runnable examples).

Modelica definition

model And3 "Validation model for the And3 block" extends Modelica.Icons.Example; Buildings.Controls.OBC.CDL.Logical.Sources.Pulse booPul1(width=0.5, period=1.5) "Block that outputs cyclic on and off"; Buildings.Controls.OBC.CDL.Logical.Sources.Pulse booPul2(width=0.5, period=5) "Block that outputs cyclic on and off"; Buildings.Controls.OBC.CDL.Logical.And3 and1; Buildings.Controls.OBC.CDL.Logical.Sources.Pulse booPul3(width=0.5, period=3) "Block that outputs cyclic on and off"; equation connect(booPul1.y, and1.u1); connect(booPul2.y, and1.u2); connect(booPul3.y, and1.u3); end And3;

Buildings.Controls.OBC.CDL.Logical.Validation.Change Buildings.Controls.OBC.CDL.Logical.Validation.Change

Validation model for the Change block.

Buildings.Controls.OBC.CDL.Logical.Validation.Change

Information

Validation test for the block Buildings.Controls.OBC.CDL.Logical.Change.

Extends from Modelica.Icons.Example (Icon for runnable examples).

Modelica definition

model Change "Validation model for the Change block." extends Modelica.Icons.Example; Buildings.Controls.OBC.CDL.Logical.Sources.Pulse booPul(width=0.5, period=1.0) "Block that outputs cyclic on and off"; Buildings.Controls.OBC.CDL.Logical.Change change "Outputs true if the input changes"; Buildings.Controls.OBC.CDL.Continuous.Sources.Ramp ramp2( duration=5, offset=0, height=20) "Block that generates ramp signal"; Buildings.Controls.OBC.CDL.Discrete.TriggeredSampler triggeredSampler "Triggered sampler"; equation connect(booPul.y, change.u); connect(ramp2.y, triggeredSampler.u); connect(change.y, triggeredSampler.trigger); end Change;

Buildings.Controls.OBC.CDL.Logical.Validation.Edge Buildings.Controls.OBC.CDL.Logical.Validation.Edge

Validation model for the Edge block

Buildings.Controls.OBC.CDL.Logical.Validation.Edge

Information

Validation test for the block Buildings.Controls.OBC.CDL.Logical.Edge.

Extends from Modelica.Icons.Example (Icon for runnable examples).

Modelica definition

model Edge "Validation model for the Edge block" extends Modelica.Icons.Example; Buildings.Controls.OBC.CDL.Logical.Sources.Pulse booPul(width=0.5, period=1.0) "Block that outputs cyclic on and off"; Buildings.Controls.OBC.CDL.Logical.Edge edge1 "Outputs true if the input has a rising edge"; Buildings.Controls.OBC.CDL.Continuous.Sources.Ramp ramp2( duration=5, offset=0, height=20) "Block that generates ramp signal"; Buildings.Controls.OBC.CDL.Discrete.TriggeredSampler triggeredSampler "Triggered sampler"; equation connect(booPul.y, edge1.u); connect(edge1.y, triggeredSampler.trigger); connect(ramp2.y, triggeredSampler.u); end Edge;

Buildings.Controls.OBC.CDL.Logical.Validation.FallingEdge Buildings.Controls.OBC.CDL.Logical.Validation.FallingEdge

Validation model for the falling edge block

Buildings.Controls.OBC.CDL.Logical.Validation.FallingEdge

Information

Validation test for the block Buildings.Controls.OBC.CDL.Logical.FallingEdge.

Extends from Modelica.Icons.Example (Icon for runnable examples).

Modelica definition

model FallingEdge "Validation model for the falling edge block" extends Modelica.Icons.Example; Buildings.Controls.OBC.CDL.Logical.Sources.Pulse booPul(width=0.5, period=1.0) "Block that outputs cyclic on and off"; Buildings.Controls.OBC.CDL.Logical.FallingEdge falEdg; Buildings.Controls.OBC.CDL.Continuous.Sources.Ramp ramp2( duration=5, offset=0, height=20) "Block that generates ramp signal"; Buildings.Controls.OBC.CDL.Discrete.TriggeredSampler triggeredSampler; equation connect(booPul.y, falEdg.u); connect(ramp2.y, triggeredSampler.u); connect(falEdg.y, triggeredSampler.trigger); end FallingEdge;

Buildings.Controls.OBC.CDL.Logical.Validation.Latch Buildings.Controls.OBC.CDL.Logical.Validation.Latch

Validation model for the Latch block

Buildings.Controls.OBC.CDL.Logical.Validation.Latch

Information

Validation test for the block Buildings.Controls.OBC.CDL.Logical.Latch.

The latch input u cycles from OFF to ON, with cycle period of 1.5 s and 50% ON time. The clr input u0 cycles from OFF to ON, with cycle period of 5 s and 50% ON time.

Extends from Modelica.Icons.Example (Icon for runnable examples).

Modelica definition

model Latch "Validation model for the Latch block" extends Modelica.Icons.Example; Buildings.Controls.OBC.CDL.Logical.Sources.Pulse booPul1(width=0.5, period=1.5) "Block that outputs cyclic on and off"; Buildings.Controls.OBC.CDL.Logical.Sources.Pulse booPul2(width=0.5, period=5) "Block that outputs cyclic on and off"; Buildings.Controls.OBC.CDL.Logical.Latch latch1; equation connect(booPul1.y, latch1.u); connect(booPul2.y, latch1.u0); end Latch;

Buildings.Controls.OBC.CDL.Logical.Validation.LogicalSwitch Buildings.Controls.OBC.CDL.Logical.Validation.LogicalSwitch

Validation model for the LogicalSwitch block

Buildings.Controls.OBC.CDL.Logical.Validation.LogicalSwitch

Information

Validation test for the block Buildings.Controls.OBC.CDL.Logical.LogicalSwitch.

The input u2 is the switch input: If u2 = true, then output y = u1; else output y = u3.

Extends from Modelica.Icons.Example (Icon for runnable examples).

Modelica definition

model LogicalSwitch "Validation model for the LogicalSwitch block" extends Modelica.Icons.Example; Buildings.Controls.OBC.CDL.Logical.Sources.Pulse booPul1(width=0.7, period=1.5) "Block that outputs cyclic on and off"; Buildings.Controls.OBC.CDL.Logical.Sources.Pulse booPul2(width=0.5, period=3) "Block that outputs cyclic on and off: switch between u1 and u3"; Buildings.Controls.OBC.CDL.Logical.Sources.Pulse booPul3(width=0.5, period=5) "Block that outputs cyclic on and off"; Buildings.Controls.OBC.CDL.Logical.LogicalSwitch logicalSwitch; equation connect(booPul2.y, logicalSwitch.u2); connect(booPul1.y, logicalSwitch.u1); connect(booPul3.y, logicalSwitch.u3); end LogicalSwitch;

Buildings.Controls.OBC.CDL.Logical.Validation.MultiAnd Buildings.Controls.OBC.CDL.Logical.Validation.MultiAnd

Model to validate the application of MultiAnd block

Buildings.Controls.OBC.CDL.Logical.Validation.MultiAnd

Information

Validation test for the block Buildings.Controls.OBC.CDL.Logical.MultiAnd.

The input signals are configured as follows:

Extends from Modelica.Icons.Example (Icon for runnable examples).

Modelica definition

model MultiAnd "Model to validate the application of MultiAnd block" extends Modelica.Icons.Example; Buildings.Controls.OBC.CDL.Logical.Sources.Pulse booPul1(width=0.5, period=1) "Block that outputs cyclic on and off"; Buildings.Controls.OBC.CDL.Logical.Sources.Pulse booPul2(width=0.5, period=2) "Block that outputs cyclic on and off"; Buildings.Controls.OBC.CDL.Logical.Sources.Pulse booPul3(width=0.5, period=3) "Block that outputs cyclic on and off"; Buildings.Controls.OBC.CDL.Logical.Sources.Pulse booPul4(width=0.5, period=4) "Block that outputs cyclic on and off"; Buildings.Controls.OBC.CDL.Logical.Sources.Pulse booPul5(width=0.5, period=5) "Block that outputs cyclic on and off"; Buildings.Controls.OBC.CDL.Logical.MultiAnd mulAnd_1(nu=1) "Logical 'MultiAnd': 1 input connection y=u"; Buildings.Controls.OBC.CDL.Logical.MultiAnd mulAnd_2(nu=2) "Logical 'MultiAnd': 2 input connection y=and(u1, u2)"; Buildings.Controls.OBC.CDL.Logical.MultiAnd mulAnd_5(nu=5) "Logical 'MultiAnd': 5 input connection y=and(u1, u2, ..., u5)"; equation connect(booPul1.y, mulAnd_5.u[1]); connect(booPul2.y, mulAnd_5.u[2]); connect(booPul3.y, mulAnd_5.u[3]); connect(booPul4.y, mulAnd_5.u[4]); connect(booPul5.y, mulAnd_5.u[5]); connect(booPul1.y, mulAnd_2.u[1]); connect(booPul2.y, mulAnd_2.u[2]); connect(booPul1.y, mulAnd_1.u[1]); end MultiAnd;

Buildings.Controls.OBC.CDL.Logical.Validation.Nand Buildings.Controls.OBC.CDL.Logical.Validation.Nand

Validation model for the Nand block

Buildings.Controls.OBC.CDL.Logical.Validation.Nand

Information

Validation test for the block Buildings.Controls.OBC.CDL.Logical.Nand.

Extends from Modelica.Icons.Example (Icon for runnable examples).

Modelica definition

model Nand "Validation model for the Nand block" extends Modelica.Icons.Example; Buildings.Controls.OBC.CDL.Logical.Sources.Pulse booPul1(width=0.5, period=1.5) "Block that outputs cyclic on and off"; Buildings.Controls.OBC.CDL.Logical.Sources.Pulse booPul2(width=0.5, period=5) "Block that outputs cyclic on and off"; Buildings.Controls.OBC.CDL.Logical.Nand nand1; equation connect(booPul2.y, nand1.u2); connect(booPul1.y, nand1.u1); end Nand;

Buildings.Controls.OBC.CDL.Logical.Validation.Nor Buildings.Controls.OBC.CDL.Logical.Validation.Nor

Validation model for the Nor block

Buildings.Controls.OBC.CDL.Logical.Validation.Nor

Information

Validation test for the block Buildings.Controls.OBC.CDL.Logical.Nor.

Extends from Modelica.Icons.Example (Icon for runnable examples).

Modelica definition

model Nor "Validation model for the Nor block" extends Modelica.Icons.Example; Buildings.Controls.OBC.CDL.Logical.Sources.Pulse booPul1(width=0.5, period=1.5) "Block that outputs cyclic on and off"; Buildings.Controls.OBC.CDL.Logical.Sources.Pulse booPul2(width=0.5, period=5) "Block that outputs cyclic on and off"; Buildings.Controls.OBC.CDL.Logical.Nor nor1; equation connect(booPul2.y, nor1.u2); connect(booPul1.y, nor1.u1); end Nor;

Buildings.Controls.OBC.CDL.Logical.Validation.Not Buildings.Controls.OBC.CDL.Logical.Validation.Not

Validation model for the Not block

Buildings.Controls.OBC.CDL.Logical.Validation.Not

Information

Validation test for the block Buildings.Controls.OBC.CDL.Logical.Not.

Extends from Modelica.Icons.Example (Icon for runnable examples).

Modelica definition

model Not "Validation model for the Not block" extends Modelica.Icons.Example; Buildings.Controls.OBC.CDL.Logical.Sources.Pulse booPul(width=0.5, period=1.5) "Block that outputs cyclic on and off"; Buildings.Controls.OBC.CDL.Logical.Not not1; equation connect(booPul.y, not1.u); end Not;

Buildings.Controls.OBC.CDL.Logical.Validation.OnOffController Buildings.Controls.OBC.CDL.Logical.Validation.OnOffController

Validation model for the OnOffController block

Buildings.Controls.OBC.CDL.Logical.Validation.OnOffController

Information

Validation test for the block Buildings.Controls.OBC.CDL.Logical.OnOffController.

Extends from Modelica.Icons.Example (Icon for runnable examples).

Modelica definition

model OnOffController "Validation model for the OnOffController block" extends Modelica.Icons.Example; Buildings.Controls.OBC.CDL.Continuous.Sources.Ramp ramp1( duration=5, offset=0, height=31.415926) "Block that generates ramp signal"; Buildings.Controls.OBC.CDL.Continuous.Sin sin1 "Block that outputs the sine of the input"; Buildings.Controls.OBC.CDL.Continuous.Sources.Constant cons2(k=0.7) "Constant as source term"; Buildings.Controls.OBC.CDL.Logical.OnOffController onOffController(bandwidth=0.1) "Delay a rising edge of the input, but do not delay a falling edge."; equation connect(ramp1.y, sin1.u); connect(sin1.y, onOffController.u); connect(cons2.y, onOffController.reference); end OnOffController;

Buildings.Controls.OBC.CDL.Logical.Validation.Or Buildings.Controls.OBC.CDL.Logical.Validation.Or

Validation model for the Or block

Buildings.Controls.OBC.CDL.Logical.Validation.Or

Information

Validation test for the block Buildings.Controls.OBC.CDL.Logical.Or.

Extends from Modelica.Icons.Example (Icon for runnable examples).

Modelica definition

model Or "Validation model for the Or block" extends Modelica.Icons.Example; Buildings.Controls.OBC.CDL.Logical.Sources.Pulse booPul1(width=0.5, period=1.5) "Block that outputs cyclic on and off"; Buildings.Controls.OBC.CDL.Logical.Sources.Pulse booPul2(width=0.5, period=3) "Block that outputs cyclic on and off"; Buildings.Controls.OBC.CDL.Logical.Or or1; equation connect(booPul2.y, or1.u2); connect(booPul1.y, or1.u1); end Or;

Buildings.Controls.OBC.CDL.Logical.Validation.Or3 Buildings.Controls.OBC.CDL.Logical.Validation.Or3

Validation model for the Or3 block

Buildings.Controls.OBC.CDL.Logical.Validation.Or3

Information

Validation test for the block Buildings.Controls.OBC.CDL.Logical.Or3.

Extends from Modelica.Icons.Example (Icon for runnable examples).

Modelica definition

model Or3 "Validation model for the Or3 block" extends Modelica.Icons.Example; Buildings.Controls.OBC.CDL.Logical.Sources.Pulse booPul1(width=0.5, period=1.5) "Block that outputs cyclic on and off"; Buildings.Controls.OBC.CDL.Logical.Sources.Pulse booPul2(width=0.5, period=3) "Block that outputs cyclic on and off"; Buildings.Controls.OBC.CDL.Logical.Or3 or1; Buildings.Controls.OBC.CDL.Logical.Sources.Pulse booPul3(width=0.5, period=5) "Block that outputs cyclic on and off"; equation connect(booPul3.y, or1.u3); connect(booPul2.y, or1.u2); connect(booPul1.y, or1.u1); end Or3;

Buildings.Controls.OBC.CDL.Logical.Validation.Switch Buildings.Controls.OBC.CDL.Logical.Validation.Switch

Validation model for the Switch block

Buildings.Controls.OBC.CDL.Logical.Validation.Switch

Information

Validation test for the block Buildings.Controls.OBC.CDL.Logical.Switch.

Extends from Modelica.Icons.Example (Icon for runnable examples).

Modelica definition

model Switch "Validation model for the Switch block" extends Modelica.Icons.Example; Buildings.Controls.OBC.CDL.Continuous.Sources.Ramp ramp1( duration=5, offset=-1, height=6) "Block that generates ramp signal"; Buildings.Controls.OBC.CDL.Continuous.Sources.Ramp ramp2( duration=5, offset=-1, height=2) "Block that generates ramp signal"; Buildings.Controls.OBC.CDL.Logical.Sources.Pulse booPul(width=0.5, period=2) "Block that outputs cyclic on and off"; Buildings.Controls.OBC.CDL.Logical.Switch switch1; equation connect(booPul.y, switch1.u2); connect(ramp2.y, switch1.u3); connect(ramp1.y, switch1.u1); end Switch;

Buildings.Controls.OBC.CDL.Logical.Validation.Timer Buildings.Controls.OBC.CDL.Logical.Validation.Timer

Validation model for the Timer block

Buildings.Controls.OBC.CDL.Logical.Validation.Timer

Information

Validation test for the block Buildings.Controls.OBC.CDL.Logical.Timer.

Extends from Modelica.Icons.Example (Icon for runnable examples).

Modelica definition

model Timer "Validation model for the Timer block" extends Modelica.Icons.Example; Buildings.Controls.OBC.CDL.Logical.Sources.Pulse booPul(width=0.5, period=2) "Block that outputs cyclic on and off"; Buildings.Controls.OBC.CDL.Logical.Timer timer1; equation connect(booPul.y, timer1.u); end Timer;

Buildings.Controls.OBC.CDL.Logical.Validation.Toggle Buildings.Controls.OBC.CDL.Logical.Validation.Toggle

Validation model for the Toggle block

Buildings.Controls.OBC.CDL.Logical.Validation.Toggle

Information

Validation test for the block Buildings.Controls.OBC.CDL.Logical.Toggle.

The latch input u cycles from OFF to ON, with cycle period of 1.5 s and 50% ON time. The clr input u0 cycles from OFF to ON, with cycle period of 5 s and 50% ON time.

Extends from Modelica.Icons.Example (Icon for runnable examples).

Modelica definition

model Toggle "Validation model for the Toggle block" extends Modelica.Icons.Example; Buildings.Controls.OBC.CDL.Logical.Sources.Pulse booPul1(width=0.5, period=1.5) "Block that outputs cyclic on and off"; Buildings.Controls.OBC.CDL.Logical.Sources.Pulse booPul2(width=0.5, period=5) "Block that outputs cyclic on and off"; Buildings.Controls.OBC.CDL.Logical.Toggle toggle1; equation connect(booPul1.y, toggle1.u); connect(booPul2.y, toggle1.u0); end Toggle;

Buildings.Controls.OBC.CDL.Logical.Validation.TriggeredTrapezoid Buildings.Controls.OBC.CDL.Logical.Validation.TriggeredTrapezoid

Validation model for the TriggeredTrapezoid block

Buildings.Controls.OBC.CDL.Logical.Validation.TriggeredTrapezoid

Information

Validation test for the block Buildings.Controls.OBC.CDL.Logical.TriggeredTrapezoid.

Extends from Modelica.Icons.Example (Icon for runnable examples).

Modelica definition

model TriggeredTrapezoid "Validation model for the TriggeredTrapezoid block" extends Modelica.Icons.Example; Buildings.Controls.OBC.CDL.Logical.Sources.Pulse booPul(width=0.5, period=2) "Block that outputs cyclic on and off"; Buildings.Controls.OBC.CDL.Logical.TriggeredTrapezoid triggeredTrapezoid1( amplitude=5, rising=0.3, offset=1.5) "Triggered trapezoid generator"; equation connect(booPul.y, triggeredTrapezoid1.u); end TriggeredTrapezoid;

Buildings.Controls.OBC.CDL.Logical.Validation.TrueDelay Buildings.Controls.OBC.CDL.Logical.Validation.TrueDelay

Validation model for the TrueDelay block

Buildings.Controls.OBC.CDL.Logical.Validation.TrueDelay

Information

Validation test for the block Buildings.Controls.OBC.CDL.Logical.TrueDelay.

Extends from Modelica.Icons.Example (Icon for runnable examples).

Modelica definition

model TrueDelay "Validation model for the TrueDelay block" extends Modelica.Icons.Example; Buildings.Controls.OBC.CDL.Logical.Sources.Pulse booPul(width=0.5, period=1.5) "Block that outputs cyclic on and off"; Buildings.Controls.OBC.CDL.Logical.TrueDelay onDelay(delayTime=0) "Delay a rising edge of the input, but do not delay a falling edge."; Buildings.Controls.OBC.CDL.Logical.TrueDelay onDelay1(delayTime=0.5) "Delay a rising edge of the input, but do not delay a falling edge."; Buildings.Controls.OBC.CDL.Logical.TrueDelay onDelay2(delayTime=0.8) "Delay a rising edge of the input, but do not delay a falling edge."; Buildings.Controls.OBC.CDL.Logical.TrueDelay onDelay4(delayTime=0) "Delay a rising edge of the input, but do not delay a falling edge."; Buildings.Controls.OBC.CDL.Logical.TrueDelay onDelay5(delayTime=0.5) "Delay a rising edge of the input, but do not delay a falling edge."; Buildings.Controls.OBC.CDL.Logical.TrueDelay onDelay6(delayTime=0.8) "Delay a rising edge of the input, but do not delay a falling edge."; Buildings.Controls.OBC.CDL.Logical.Not not1 "Negation of input signal"; Buildings.Controls.OBC.CDL.Logical.TrueDelay onDelay3(delayTime=1.8) "Delay a rising edge of the input, but do not delay a falling edge."; Buildings.Controls.OBC.CDL.Logical.TrueDelay onDelay7(delayTime=1.8) "Delay a rising edge of the input, but do not delay a falling edge."; equation connect(booPul.y, not1.u); connect(booPul.y, onDelay.u); connect(booPul.y, onDelay2.u); connect(booPul.y, onDelay1.u); connect(booPul.y, onDelay3.u); connect(not1.y, onDelay4.u); connect(not1.y, onDelay6.u); connect(not1.y, onDelay5.u); connect(not1.y, onDelay7.u); end TrueDelay;

Buildings.Controls.OBC.CDL.Logical.Validation.TrueFalseHold Buildings.Controls.OBC.CDL.Logical.Validation.TrueFalseHold

Validation model for the TrueFalseHold block

Buildings.Controls.OBC.CDL.Logical.Validation.TrueFalseHold

Information

Validation test for the block Buildings.Controls.OBC.CDL.Logical.TrueFalseHold.

The validation uses different instances to validate different hold trueHoldDurations, different lengths of the input pulse, and different initial values for the input signal.

Extends from Modelica.Icons.Example (Icon for runnable examples).

Modelica definition

model TrueFalseHold "Validation model for the TrueFalseHold block" extends Modelica.Icons.Example; Buildings.Controls.OBC.CDL.Logical.Sources.Pulse booPul(startTime=0, period=1500) "Boolean pulse input signal"; Buildings.Controls.OBC.CDL.Logical.TrueFalseHold truFalHol(trueHoldDuration=1000) "The block introduces a minimal offset between the input signal rising and falling edge"; Buildings.Controls.OBC.CDL.Logical.Sources.Pulse booPul1( startTime=0, period=1000, width=0.25) "Boolean pulse input signal"; Buildings.Controls.OBC.CDL.Logical.TrueFalseHold truFalHol1(trueHoldDuration=1000) "The block introduces a minimal offset between the input signal rising and falling edge"; Buildings.Controls.OBC.CDL.Logical.Sources.Pulse booPul2(startTime=0, period=1500) "Boolean pulse input signal"; Buildings.Controls.OBC.CDL.Logical.TrueFalseHold truFalHol2(trueHoldDuration=1000) "The block introduces a minimal offset between the input signal rising and falling edge"; Buildings.Controls.OBC.CDL.Logical.Sources.Pulse booPul3( startTime=0, period=1000, width=0.25) "Boolean pulse input signal"; Buildings.Controls.OBC.CDL.Logical.TrueFalseHold truFalHol3(trueHoldDuration=1000) "The block introduces a minimal offset between the input signal rising and falling edge"; Buildings.Controls.OBC.CDL.Logical.Not not1 "Negation of input signal"; Buildings.Controls.OBC.CDL.Logical.Not not3 "Negation of input signal"; Buildings.Controls.OBC.CDL.Logical.Sources.Pulse booPul4(startTime=100, period=1500) "Boolean pulse input signal"; Buildings.Controls.OBC.CDL.Logical.TrueFalseHold truFalHol4(trueHoldDuration=1000) "The block introduces a minimal offset between the input signal rising and falling edge"; Buildings.Controls.OBC.CDL.Logical.Sources.Pulse booPul5( startTime=100, period=1000, width=0.25) "Boolean pulse input signal"; Buildings.Controls.OBC.CDL.Logical.TrueFalseHold truFalHol5(trueHoldDuration=1000) "The block introduces a minimal offset between the input signal rising and falling edge"; Buildings.Controls.OBC.CDL.Logical.Sources.Pulse booPul6(startTime=100, period=1500) "Boolean pulse input signal"; Buildings.Controls.OBC.CDL.Logical.TrueFalseHold truFalHol6(trueHoldDuration=1000) "The block introduces a minimal offset between the input signal rising and falling edge"; Buildings.Controls.OBC.CDL.Logical.Sources.Pulse booPul7( startTime=100, period=1000, width=0.25) "Boolean pulse input signal"; Buildings.Controls.OBC.CDL.Logical.TrueFalseHold truFalHol7(trueHoldDuration=1000) "The block introduces a minimal offset between the input signal rising and falling edge"; Buildings.Controls.OBC.CDL.Logical.Not not2 "Negation of input signal"; Buildings.Controls.OBC.CDL.Logical.Not not4 "Negation of input signal"; equation connect(booPul.y, truFalHol.u); connect(booPul1.y, truFalHol1.u); connect(booPul2.y, not1.u); connect(not1.y, truFalHol2.u); connect(booPul3.y, not3.u); connect(not3.y, truFalHol3.u); connect(booPul4.y, truFalHol4.u); connect(booPul5.y, truFalHol5.u); connect(booPul6.y, not2.u); connect(not2.y, truFalHol6.u); connect(booPul7.y, not4.u); connect(not4.y, truFalHol7.u); end TrueFalseHold;

Buildings.Controls.OBC.CDL.Logical.Validation.TrueHoldWithReset Buildings.Controls.OBC.CDL.Logical.Validation.TrueHoldWithReset

Validation model for the TrueHoldWithReset block

Buildings.Controls.OBC.CDL.Logical.Validation.TrueHoldWithReset

Information

Validation test for the block Buildings.Controls.OBC.CDL.Logical.TrueHoldWithReset.

The validation uses different instances to validate different hold durations, different lengths of the input pulse, and different initial values for the input signal.

Extends from Modelica.Icons.Example (Icon for runnable examples).

Modelica definition

model TrueHoldWithReset "Validation model for the TrueHoldWithReset block" extends Modelica.Icons.Example; Buildings.Controls.OBC.CDL.Logical.Sources.Pulse booPul(period=9000, startTime=300) "Boolean pulse input signal"; Buildings.Controls.OBC.CDL.Logical.TrueHoldWithReset truHol(duration=3600) "Block that holds a signal on for a requested time period"; Buildings.Controls.OBC.CDL.Logical.Sources.Pulse booPul1(period=3600) "Boolean pulse input signal"; Buildings.Controls.OBC.CDL.Logical.TrueHoldWithReset truHol1(duration=600) "Block that holds a signal on for a requested time period"; Buildings.Controls.OBC.CDL.Logical.Sources.Pulse booPul2(period=9000, startTime=300) "Boolean pulse input signal"; Buildings.Controls.OBC.CDL.Logical.TrueHoldWithReset truHol2(duration=3600) "Block that holds a signal on for a requested time period"; Buildings.Controls.OBC.CDL.Logical.Sources.Pulse booPul3(period=3600) "Boolean pulse input signal"; Buildings.Controls.OBC.CDL.Logical.TrueHoldWithReset truHol3(duration=600) "Block that holds a signal on for a requested time period"; Buildings.Controls.OBC.CDL.Logical.Not not2 "Negation of input signal"; Buildings.Controls.OBC.CDL.Logical.Not not3 "Negation of input signal"; equation connect(booPul.y, truHol.u); connect(booPul1.y, truHol1.u); connect(booPul2.y, not2.u); connect(not2.y, truHol2.u); connect(booPul3.y, not3.u); connect(not3.y, truHol3.u); end TrueHoldWithReset;

Buildings.Controls.OBC.CDL.Logical.Validation.Xor Buildings.Controls.OBC.CDL.Logical.Validation.Xor

Validation model for the Xor block

Buildings.Controls.OBC.CDL.Logical.Validation.Xor

Information

Validation test for the block Buildings.Controls.OBC.CDL.Logical.Xor.

Extends from Modelica.Icons.Example (Icon for runnable examples).

Modelica definition

model Xor "Validation model for the Xor block" extends Modelica.Icons.Example; Buildings.Controls.OBC.CDL.Logical.Sources.Pulse booPul1(width=0.5, period=1.5) "Block that outputs cyclic on and off"; Buildings.Controls.OBC.CDL.Logical.Sources.Pulse booPul2(width=0.5, period=5) "Block that outputs cyclic on and off"; Buildings.Controls.OBC.CDL.Logical.Xor xor1; equation connect(booPul2.y, xor1.u2); connect(booPul1.y, xor1.u1); end Xor;

Buildings.Controls.OBC.CDL.Logical.Validation.ZeroCrossing Buildings.Controls.OBC.CDL.Logical.Validation.ZeroCrossing

Validation model for the zero crossing block

Buildings.Controls.OBC.CDL.Logical.Validation.ZeroCrossing

Information

Validation test for the block Buildings.Controls.OBC.CDL.Logical.ZeroCrossing.

Extends from Modelica.Icons.Example (Icon for runnable examples).

Modelica definition

model ZeroCrossing "Validation model for the zero crossing block" extends Modelica.Icons.Example; Buildings.Controls.OBC.CDL.Continuous.Sources.Ramp ramp1( duration=5, offset=0, height=31.415926) "Block that generates ramp signal"; Buildings.Controls.OBC.CDL.Continuous.Sin sin1 "Block that outputs the sine of the input"; Buildings.Controls.OBC.CDL.Logical.Sources.Pulse booPul1(width=0.15, period=5) "Block that outputs cyclic on and off"; Buildings.Controls.OBC.CDL.Logical.ZeroCrossing zeroCrossing "Zero crossing block"; Buildings.Controls.OBC.CDL.Continuous.Sources.Ramp ramp2( duration=5, offset=0, height=31.415926) "Block that generates ramp signal"; Controls.OBC.CDL.Discrete.TriggeredSampler triggeredSampler "Triggered sampler"; equation connect(booPul1.y, zeroCrossing.enable); connect(ramp1.y, sin1.u); connect(sin1.y, zeroCrossing.u); connect(ramp2.y, triggeredSampler.u); connect(zeroCrossing.y, triggeredSampler.trigger); end ZeroCrossing;