Why do I get a data type mismatch error on a Referenced Model, even when all port data types are set explicitly?

10 vues (au cours des 30 derniers jours)
I am working with a referenced model on Simulink 9.0 (Matlab 2017b). I am getting the next error message:
Error using RunSimulation (line 107)
Data type mismatch. Input port 2 of 'Control_Cstar/Model' expects a signal of data type 'double'. However, it is driven by a signal of data
type 'single'.
Error using RunSimulation (line 107)
Data type mismatch. Output port 1 of 'Control_Cstar/From44' is a signal of data type 'single'. However, it is driving a signal of data type
'double'.
I have set all Inport and Outport data types of the referenced model explicitly to "single". Even by setting all signal types manually, the error persists. Simulink keeps assuming that the referenced model expects a "double" as an input, but all Inports are explicitly set to "single".

Réponses (1)

Emmanouil Tzorakoleftherakis
HI Ismael,
By setting all signals manually I assume you mean that you opened the model that is being model-referenced, double-clicked on the inports and outports (or any other appropriate block where the data type is set to AUTO) and set the "Data type" property under the "Signal Attributes" tab. If that is the case, have you tried using a data type conversion block?
If this does not work, it would be helpful if you could provide a small reproduction model

Catégories

En savoir plus sur Event Functions dans Help Center et File Exchange

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by