Main Content

조건부 실행 서브시스템 개요

조건부 실행 서브시스템은 외부 신호를 사용하여 실행을 제어할 수 있게 하는 비가상 서브시스템입니다. 제어 신호라고 하는 외부 신호는 제어 입력 포트에 연결됩니다. 조건부 서브시스템은 컴포넌트의 실행이 다른 컴포넌트에 종속되는 경우와 같이 복잡한 모델을 만들 때 유용합니다.

Simulink canvas with Conditionally Executed Subsystem block. Subsystem block has control input port at the top and data input port at the left, both connected to Inport blocks. Subsystem block has data output port at the right, connected to an Outport block.

Simulink®는 다음과 같은 유형의 조건부 서브시스템을 지원합니다.

  • Enabled Subsystem — 제어 신호가 양수인 동안 각 시간 스텝에서 실행됩니다. 실행은 제어 신호가 음수에서 양수 방향으로 0을 가로지를 때 각 시간 스텝에서 시작됩니다. Enabled Subsystem 사용하기 항목을 참조하십시오.

  • Triggered Subsystem — 제어 신호가 0으로 상승 또는 하강하거나 0을 가로지를 때 각 시간 스텝에서 실행됩니다. Triggered Subsystem 사용하기 항목을 참조하십시오.

  • Enabled Subsystem 및 Triggered Subsystem — 활성화 제어 신호가 양수 값이고 트리거 제어 신호가 0으로 상승 또는 하강할 때 각 시간 스텝에서 실행됩니다. Enabled Subsystem 및 Triggered Subsystem 사용하기 항목을 참조하십시오.

  • Message Triggered Subsystem — 메시지를 제어 신호로 사용하고, 블록 샘플 시간에 관계없이 제어 포트에서 메시지를 사용할 수 있을 때마다 실행됩니다. Using Message Polling and Message Triggered Subsystems 항목을 참조하십시오.

  • Message Polling Subsystem — 메시지를 제어 신호로 사용하고, 제어 포트에서 메시지를 사용할 수 있을 때 각 시간 스텝에서 실행됩니다. Using Message Polling and Message Triggered Subsystems 항목을 참조하십시오.

  • Function-Call Subsystem — 제어 신호가 함수 호출 이벤트를 수신할 때 실행됩니다. 이벤트는 시간 스텝 중에 한 번 이상 발생할 수 있습니다. Stateflow® 차트, Function-Call Generator 블록, S-Function 블록 또는 Hit Crossing 블록은 함수 호출 이벤트를 제공할 수 있습니다. Function-Call Subsystem 사용하기 항목을 참조하십시오.

조건부 실행 서브시스템 또는 조건부 실행 참조 모델은 다음과 같이 실행됩니다.

  • 제어 블록에 의해 활성화될 때 현재 시간 스텝에서 한 번 실행. 제어 블록은 프로그래밍 언어 명령문(예: if-then-else 또는 switch)으로 표현된 것과 유사하게 제어 논리를 구현합니다.

  • 제어 신호 또는 동작 신호에 의해 트리거되거나 활성화될 때 현재 시간 스텝에서 한 번 실행.

  • 함수 호출 이벤트를 수신할 때 시간 스텝 중에 한 번 이상 실행.

Simulink canvas with If block with 2 output ports, each of which is connected by dotted lines to the action port of a separate If Action subsystem block. Output of each If Action subsystem block is connected to a Merge block, whose output is connected to an Outport block. Inputs of the If block and both If Action Subsystem blocks are connected to Inport blocks.

Simulink canvas showing 2 models. In the first model, there are 2 Enabled Subsystem blocks. An Inport block lableled "Enable Signal" is connected to the control port of one Enabled Subsystem block, and to a Not block whose output is connected to the other Enabled Subsystem block. The outputs of both Enabled Subsystem blocks are connected to a Merge block. In the second model, an Inport block labeled "Function-Call Event" is connected to the control port of a Model block labeled "Enabled_Model".

예제 모델을 보려면 Simulink 서브시스템 의미 체계 항목을 참조하십시오.

참고 항목

| | | |

관련 항목