FMU Amesim Cosimulation Error

38 次查看(过去 30 天)
Hello, I'm trying to do a cosimulation between Amesim and Simulink with FMU. Everything seems to be set properly, but I received following error:
Error Entry on Diagnostic Viewer:
An error occurred while running the simulation and the simulation was terminated
Caused by:
Error in supplied FMU: An error occurred in function 'fmi2ExitInitializationMode' for block 'test_pneumatic_integrated_Amesim/FMU' during simulation. To view debug logs, open FMU log file. For more information, see the FMU troubleshooting documentation.
FMU log file:
# Debug Logging enabled for block 'test_pneumatic_integrated_Amesim/FMU'
Log from FMU: [category:warning, status:fmi2Warning] Version_8_fmi2Instantiate: the AME environment variable is undefined. Simulation could fail if the model requires datas from the Simcenter Amesim distribution
Log from FMU: [category:model, status:fmi2OK] Instantiating a system with 35 unknowns.
Log from FMU: [category:model, status:fmi2OK] Simcenter Amesim version: 2304 (5517617).
Log from FMU: [category:debug, status:fmi2OK] Version_8_fmi2Instantiate: successfully instantiated. Amesim working directory set to C:/Users/z004tpjx/Documents/Amesim_Cosim/slprj/_fmu/ca1c19d1d23c3ff757ea17644ebd7802/Version_8/resources
Log from FMU: [category:debug, status:fmi2OK] Version_8_fmi2SetReal, run_parameters.maxTimeStep = 1000000000000000000000000000000.000000 (real solver setting 0)
Log from FMU: [category:debug, status:fmi2OK] Version_8_fmi2SetReal, run_parameters.tolerance = 0.000000 (real solver setting 1)
Log from FMU: [category:debug, status:fmi2OK] Version_8_fmi2SetReal, run_parameters.fixedStep = 0.001000 (real solver setting 2)
Log from FMU: [category:debug, status:fmi2OK] Version_8_fmi2SetReal called at t= 0.000000000000000000e+000 s with 3 value(s)
Log from FMU: [category:debug, status:fmi2OK] Version_8_fmi2SetInteger, run_parameters.integratorType = 1 (integer solver setting 0)
Log from FMU: [category:debug, status:fmi2OK] Version_8_fmi2SetInteger, run_parameters.errorType = 1 (integer solver setting 1)
Log from FMU: [category:debug, status:fmi2OK] Version_8_fmi2SetInteger, run_parameters.solverType = 1 (integer solver setting 2)
Log from FMU: [category:debug, status:fmi2OK] Version_8_fmi2SetInteger, run_parameters.integrationMethod = 1 (integer solver setting 3)
Log from FMU: [category:debug, status:fmi2OK] Version_8_fmi2SetInteger, run_parameters.fixedOrder = 1 (integer solver setting 4)
Log from FMU: [category:debug, status:fmi2OK] Version_8_fmi2SetInteger called at t= 0.000000000000000000e+000 s with 5 value(s)
Log from FMU: [category:debug, status:fmi2OK] Version_8_fmi2SetReal, amesim_interface.Stroke = 115.542081 (input variable 0)
Log from FMU: [category:debug, status:fmi2OK] Version_8_fmi2SetReal called at t= 0.000000000000000000e+000 s with 1 value(s)
Log from FMU: [category:model, status:fmi2Warning] ERROR: Cannot load AMELic2304.dll!
Log from FMU: [category:model, status:fmi2Warning] Cannot find AMELic2304 dynamic library ...
Log from FMU: [category:model, status:fmi2Warning] Simcenter Amesim model: initialization failed.
Log from FMU: [category:error, status:fmi2Fatal] Version_8_fmi2ExitInitializationMode failed
I'm quite sure that I have both software properly installed. I do not understand where this error of cannot load AMELic2304.dll comes from. Any help would be much appreciated. Thank you.

采纳的回答

akshatsood
akshatsood 2023-9-12
编辑:akshatsood 2023-9-12
Hi Faryansyah,
I understand that you are attempting a co-simulation between Amesim and Simulink with FMU, but you are facing an error which is visible in the Diagnostic Viewer.
After investigating the attached log file, I identified a potential issue related to the 'AME' environment variable not being identified. Please verify that the 'AME' environment variable exists and is pointing to the Amesim installation folder.
Please refer to the MATLAB answer attached below which outlines the procedure to set the environment variables for different operating systems.
Have a look at the following discussions
If the issue persists, it would be helpful if you could provide me with your FMU file. Having access to the FMU file will allow me to replicate the issue on my end and provide better assistance to resolve the error.
I hope this helps.

更多回答(0 个)

产品


版本

R2020b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by