Avoid "unnecessary data type conversion" warnings without switching of the respective diagnostics
2 views (last 30 days)
Show older comments
I have a low pass filter library block using the "Conversion Inherited" block to maintain fixed point scaling. In some cases the fixed point scaling of the incoming signal has no fraction (2^0 scaling) and so should be the output. Here the "Conversion Inherited" naturally has no effect and I get "Unnecessary type conversions" warnings. But even if it wasn't inside a library, that is used in many other places, I would like to keep the conversion block as it should grant me the right data type of the output with respect to the input signal, which IMHO is exactly what the "Conversion Inherited" block is made for. Is there any workaround allowing me to keep the diagnostics as well as the "Conversion Inherited" block without the wrong diagnostics with it?
TIA, Robert
1 Comment
John Harris
on 13 Dec 2017
I have the same question for "Data Type Conversion" blocks set to "Inherit: Inherit via back propagation." This is inside some Simulink library blocks (e.g. the Aerospace Blockset > Flight Parameters > Ideal Airspeed Correction > Mach <= 1.0 block). If my inputs to the Ideal Airspeed Correction block are Doubles, the type conversion is unnecessary and gets flagged. I wish we could at least disable the UnnecessaryDatatypeConvMsg diagnostic for library blocks....
Answers (0)
See Also
Categories
Find more on Configure and View Diagnostics in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!