필터 지우기
필터 지우기

What kind of data type is a CAN message?

조회 수: 9 (최근 30일)
Anurag Kotha
Anurag Kotha 2015년 8월 21일
답변: Anurag Kotha 2015년 9월 4일
I am trying to run a Stateflow model with VNT blocks, which will transmit CAN messages periodically. I cannot build the model because Stateflow says I need to explicitly define a data type for CAN message.
I tried the following, but to no success. A) can.Message B) CAN_MESSAGE(found this in a simulink CAN example) I am successful if I use Simulink only, as I can set the data type to "Inherit". But I need to use Stateflow for my model.
I am not sure what the exact data type is. Any help is appriciated.
  댓글 수: 1
Walter Roberson
Walter Roberson 2015년 8월 21일
If you need to you could cast it to a byte array I suspect.

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

채택된 답변

Varun Bhaskar
Varun Bhaskar 2015년 8월 25일
Hi,
The CAN message is a MATLAB Object. But it cannot be directly used within Stateflow. You could use the pack/unpack blocks to convert into a double array and back.

추가 답변 (1개)

Anurag Kotha
Anurag Kotha 2015년 9월 4일
Thank you, I plan on using pack/unpack to get around this issue. My other option was to create a bus/structure to store CAN message object.

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by