I ran into a problem while trying to simulate a model using the fmu file in Simulink:
I am using the Modelon FMI toolbar for the Dymola / Simulink interface to import a fmu file of type Model-Exchange (version 1.0) into a Simulink model. I have a m Matlab file that programmatically simulates a model sequentially, saving the final internal states of the model for initialization in the next simulation. The first iteration of the simulation is error-free, but at the second iteration, Matlab returns the following errors when invoking the simulation:
module = partial_run_sim2 / BasicModels.System_model_final_Sim, log level = ERROR: [] [FMU state: error] fmiInitialize: dsblock_ failed, QiErr = 1
module = partial_run_sim2 / BasicModels.System_model_final_SimBUA: error level: log level = = ] Possible errors (non-exhaustive): 1. License file not found. Use the DYMOLA_RUNTIME_LICENSE environment variable to specify the Dymola license file. 2. The model refers to external data that is not in the target machine, at least not in the same place. The error reported by S-function 'sfun_fmu_me_1_0' in 'partial_run_sim2 / BasicModels.System_model_final_Sim': fmiInitialize returns with an error in initialize_fmu_model_first_time. See Command Window for more information printed by the FMU model.
I know that my Dymola licenses and FMI toolkit have been updated.
Simulation call in m file:
simOut_itr = sim(model, model_cs);
Where "model" is the Simulink.slx model file, and "model_cs" is the Simulink configuration variable. I set up the configuration so that the model loads the initial states from the workspace, and I saved the previous iterations of the final states of this workspace variable. This action also occurs for the first iteration, although the initial states coincide with the initial default states in the fmu file. I suspect that the first iteration runs without problems, since initialization is the same as the default, but the subsequent iteration has a different initialization value that is not consistent with the fmu block.
fmu Matlab fmi, , . , .
fmu Matlab/Simulink . .