Skip to content

Commit 44bc61f

Browse files
author
Willi Braun
committed
- #2975 fixed.
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@23354 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
1 parent ddeeba3 commit 44bc61f

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Compiler/Template/CodegenFMU.tpl

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2208,7 +2208,7 @@ case FMIIMPORT(fmiInfo=INFO(__),fmiExperimentAnnotation=EXPERIMENTANNOTATION(__)
22082208
end for;
22092209

22102210
triggerDSSEvent = noEvent(if callEventUpdate then flowStatesInputs+1.0 else flowStatesInputs-1.0);
2211-
nextEventTime = fmi2Functions.fmi2nextEventTime(fmi2me, flowStatesInputs);
2211+
22122212
equation
22132213
<%if not boolAnd(stringEq(realOutputVariablesNames, ""), stringEq(realOutputVariablesVRs, "")) then "{"+realOutputVariablesNames+"} = fmi2Functions.fmi2GetReal(fmi2me, {"+realOutputVariablesVRs+"}, flowStatesInputs);"%>
22142214
<%if not boolAnd(stringEq(integerOutputVariablesNames, ""), stringEq(integerOutputVariablesVRs, "")) then "{"+integerOutputVariablesNames+"} = fmi2Functions.fmi2GetInteger(fmi2me, {"+integerOutputVariablesVRs+"}, flowStatesInputs);"%>
@@ -2218,14 +2218,15 @@ case FMIIMPORT(fmiInfo=INFO(__),fmiExperimentAnnotation=EXPERIMENTANNOTATION(__)
22182218
algorithm
22192219
<%if intGt(listLength(fmiInfo.fmiNumberOfEventIndicators), 0) then
22202220
<<
2221-
when {(<%fmiInfo.fmiNumberOfEventIndicators |> eventIndicator => "change(fmi_z_positive["+eventIndicator+"])" ;separator=" or "%>) and not initial(),triggerDSSEvent > flowStatesInputs, nextEventTime < time} then
2221+
when {(<%fmiInfo.fmiNumberOfEventIndicators |> eventIndicator => "change(fmi_z_positive["+eventIndicator+"])" ;separator=" or "%>) and not initial(),triggerDSSEvent > flowStatesInputs, pre(nextEventTime) < time} then
22222222
>>
22232223
else
22242224
<<
2225-
when {not initial(), triggerDSSEvent > flowStatesInputs, nextEventTime < time} then
2225+
when {not initial(), triggerDSSEvent > flowStatesInputs, pre(nextEventTime) < time} then
22262226
>>
22272227
%>
22282228
(newStatesAvailable) := fmi2Functions.fmi2EventUpdate(fmi2me, flowStatesInputs);
2229+
nextEventTime := fmi2Functions.fmi2nextEventTime(fmi2me, flowStatesInputs);
22292230
<%if intGt(listLength(fmiInfo.fmiNumberOfContinuousStates), 0) then
22302231
<<
22312232
if newStatesAvailable then

0 commit comments

Comments
 (0)