Error with inport signal names when using a Model block
1 次查看(过去 30 天)
显示 更早的评论
Hello.
I am trying to create en Export Function Model as outlined here (Using Initialize, Reinitialize, Reset, and Terminate Functions - MATLAB & Simulink (mathworks.com)). I have gotten thru it all just liek instructed, but i get an error when i compile the model.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1594256/image.png)
Looking at the Model block subsystem, i can see that the signal is complainig about, do not show up named in the subsystem (See screenshot)![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1594261/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1594261/image.png)
If you open that subsystem (Reference model) and check the inports and signal names, they are named.
I have tried to set the signal names using the set_param(), but i get this error and i do not understand how to get around it. I have also tried to name the line and get the same error.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1594266/image.png)
Any help is appreciated on how i can fix this error.
Thank you.
0 个评论
采纳的回答
Fangjun Jiang
2024-1-18
You have to set the name of the line (line handle), not port (port handle). Outside the Model block, try to set the line name manually to see if it resolves the error.
2 个评论
Fangjun Jiang
2024-1-18
Carefully review if there is any difference in the signal name between manual entry and by script, such as trailing white space or new line. Read it back in script to check the value too.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Event Functions 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!