How to run cyclic Simulink block once

조회 수: 6 (최근 30일)
Connor Kurtz
Connor Kurtz 2021년 6월 30일
답변: Jonas 2021년 6월 30일
I'm working with a simulink block set provided for an embedded platform by its manufacturer. The block set has a CAN transmit block, which has me input the period between messages as a parameter to the block, and then has inputs for DLC, CAN ID, and the actual data of the CAN message. I am wanting to be able to output a CAN message not cyclically, but on demand, such as being dependent on a Stateflow state transition. Does anyone know of a way for me to stop the block from cyclically outputting CAN messages, and only do it once when I request it to?

채택된 답변

Jonas
Jonas 2021년 6월 30일
  1. Put it inside a Function-call Subsystem and use a function-call signal to trigger it
  2. Put it inside a Triggered Subsystem and toggle a Boolean signal to trigger it
  3. Put it inside a Simulink Function block, and use the Function-Call block to trigger it, or directly use the function prototype to call it in Stateflow or an embedded MATLAB function

추가 답변 (0개)

카테고리

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

제품


릴리스

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by