Dear Ben/Team.
I am urgently in need to Send a RTR CAN message from a MIAC in an project however as you will know / see below that the SetTXData does not allow us to set the RTR bit in the buffer configuration ,when the Buffer is send it is always send as a Standard or Extended message .
Therefore we can not send a STD or XTD CAN RTR message
I suppose in the CAN component properties it can also be done if the parameter is added there however this means that this specific Buffer will always be an RTR Message Buffer,I would think it is better if the parameter is avaialble when populating tit with DATA and we then have the option that the Buffer is a RTR frame buffer or not ,Please help me by adding this to the CAN compoment it is very urgent, I need to run this machine on 20.10.2022.
I appreciate your help
From then Data sheet
External CAN Component Missing Parameter
- p.erasmus
- Posts: 434
- http://meble-kuchenne.info.pl
- Joined: Thu Dec 03, 2020 12:01 pm
- Location: Russia / Россия
- Has thanked: 104 times
- Been thanked: 88 times
- p.erasmus
- Posts: 434
- Joined: Thu Dec 03, 2020 12:01 pm
- Location: Russia / Россия
- Has thanked: 104 times
- Been thanked: 88 times
Re: External CAN Component Missing Parameter
Dear Team,
I tried as a work around to set the RTR bit manually however it seems the TXBnDLC register are not in the definition file.
Thanks again for your help.
I tried as a work around to set the RTR bit manually however it seems the TXBnDLC register are not in the definition file.
Thanks again for your help.
Regards Peter - QME Electronics
-
- Matrix Staff
- Posts: 1384
- Joined: Sat Dec 05, 2020 10:32 am
- Has thanked: 184 times
- Been thanked: 322 times
Re: External CAN Component Missing Parameter
Hi Peter,
It might work if you call the underlying function with a C icon similar to the following:
For the function name, search for "FC_CAN_SPI_CAN_Write" in the C code currently generated by your Flowcode project because the "_1" suffix may be different.
The "0x35" is, I think, the address of the TXB0DLC register. And the "0x4F" sets the RTR bit and sets the data byte count to 8. I assume the data count needs to be 8. You will need to set this back to "0x0F" again to sent 'normal' messages.
I have not tried this myself and it might not work for you, but hopefully it will.
It might work if you call the underlying function with a C icon similar to the following:
Code: Select all
FC_CAN_SPI_CAN_Write_1(0x35, 0x4F);
The "0x35" is, I think, the address of the TXB0DLC register. And the "0x4F" sets the RTR bit and sets the data byte count to 8. I assume the data count needs to be 8. You will need to set this back to "0x0F" again to sent 'normal' messages.
I have not tried this myself and it might not work for you, but hopefully it will.
- p.erasmus
- Posts: 434
- Joined: Thu Dec 03, 2020 12:01 pm
- Location: Russia / Россия
- Has thanked: 104 times
- Been thanked: 88 times
Re: External CAN Component Missing Parameter
Hi Steve,
Thank you for the sugestion ,Please help the byte count should be 1 so it is datalenght 1 and RTR set
Thanks for your help However is it not better when this is allowed to be selected from the Component ?
Thank you for the sugestion ,Please help the byte count should be 1 so it is datalenght 1 and RTR set
Thanks for your help However is it not better when this is allowed to be selected from the Component ?
Regards Peter - QME Electronics
-
- Matrix Staff
- Posts: 1384
- Joined: Sat Dec 05, 2020 10:32 am
- Has thanked: 184 times
- Been thanked: 322 times
Re: External CAN Component Missing Parameter
Hi Peter,
You're correct - it's probably better to have an option for RTR in the component itself. But hopefully my suggestion gives you a workaround until the component has been redeveloped.
You're correct - it's probably better to have an option for RTR in the component itself. But hopefully my suggestion gives you a workaround until the component has been redeveloped.
- p.erasmus
- Posts: 434
- Joined: Thu Dec 03, 2020 12:01 pm
- Location: Russia / Россия
- Has thanked: 104 times
- Been thanked: 88 times
Re: External CAN Component Missing Parameter
Hi Steve,
I understand this Thank you so much.
I could only find the following in my C Code it seems your suggestion is correct with " FC_CAN_SPI_CAN_Write_1" Please just check for with your experienced eyes
Regards
I understand this Thank you so much.
I could only find the following in my C Code it seems your suggestion is correct with " FC_CAN_SPI_CAN_Write_1" Please just check for with your experienced eyes
Regards
Regards Peter - QME Electronics
-
- Matrix Staff
- Posts: 1895
- Joined: Mon Dec 07, 2020 10:06 am
- Has thanked: 491 times
- Been thanked: 664 times
Re: External CAN Component Missing Parameter
Hello,
If you were using internal CAN then I would suggest doing the following to allow you to control the RTR bit, I don't want to do too much immediatley as I don't want to break other users programs and I need to get a better grip on this bit and what it does.
To have the RTR bit clear sent the data count value as normal when calling the SetTXData macro. Range 0-8.
To have the RTR bit set simply send the data count | 0x40 and this will set the RTR bit in the register for you. Range 64-72.
Might also work for the external CAN, I'll see if there's a mask on the data cound size that would cause a problem.
Let us know how you getting on.
edit, looks like my hack should also work for the external CAN mode.
If you were using internal CAN then I would suggest doing the following to allow you to control the RTR bit, I don't want to do too much immediatley as I don't want to break other users programs and I need to get a better grip on this bit and what it does.
To have the RTR bit clear sent the data count value as normal when calling the SetTXData macro. Range 0-8.
To have the RTR bit set simply send the data count | 0x40 and this will set the RTR bit in the register for you. Range 64-72.
Might also work for the external CAN, I'll see if there's a mask on the data cound size that would cause a problem.
Let us know how you getting on.
edit, looks like my hack should also work for the external CAN mode.
Regards Ben Rowland - MatrixTSL
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel
- p.erasmus
- Posts: 434
- Joined: Thu Dec 03, 2020 12:01 pm
- Location: Russia / Россия
- Has thanked: 104 times
- Been thanked: 88 times
Re: External CAN Component Missing Parameter
Hi Ben,
Thank you for your reply ,
I will try tomorrow on the actual machine,
I am surprised that the component does not handle RTR message as it is a part of the CAN standard and is used quite a bit in industry
anycase if this will solf my problem I will be ver happy
Thanks again I will try
Regards
Thank you for your reply ,
I will try tomorrow on the actual machine,
I am surprised that the component does not handle RTR message as it is a part of the CAN standard and is used quite a bit in industry
anycase if this will solf my problem I will be ver happy
Thanks again I will try
Regards
Regards Peter - QME Electronics
- p.erasmus
- Posts: 434
- Joined: Thu Dec 03, 2020 12:01 pm
- Location: Russia / Россия
- Has thanked: 104 times
- Been thanked: 88 times
Re: External CAN Component Missing Parameter
Dear Ben/Steve
Thank you for your help I managed to send a RTR Message
just as an information
However Calling the SPI function did the job
Thank you so much to you guys
Thank you for your help I managed to send a RTR Message
just as an information
This has no effect the bit is always 0 (do not know why )o have the RTR bit clear sent the data count value as normal when calling the SetTXData macro. Range 0-8.
To have the RTR bit set simply send the data count | 0x40 and this will set the RTR bit in the register for you. Range 64-72.
However Calling the SPI function did the job
Code: Select all
FC_CAN_SPI_CAN_Write_1(0x35, 0x4F);
Regards Peter - QME Electronics