How can I set block mask parameter from subsystem input

조회 수: 8 (최근 30일)
Filip
Filip 2012년 11월 2일
Hello.
I am new to simulink. I am using simscape hydralic and mechanic blocks to create my library subsystem piston model. I would like to initialize "Piston initial position" of "Hydralic Piston Chamber" from my subsystem input. This input would be connected to other block output, which calculates initial position according to cam geometry.
I am able to create subsystem mask parameter as variable to the block, but I don't know, how to initialize this variable from other block. Constant block can be used as variable source; I miss a block targeting port signal to a variable.
I would like to have my piston model independent of base or model workspace.
I would be glad for any help or advice.
Thanks.

채택된 답변

Kaustubha Govind
Kaustubha Govind 2012년 11월 2일
It is currently not possible to treat dialog parameters such as "Piston initial position" as an input. Please see the blog post How Do I Change a Block Parameter Based on the Output of Another Block? to understand why you cannot do what you want described in the question. Since the initial position is only used once, at the beginning of simulation, do you really need to use another part of the model to compute it? It seems like it should be a static computation (maybe using MATLAB code), rather than a dynamic computation.
  댓글 수: 1
Filip
Filip 2012년 11월 5일
Hello Kaustubha.
Thank you for response. I believe that my model could be implemented in better way. Initial piston position is static value and could be calculated from input data in MATLAB code. Maybe I will try. Anyway I created custom piston chamber derived from "piston_chamber.ssc" with initial position input and volume output to check that chamber does what is indented.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Component-Based Modeling에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by