MATLAB: Do I get an error message about “invalid SIL/PIL communication data is passed between Simulink and the target application”

simulink

I was trying to run a SIL simulation to test code that was generated using Embedded Coder. But I got the following error message:
An error occurred while running the simulation and the simulation was terminated
Caused by:
Unexpected failure when verifying configuration settings.
This failure can occur when invalid SIL/PIL communication data is passed between Simulink and the target application. If the problem persists, contact MathWorks Technical Support.

Best Answer

The error message indicates that there is a mismatch between the data that is sent from Simulink to the target application, or vice versa.
For one particular case, the issue was resolved by changing the 'Code interface' property of the SIL Model block from 'Model Reference' to 'Top Model'. This was recorded as a bug and fixed in R2018a.