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
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 件)

カテゴリ

Help Center および File ExchangeSources についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by