Modifying Read Only ID of CAN message
조회 수: 9 (최근 30일)
이전 댓글 표시
I'm using a network of multiple sensors that I want to configure over CAN. Each Sensor has an ID from 0-7.
I currently use a CAN-database to create the Config-message. The default config message identifier is 0x200. The identifier gets changed based on the sensor I want to configure like this:
message-ID = 0x200 + sensorID*0x10
So the config message for sensor 0 has ID 0x200, sensor 1 0x210, sensor 2 0x220 and so on. The same is true for all other messages that can be sent.
The easiest solution for me would be to modify the message-ID from the default message (ID 0x200) like I'm already doing it with the signals:
msgRadarCfg = canMessage(dbc,'RadarCfg');
msgRadarCfg.Signals.RadarCfg_SensorID = sensorID;
Message.ID however is read-only, so this doesn't work:
msgRadarCfg.ID = msgRadarCfg.ID + sensorID*16;
Is there another way to change the message ID without me either modifying the dbc-file to include all messages for all sensor-IDs or building the messages "by hand"?
댓글 수: 0
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Develop Apps Using App Designer에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!