How to control the CAN transmit Simulink block to send messages on command?

1 回表示 (過去 30 日間)
Jiachen Lu
Jiachen Lu 2021 年 8 月 15 日
コメント済み: Jiachen Lu 2021 年 8 月 17 日
I'm using the CAN transmit block from the Simulink support package for Arduino, and am transmitting messages between two external arduino boards.
How do I specify when to send messages with the CAN transmit block? The only input is for the CAN message frame, and if I don't have a periodically changing signal as in the CAN transmit example, then it continuously transmits the attached message. Please see the attached image illustrating my current block diagram.
Any help would be greatly appreciated.

採用された回答

Jonas
Jonas 2021 年 8 月 16 日
Put the CAN transmit block inside a Triggered subsystem and provide a Boolean with 'true' when you want to send the message.
Alternatively, use a Function call block and use a function call to trigger then sending of the CAN message.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeDevice Driver Blocks についてさらに検索

製品


リリース

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by