在SimulinkM​odel生成C代码时​变量尺寸不匹配问题

7 次查看(过去 30 天)
文武 陈
文武 陈 2023-8-29
回答: Alan 2023-9-11
在生成C代码显示错误:
The signal dimensions of the data input ports of Multiport Switch block 'Cosmartor/SemiactiveControlSoftware/Controller/SemiActiveModule/ParameterScheduling/Multiport Switch20' are different. To support a variable-size output signal, on the "Signal Attributes" pane of the block dialog, select the parameter "Allow different data input sizes (Results in variable-size output signal)".
Component:Simulink | Category:Block diagram error
于是我Allow different data input sizes
显示:
Simulink cannot propagate the variable-size mode from the 'Output Port 1' of 'Cosmartor/SemiactiveControlSoftware/Controller/SemiActiveModule/VerticalModule/VerticalDampingFL/scheduling_ratio' to the 'Input Port 3' of 'Cosmartor/SemiactiveControlSoftware/Controller/SemiActiveModule/VerticalModule/VerticalDampingFL/Lookup Table Dynamic'. This input port expects a fixed-size mode. The variable-size mode originates from 'Cosmartor/SemiactiveControlSoftware/Controller/SemiActiveModule/ParameterScheduling/Multiport Switch20'. Examine the configurations of 'Cosmartor/SemiactiveControlSoftware/Controller/SemiActiveModule/VerticalModule/VerticalDampingFL/Lookup Table Dynamic' for one of the following scenarios: 1) the block does not support variable-size signals; 2) the block supports variable-size signals but needs to be configured for them.
不会了,求解
  1 个评论
Amish
Amish 2023-9-11
由于可用的信息有限,很难预测问题的确切原因。您能否共享模型文件和其他详细信息以重现错误?

请先登录,再进行评论。

回答(1 个)

Alan
Alan 2023-9-11
Hi,
I have used a translator to understand your question because I do not understand Chinese. I shall try my best to answer in English. Feel free to use a translator to translate it to Chinese.
I understand that you are facing an issue while variable-sized inputs are fed to a block in your model.
It seems like the variable-sized input mode has propagated through the model to a block which may not be capable for variable sized inputs, or it is capable but not yet configured for variable sized inputs. I would suggest you to check whether the block causing the error ( Cosmartor/SemiactiveControlSoftware/Controller/SemiActiveModule/VerticalModule/VerticalDampingFL/Lookup Table Dynamic) is capable of taking a variable-sized input. This documentation could help you for that: https://www.mathworks.com/help/simulink/ug/variable-size-signal-basics.html#bsf5sez
If it is compatible, enable variable-sized inputs in that block just like you have enabled in the previous block ( Cosmartor/SemiactiveControlSoftware/Controller/SemiActiveModule/ParameterScheduling/From1)

产品


版本

R2020b

Community Treasure Hunt

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

Start Hunting!