Stateflow code generation error when Device vendor is Texas Instruments C2000
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Guys, there is a simple calculation is stateflow:y=1000*x. x is fixdt(1,16,8) with range [-20,20], y is int16.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/156111/image.png)
when device vendor is ARM, simulation is ok, and the generated code is
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/156112/image.png)
when device vendor is Texas Instruments C2000, the generated code is
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/156113/image.png)
Please be noted that the limitation trim is done before the 8-bit shift, so the output range is [-128,127], which is also validated by simulation.
How can I avoid this kind of code generation error if I must choose Texas as the vendor?
0 Kommentare
Antworten (1)
Siehe auch
Kategorien
Mehr zu Instrument Connection and Communication finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!