You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The FMI interface functions are only allowed to b executed in a certain order or FMU state. Currently I get errors when I call them in the wrong order. E.g. when calling fmiSimulate before calling fmiInstantiate!:
julia> using FMI
julia> myFMU =fmiLoad("Modelica.Mechanics.MultiBody.Examples.Elementary.Pendulum.fmu")
julia> fmiSimulate(myFMU, 0.0, 1.0; recordValues=["rev.w"])
ERROR: BoundsError: attempt to access 0-element Vector{fmi2Component} at index [0]
Stacktrace:
[1] getindex(A::Vector{fmi2Component}, i1::Int64)
@ Base ./array.jl:861
[2] fmi2Simulate(fmu::FMU2, t_start::Float64, t_stop::Float64; kwargs::Base.Pairs{Symbol, Vector{String}, Tuple{Symbol}, NamedTuple{(:recordValues,), Tuple{Vector{String}}}})
@ FMI ~/.julia/packages/FMI/K8UGW/src/FMI2.jl:585
[3] #fmiSimulate#57
@ ~/.julia/packages/FMI/K8UGW/src/FMI.jl:249 [inlined]
[4] top-level scope
@ REPL[5]:1
The text was updated successfully, but these errors were encountered:
Basically yes. For this example I would like an error that tells the user to first call fmiInstantiate!.
For the fmi2XXX functions the error of 3.2.3 State Machine of C Calling Sequence should be checked before calling a function. The FMU itself should issue errors as well, maybe that is already enough.
Similar to #64.
The FMI interface functions are only allowed to b executed in a certain order or FMU state. Currently I get errors when I call them in the wrong order. E.g. when calling
fmiSimulate
before callingfmiInstantiate!
:The text was updated successfully, but these errors were encountered: