![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1232612/image.png)
Simulink Build Error : Type mismatch in initial value
17 ビュー (過去 30 日間)
古いコメントを表示
I was getting build error as below, when I did not match the Data types.
Invalid output port data type. Data type of 'Output Port 4' of 'Integrated_HAL_BSW_ASW_ver1_05/BSW_ASW_Interface_INPUT/ASW to BSW Interface/Bus Selector1' is invalid.
The below picture shows the problematic area of my model. The output of the Stateflow is linked to the Bus selector.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/803339/image.jpeg)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/803344/image.jpeg)
Then I managed to match the data types, but now I am receiving the below error.
Type mismatch in initial value. Data 'PumpBatWp1Out_RPM' is set to be of type 'uint8' and its initial value '0' evaluated to type 'double'.
If I also have to match the initial value data type, how can I change the initial value data type? Please help me to solve this.
Thank you
0 件のコメント
回答 (1 件)
Stefanie Schwarz
2022 年 12 月 15 日
編集済み: Stefanie Schwarz
2022 年 12 月 15 日
Could you try to specify uint8(0) instead of just "0" as the initial value for 'PumpBatWp1Out_RPM' in the Stateflow Symbols Pane > Property Inspector? Otherwise, it is assumed that the 0 is double.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1232612/image.png)
More information on setting data properties for Stateflow:
More information on specifying Stateflow chart data properties using MATLAB Expressions can be found here:
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Simulink Functions についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!