Why do I get a data type mismatch error when using a Counter Limited block in Simulink 6.0 (R14) and later versions?
1 回表示 (過去 30 日間)
古いコメントを表示
I am trying to use a Counter Limited block to feed data to the input of another block that expects a signal of type double. When I do this, I receive the following error:
Data type mismatch. Input port 1 of '<Model_Name>/Counter Limited/Output' expects a signal of data type 'double'. However, it is driven by a signal of data type 'uint8'
採用された回答
MathWorks Support Team
2009 年 6 月 27 日
The Counter Limited block is only set up to output a data type that is some form of an integer; therefore, any block requesting a different type will cause an error. This error occurs in the Counter Limited block itself due to back propagation of the data type.
The solution is to add a Data Type Conversion block between the counter and the block it is supplying the input to. Set this conversion block to output a data type that is compatible with the block you are supplying the input. You do not need to unlink and change the Counter Limited block.
0 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Sources についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!