String Bus Element doesn't work
Mostrar comentarios más antiguos
I created a struct and a bus from the struct. I can create it correctly but it is not usable in a Constant block
% Create Model Struct
car.id = 1;
car.type = "long";
% Create Estimation Data Bus for Simulink Model
car_bus_info = Simulink.Bus.createObject(car);
car_bus = evalin('base', car_bus_info.busName);
The bus is correctly created in Type Editor

Constant value is car

and the type is Bus: car_bus

But I got this error:
Error:Invalid setting in 'DTFoilWinding/Constant10' for parameter 'Value'.
This only happens with string Bus elements. If I don't use car.type, is works
Respuestas (1)
Walter Roberson
el 13 de Ag. de 2023
0 votos
You need a String Constant block; https://www.mathworks.com/help/simulink/slref/stringconstant.html as regular Constant Block does not support strings.
1 comentario
Furkan
el 14 de Ag. de 2023
Categorías
Más información sobre String en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!