simulink中from与goto模块的使用
轉載:http://blog.sina.com.cn/s/blog_62fb88190100xe5o.html
首先,介紹goto/from的用法:
1、在一個subsystem中放置一個goto,goto與一個經過運算后的輸入信號連接;對goto中的tag命名,在tag visibility選擇local/scope/global類型。
2、在另外一個subsystem或與goto同一個subsystem中放置from,在from中的goto tag處輸入goto相同的名稱,點擊update tags。
經過上面2步就設置完成了該goto/from的組合使用。
不過,在開始使用goto/from搭建模型時,常常會遇到一個問題:
1、Goto/From connections cannot cross nonvirtual subsystem boundaries. The only exception is when a goto is connected to a state output port.
2、Invalid connection starts with ‘untitled/CodeReuseSubsystem/Goto’.
3、Invalid connection ends with ‘untitled/Atomic Subsystem/From’.
matlab/simulink中goto/from模塊的使用方法
仿真時同時出現的上面這3個提示信息,仿真失敗。仔細研究后就會發現:
goto和from在同一個subsystem中,無論goto設置為local還是global,都能正常進行仿真;在不同subsystem中,goto設置為global是就會報上述錯誤。
再深入研究提示的第一條信息后發現,該subsystem是nonvirtual,而goto不能穿過nonvirtual的subsystem,因此應該將該subsystem改為virtual。
選中該subsystem,在鼠標右鍵,在彈出的下拉菜單中選擇“explorer”,在彈出的對話框中選中該subsystem,是否看到勾選了“treat as atomic unit”,這就是問題的根源所在了。
matlab/simulink中goto/from模塊的使用方法
取消勾選該選項,再進行仿真,問題解決。
總結
以上是生活随笔為你收集整理的simulink中from与goto模块的使用的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: simulink自定义信号源方法matl
- 下一篇: 如何在word写小论文在正文分栏后第一页