How to get CAN_message data type on real time target?

9 vues (au cours des 30 derniers jours)
shawn le 15 Nov 2022
I'm trying to run real time on target(speedgoat) with CAN capabilities with simulink 2018b. I can build the model on the target but when I connect to target with simulink (start simulation) I get an error poppup:
The diagnostic viewer says : Unable to find the appropriate MATLAB data type to save the Simulink internal data of type 'CAN_MESSAGE' for modelName.
External Mode Open Protocol SetParam command failed with status 1.
I have a CAN read block feeding a CAN message to a J1939 transport layer. The transport layer also outputs a CAN message to go to the CAN Write block.
Thanks for any help

Réponses (1)

Stefanie Schwarz
Stefanie Schwarz le 27 Mar 2023
This is a limitation with J1939 CAN models in Simulink Real-Time R2020a and prior.
The issue is that the external mode attempts to set all the block parameters when it connects to ensure that parameter values on the host match those on the target. CAN blocks such as CAN Pack and CAN Unpack blocks have parameters that are custom data types (CAN_Message) and therefore not supported by external mode.
As a workaround, you can set the default parameter behavior to 'Inlined':
Or you avoid External Mode ("Run on Target" button) and use the command-line interface or SLRT Explorer instead:
Note that this limitation no longer exists since the major R2020b update to Simulink Real-Time. You can find more information at this link:


En savoir plus sur Vehicle Network Toolbox dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by