J1939 Communication over CAN, J1939 Protocol Stack

13 views (last 30 days)
Dear community
I need some guidance on how to use the J1939 library for the Simulink Real-time toolbox.
I am using the previous version which is 6.7 (R2017b). There is very little documentation or example on it.
What I want to achieve is to send a CAN message on the channel 1 and receive it on channel 2.
Can anyone share a model screenshot on how to send a frame, with the setup of the different blocks.
In my model I have considered the blocks:
  1. J1939 Database where I added the dbc and it is fine
  2. J1939 Controller Application : I just used the General tabm not the Network management tab where I have put Arbitrary Address Capable, not use on the impact though
  3. J1939 Protocol Stack: Not sure what I can put at the input CAN Msg and N?
  4. J1939 Transmit message, I added the frame and it seems ok
  5. J1939 Receive message, I also added the same frame and the block seems ok too
At the moment with the way I configured them, I am seeing any frame sent on the bus.
Many thanks for your support.
  1 Comment
Kenny Nona
Kenny Nona on 28 Jun 2022
Hello,
I use speedgoat with IO612 as CAN card with Matlab R2021a. This card supports J1939 messages, but I cannot find an example to help me with the implementation. I use the following blocks:
  • CAN setup
  • J1939 Network configuration (select dbc file & define config name)
  • J1939 Node configuration (specify node name, node address, etc)
  • J1939 CAN transport layer: What do I connect to the inputs and outputs of this block?
  • J1939 Receive/Transmit: outputs/uses the signals in the selected messages.
Deleting the CAN transport layer block causes an error that I need to include the block. But keeping it in provides an error that I need to connect something to the inputs, but I don't know what.
Thanks in advance,
Kenny

Sign in to comment.

Answers (1)

Dimitri MANKOV
Dimitri MANKOV on 7 Jul 2022
Hi Omar and Kenny,
Speedgoat have just released a series a product examples in the latest Speedgoat I/O Blockset version (v9.4.1), including an example showing how to use J1939 in Simulink Real-Time in R2020b and later.
You can find more information about this example here.
I hope this is helpful!
Dimitri

Products


Release

R2017b

Community Treasure Hunt

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

Start Hunting!