Skip to content

Commit fae89a1

Browse files
authored
Merge pull request #2065 from ibpsa/issue2064_latch_initialization
Reformulated initialization of CDL.Logical.Latch
2 parents 8d924d2 + 1ffba03 commit fae89a1

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

IBPSA/Controls/OBC/CDL/Logical/Latch.mo

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,11 @@ block Latch
1010
IBPSA.Controls.OBC.CDL.Interfaces.BooleanOutput y
1111
"Output with latched signal"
1212
annotation (Placement(transformation(extent={{100,-20},{140,20}})));
13+
14+
initial equation
15+
y = not clr and u;
1316
equation
14-
when initial() then
15-
y=not clr and u;
16-
elsewhen {clr, u} then
17+
when {clr, u} then
1718
y=not clr and u;
1819
end when;
1920
annotation (
@@ -118,6 +119,11 @@ At initial time, if <code>clr = false</code>, then the output will be
118119
revisions="<html>
119120
<ul>
120121
<li>
122+
November 3, 2025, by Michael Wetter:<br/>
123+
Reformulated initialization to enable translation of system model with this block in OpenModelica.<br/>
124+
This is for <a href=\"https://github.com/ibpsa/modelica-ibpsa/issues/2064\">IBPSA, issue 2064</a>.
125+
</li>
126+
<li>
121127
April 15, 2024, by Antoine Gautier:<br/>
122128
Simplified the implementation.<br/>
123129
This is for <a href=\"https://github.com/lbl-srg/modelica-buildings/issues/3796\">Buildings, issue 3796</a>.
@@ -135,7 +141,7 @@ Simplified implementation, and made model work with OpenModelica.
135141
<li>
136142
April 4, 2019, by Jianjun Hu:<br/>
137143
Corrected implementation that causes wrong output at initial stage.
138-
This is for <a href=\"https://github.com/ibpsa/modelica-ibpsa/issues/1402\">Buildings, issue 1402</a>.
144+
This is for <a href=\"https://github.com/lbl-srg/modelica-buildings/issues/1402\">Buildings, issue 1402</a>.
139145
</li>
140146
<li>
141147
December 1, 2017, by Michael Wetter:<br/>

0 commit comments

Comments
 (0)