Simulink: Access bus element properties

조회 수: 2 (최근 30일)
Tom Dollfus
Tom Dollfus 2020년 5월 11일
편집: Mark McBroom 2020년 5월 14일
How to access one bus element properties (minimum and maximum values) in Simulink ? I would like to use these values to saturate a computed signal before assigning the signal.
Thanks
BR

채택된 답변

Mark McBroom
Mark McBroom 2020년 5월 14일
편집: Mark McBroom 2020년 5월 14일
Here is one approach that might work. It requires some knowledge of block masking.
  1. Create a subsystem. Inside the subsystem, place a constant block connected to an output port. Set the value of the constant block to be "K"
  2. Mask the subsystem
  3. Edit the subsystem mask. Add 3 "Edit" parameters. 1 for the bus name, the second for the bus element name. The third should have the name "K" and uncheck the "Visible" box.
  4. On the mask "Initialization", add code that:
  5. Creates an instance of the bus specified in the first parameter
  6. Searches the bus to find the bus element specified by the second parameter
  7. Sets the workspace mask variable "K" created in step 3 to be the min or max value of the bus element

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Subsystems에 대해 자세히 알아보기

제품


릴리스

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by