11.2.5. Simulation Using M-File

Co-simulation by using an M-File can be done in two ways. One way is by using the Motion Host and the other way is using the MATLAB Host. The simulation steps for the Motion Host are explained in the figure and table below.

Figure 11.14: Motion Host run

Motion Host run

Figure 11.15: Steps to open the Run dialog

StepOperation
1st stepSelect the Co-simulator ribbon menu as shown in the figure above.
2nd stepSelect the Run entity as shown in the figure above.

The properties of co-simulation are introduced in the figure and table below.

Figure 11.16: Run dialog

Run dialog

Figure 11.17: Run dialog

ParameterSymbolDescriptionDimension (Range)
1. Use flagN/AThis represents flag whether selected M-File entity use or not.N/A
2. TypeN/AThis represents type of co-simulationN/A
3. NameN/AThis represents the name of M-File entityN/A
4. ProgramN/AThis represents execution programN/A
5. Open file buttonN/AThis button performs the set of the execution program.N/A
6. Simulink fileN/AThis represents Simulink file.N/A

For the MATLAB Host, you can click the simulation button as shown in the figure below.

Figure 11.18: MATLAB Host run

MATLAB Host run

The interface method between two solvers is introduced as shown in the figure below.

Figure 11.19: Work flow of co-simulation though M-File

Work flow of co-simulation though M-File