How the two FMUs are built and used#

The FMU code and CMake projects are generated by sdv_dbc_util. The example contains 2 FMUs:

  • Doors2ExampleFMU.fmu in <outputfolder>/examples/door_demo_example/fmu_Doors2ExampleFMU/fmus

  • Doors4ExampleFMU.fmu in <outputfolder>/examples/door_demo_example/fmu_Doors4ExampleFMU/fmus

Before the project can be used, the following steps need to be done:

  • required configuration files have to be placed into the corresponding resources subfolder.

  • function OpenAPILoad() in model.cpp has to be adapted to the intended setup.

The following describes how an FMU is loaded and used in OpenXilEnv.

  • Open XilEnvGui.exe

  • Generate new INI file

  • Recommended: in upper menu click on RT-Factor Icon to switch from fast to slow: Instead of a high (cycling) number the number should be around 1.

../../../_images/rt-factor.png
  • in XiLEnv Control Panel: Click on ‘Add…’ in ‘Process’

../../../_images/control_panel.png
  • ‘Start process’ window opens, click on ‘start an external process’

  • Select file Doors2ExampleFMU.fmu or Doors4ExampleFMU.fmu.

  • Right-Click somewhere ‘New > Text’ and open ‘Blackboard’

../../../_images/blackboard.png
  • Right-Click and open ‘config’

../../../_images/simulation_adding_variables.png
  • Add all signal variables exposed by the selected FMU (2 doors or 4 doors).

  • in XiLEnv Control Panel: Click on ‘File…’ in ‘Internal Process Control’ and add script file vapi_door2_demo.scr (2-door FMU) or vapi_door4_demo.scr (4-door FMU).

  • in XiLEnv Control Panel: Click on ‘Run’ in ‘Internal Process Control’

../../../_images/simulation_changing_variables.png