This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

LAUNCHXL-F28069M: Issue with multiplexing technique for CAN using Simulink

Part Number: LAUNCHXL-F28069M

Hi all,

I'm trying to use the CAN dbc file and multiplexing technique in Simulink but the block doesn't seem to allow me to choose the multiplexor value and pick the appropriate signals accordingly. 

When I select the message, all the related signals are selected and the multipexor value is grayed out:

Has anybody tried using multiplexing with Simulink?

Thanks,

--Kash 

  • Olia,

    I have requested some one from Mathworks to look into this. I expect them to get back to you within 2 - 3 business days.

    Regards,
    Manoj
  • Hi Kash,

    I think this has to do with the CAN Pack block, and not the C28X block.

    Documentation for CAN Pack block (may require login): https://www.mathworks.com/help/ecoder/ref/canpack.html

    Multiplex value

    This option is available only if you have selected the Multiplex type to be Multiplexed. The value you provide here must match the Multiplexor signal value at run time for the block to pack the Multiplexed signal. The Multiplex value must be a positive integer or zero.

    I think it is assigning the multiplexor in line 2 automatically, based on the signal, so suspect there is a mismatch somewhere.

    Beyond pointing out the doc page, I'm out of my technical depth on this one. Please contact MathWorks Technical Support for assistance.

    Cheers,

    -Brian

  • Brian,
    I'm using the CAN Pack block and the multiplexor is not in the second line. the block puts the signal in alphabetical order. I fed the multiplexor signal with a constant block to select the multiplexed signal but didn't see any difference. May need to contact MathWorks support.

    Thanks,
  • Hi Kash,

    I'm not overly familiar with the CAN Pack block, so I cant provide any useful advice (other then pointing to doc links). Definitely contact MathWokrs Tech Support; they may have a handy answer to this question form a previous customer asking about it; and if not, they can go dig into this and provide some feedback.

    Cheers,

    -Brian

  • Brian,

    Thanks for your message.

    I contacted MathWorks Tech Support and it turned out that it's not possible to select only a group of signal associated with a particular multiplexed value, when the dbc file is uploaded, all the signals and messages are populated regardless of the multiplexed values. I was recommended to manually specify the signals within the CAN Pack block, but again the old issue will arise where we cannot use multiple eCAN XMT blocks with the same Mailbox number. But the purpose of multiplexing is to use a single message ID for multiple messages! 

    I tried different approaches but wasn't successful. Please see the error I get during compile:

    This is my simple model:

    These are the settings of the eCAN XMT block:

    And this is the error that I get:

     I even tried to use Mux to combine the messages but I get another error:

    Is there anyway to overcome this issue? (using one eCAN XMT block for multiplexed signals).

    Thanks,

  • Hi Khashayar,

    I haven't tried the below proposal for myself, but I think this is something we can give a try.

    Inside the CAN Tx interrupt subsystem, based on a condition, we can call the memory copy block to update the Message ID of the given mailbox.

    Hopefully the same condition will also take care of which signals are routed to CAN Tx block at that instance.

    That way we can have 1 CAN Tx block pre-configured for a given Mailbox and message ID, but during run time we can write to CAN registers to update the message ID.

  • Venkatesh,
    Thanks for your help.

    That does sound reasonable to me. I'll give it a try but for now, I'm using a simple multi port switch in Simulink that changes the input port every 100 msec using a timer.

    Will update you when I test your solution.

    Thanks,
  • Is this resolved? Can we close this thread?
  • Manoj,
    The problem is not resolved. The MathsWorks doesn't have any solution for this issue yet. We hope to see a fix in the future versions. But thread can be closed.