How can I send multiple CAN messages on xPC Target (without using CAN FIFO)?

2 views (last 30 days)
Hi,
I am trying to send/receive multiple CAN messages and so far I have managed to send/receive only one. I have tried many different ways. First, I have two CAN Pack blocks to create two CAN messages, and by using just one Send block with the corresponding identifiers defined and connected to the two CAN Pack blocks. The SendStatus for the two messages are both okay. However, (as a loopback configuration) when I receive and unpack the messages, only the one with a higher CAN ID is received and the other one is just zero. I am unpacking CAN ID, Timestamp, and so on and all the values are zero with this block (with a lower CAN ID).
Secondly, I also tried using two separate Receive and Send blocks and I also tried with different sampling times individually assigned. This does not work either. I know that there is an option of using FIFO, but I don't actually see the purpose of CAN FIFO when that is not exactly how CAN should work under any circumstances. Shouldn't CAN always take care of priorities. What is the purpose of FIFO then?
Cheers,
Kevin

Answers (2)

Paul
Paul on 6 Dec 2013
I dont fully Understand what you are saying. Could you provide a picture ?

Kevin Kyeong
Kevin Kyeong on 6 Dec 2013
I got an answer from the MathWorks technical support and they said that this is a known bug and it would probably be fixed in the future releases. For now, I have a patch file that temporarily fixes the problem.

Community Treasure Hunt

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

Start Hunting!