Why does my MATLAB Function Block parameter not get inlined when generating structured text in PLC Coder 1.4 (R2012b)?
1 view (last 30 days)
Show older comments
I have a parameter defined in my MATLAB function block, however it appears with a global constant declaration in the generated PLC code. I would like it to be inlined in the PLC code.
Accepted Answer
MathWorks Support Team
on 19 Sep 2013
The reason that the variable is not being inlined is because it is being declared as a type 'single' using the SINGLE function.
PLC Code generation then needs to declare this variable of the correct precision. If you declare the variable without using the SINGLE function, the value will be inlined in the resulting code.
0 Comments
More Answers (0)
See Also
Categories
Find more on Simulink PLC Coder in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!