How do I use the Vehicle Network Toolbox 1.0 (R2009a) in a Simulink model?

1 view (last 30 days)
I have a simulink model in which I want to use CAN messages as inputs.
1. I can send and receive CAN messages. However, the model fails to work correctly when it receives a multiframe message. It only receives the first frame of the
multipart message and not the subsequent messages. I would like to know if there is a way to configure flow control within the model to receive multiframe messages correctly.
2. I want to know at what rate the CAN messages are transmitted and whether they are received periodicly or sporadically. I believe this is not the same as the speed
at which CAN messages data are transmitted. I have set it to 125kbps in my model.
3. I want to know which message is transmitted first when I have two TX CAN messages connected to a Mux block.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 27 Jun 2009
1. Vehicle Network Toolbox (VNT) does not have built-in support for multiframe messages, or transport protocol layering as it is more commonly called. VNT sends/receives individual CAN messages only. If you want to do multiframe messages, you need to built that layer on top of VNT incorporating whatever choice of message structuring, flow control, and timing you desire.
2. The transmit rates of CAN messages from Simulink transmit blocks are controlled by the sample time of the upstream input. Packing blocks and transmit blocks inherit sample time from the data source. This has nothing to do with the configured speed of the CAN bus. It is currently up to the user to control message timing through sample time for periodic transmit. For sporadic or event transmit, you can use something like a triggered or enabled subsystem.
3. If you have multiple transmit blocks in the model, messages will appear on the bus according to the order in which those blocks are executed, which may not always be predictable. It is recommended, though, that if you are sending multiple messages each time step, not use multiple transmit blocks, but instead mux the output of the packing blocks and feed that into a single transmit block. Better performance and throughput is realized this way.
4. When using the Mux block, you can control which messages go out first. The first input to the mux will be transmitted on the bus first, the next second, and
so on.

More Answers (0)

Tags

No tags entered yet.

Products


Release

R2009a

Community Treasure Hunt

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

Start Hunting!