Why do I get a data type mismatch error when using a Counter Limited block in Simulink 6.0 (R14) and later versions?

1 view (last 30 days)
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'

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 27 Jun 2009
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.

More Answers (0)

Products

Community Treasure Hunt

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

Start Hunting!