Skip to content

Commit 2646b81

Browse files
fix: fix initialization of v2 CS FMUs
1 parent 110e086 commit 2646b81

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

ext/MTKFMIExt.jl

+3
Original file line numberDiff line numberDiff line change
@@ -745,6 +745,9 @@ function (fn::FMI2CSFunctor)(wrapper::FMI2InstanceWrapper, states, inputs, param
745745
states = states isa SubArray ? copy(states) : states
746746
inputs = inputs isa SubArray ? copy(inputs) : inputs
747747
params = params isa SubArray ? copy(params) : params
748+
if wrapper.instance !== nothing
749+
reset_instance!(wrapper)
750+
end
748751
instance = get_instance_CS!(wrapper, states, inputs, params, t)
749752
if isempty(fn.output_value_references)
750753
return eltype(states)[]

0 commit comments

Comments
 (0)