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

11 views (last 30 days)
文武 陈
文武 陈 on 29 Aug 2023
Answered: Alan on 11 Sep 2023
在生成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 Comment
Amish
Amish on 11 Sep 2023
由于可用的信息有限,很难预测问题的确切原因。您能否共享模型文件和其他详细信息以重现错误?

Sign in to comment.

Answers (1)

Alan
Alan on 11 Sep 2023
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)

Products


Release

R2020b

Community Treasure Hunt

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

Start Hunting!