"Invalid data type" error in system composer using server/client ports.

3 visualizaciones (últimos 30 días)
Alex
Alex el 21 de Ag. de 2025
Respondida: Shivangi el 2 de Sept. de 2025
I have repeatedly gotten an "Invalid data type" error in system composer using server client points, and cannot discern any underlying cause. At first I had only encountered this with an enumerated type, but I have also encountered it with a structured type. I have extensively used enums and structures throughout the rest of my model, so I cannot determine what in the service interface is causing this issue, but it seems to not be dependent on the actual data type itself, only that it is custom (not a built-in default type).

Respuestas (1)

Shivangi
Shivangi el 2 de Sept. de 2025
I understand that the issue is that System Composer gives an "Invalid data type" error when trying to use custom enums or structs in service interfaces, even though these types work elsewhere in the model.
The root cause is that System Composer service interfaces require custom data types to be visible and registered in the MATLAB workspace or a Simulink Data Dictionary at the time the model is loaded or compiled. So, the issue is not with the specific data type or the model structure, but with the way System Composer checks and validates custom types for service interfaces.
A possible workaround is to make sure the custom data types (like enums or structs) are loaded into MATLAB before opening or running the System Composer model.
Alternatively, for a more permanent fix, define the custom types inside a Simulink Data Dictionary (.sldd) and attach that dictionary to the model. This makes the types always available to System Composer.
Hope this solves your query!

Categorías

Más información sobre System Composer en Help Center y File Exchange.

Productos


Versión

R2025a

Community Treasure Hunt

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

Start Hunting!

Translated by