Is there a way to have CAN_ID as an input to the CAN send block rather than a fixed value?

cancel
Showing results for 
Search instead for 
Did you mean: 

Is there a way to have CAN_ID as an input to the CAN send block rather than a fixed value?

Jump to solution
294 Views
Poley
Contributor IV

Hi, 

Instead of having a fixed value in the CAN send block

Poley_0-1620635877492.png

Can I somehow have CAN ID as an input alongside data and length?

Poley_1-1620635979002.png

The reason is I want to send messages on a different ID depending on a bitmask value (1-16) and if I could enter the ID instead, otherwise I have to make 16 versions of all my CAN outputs.

Thanks in advance!

 

 

0 Kudos
1 Solution
232 Views
paulvlase
NXP Employee
NXP Employee

Hi @Poley and @Maciek ,

 

I attached a cumulative patch, a self-extracting archive, that contains this improvement and the previous patches from CAN FD in S32k14x EVB .

 

The steps to apply the patch:

1. Download the attached zip file and unzip it.

2. Run mbd_find_s32k_root() to get the root folder there the S32K toolbox is installed.

3. Close Matlab.

4. Open the MBDToolbox_S32K1xx_4.2.0_id_input_patch_3.exe file and extract it's contents to the root folder of the toolbox.

 

To show the ID input you have to check the "Show ID input port" option in the FCAN_Send and FCAN_Receive blocks.

paulvlase_1-1621964258862.png

 

Regards,

Paul

 

View solution in original post

7 Replies
233 Views
paulvlase
NXP Employee
NXP Employee

Hi @Poley and @Maciek ,

 

I attached a cumulative patch, a self-extracting archive, that contains this improvement and the previous patches from CAN FD in S32k14x EVB .

 

The steps to apply the patch:

1. Download the attached zip file and unzip it.

2. Run mbd_find_s32k_root() to get the root folder there the S32K toolbox is installed.

3. Close Matlab.

4. Open the MBDToolbox_S32K1xx_4.2.0_id_input_patch_3.exe file and extract it's contents to the root folder of the toolbox.

 

To show the ID input you have to check the "Show ID input port" option in the FCAN_Send and FCAN_Receive blocks.

paulvlase_1-1621964258862.png

 

Regards,

Paul

 

View solution in original post

144 Views
Poley
Contributor IV

Hi @paulvlase 

I now get this message when using this patch:

Poley_0-1623239366346.png

The fix you sent seems to work perfectly I was just wondering if this new message points to an issue I haven't come across yet?

Thanks!

 

0 Kudos
228 Views
Poley
Contributor IV

This is a huge help, thank you!

0 Kudos
264 Views
Poley
Contributor IV

Hi @mariuslucianand 

Is this possible?

Thanks!

0 Kudos
259 Views
paulvlase
NXP Employee
NXP Employee

Hi @Poley ,

 

No, you can't pass the ID as an input signal. To allow you to do that, we will need to update the toolbox.

 

I can send you a patch tomorrow if you are fine with it, which you will have to apply over the toolbox.

 

Regards,

Paul

0 Kudos
243 Views
Maciek
Contributor V

Hi @paulvlase 

I have been writing about this issue a few months ago. We are also interested in a solution to this problem. Right now our model uses more than 150 unnecessary CAN send blocks (to send messages with various IDs) - it works fine, but the model is clumsy and more than 4000 lines of code is generated from this unnecessary blocks.

Regards

Maciek 

0 Kudos
257 Views
Poley
Contributor IV

Hi @paulvlase 

That would be very helpful, thank you!

Will reduce my code size massively.

Thank you.

0 Kudos