SPEED CAN-BUS inernal external

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 6.

Moderator: Benj

Barmaley_GMN
Posts: 44
Joined: Mon Aug 04, 2014 12:59 pm
Has thanked: 7 times
Been thanked: 3 times
Contact:

Re: SPEED CAN-BUS inernal external

Postby Barmaley_GMN » Mon Oct 23, 2017 6:46 pm

If I disable macro SetTxData I see
Ext_Can2(1-1-1)-SetData.jpg
Ext_Can2(1-1-1)-SetData.jpg (58.34 KiB) Viewed 829 times

Barmaley_GMN
Posts: 44
Joined: Mon Aug 04, 2014 12:59 pm
Has thanked: 7 times
Been thanked: 3 times
Contact:

Re: SPEED CAN-BUS inernal external

Postby Barmaley_GMN » Mon Oct 23, 2017 7:36 pm

If I add send for 3 buffers;

Code: Select all

#define FCV_0e702_can2__CAN_RTS_TXB3 (135)
after CAN2 init
and

Code: Select all

FC_CAN_SPI_CAN_Command_2(FCV_0e702_can2__CAN_RTS_TXB3);

instead of CAN2 sendBuffer macro
I see
Ext_Can2(1-1-1)3send.jpg
Ext_Can2(1-1-1)3send.jpg (50.83 KiB) Viewed 829 times

Barmaley_GMN
Posts: 44
Joined: Mon Aug 04, 2014 12:59 pm
Has thanked: 7 times
Been thanked: 3 times
Contact:

Re: SPEED CAN-BUS inernal external

Postby Barmaley_GMN » Mon Oct 23, 2017 7:52 pm

And one more strange moment:
If I use 3buffers at the same time variant I see singular sending on internal CAN1 channel with data from the flowchat for CAN2.
And if there is variant for 3 buffers (with my C) I see singular sending on internal CAN1 channel with data from his buffer TX2
But there is no any sending for CAN1 in flowchat! (I attached it a few posts before).
Strange.jpg
Strange.jpg (52.76 KiB) Viewed 829 times

User avatar
LeighM
Matrix Staff
Posts: 1329
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 330 times
Been thanked: 480 times
Contact:

Re: SPEED CAN-BUS inernal external

Postby LeighM » Tue Oct 24, 2017 8:59 am

Hi,
Thanks for all the data, I have not got my head round it yet :?

Meanwhile, I've just had one thought, in that we did do a bug fix on the CAN component about 10 months ago, relating to the message ID.
I've attached the latest, if you want to drop this into your Flowcode 6 installation /components directory, or compare to what you have.
btw. If you want to make a backup of your previous version, move it to another directory somewhere, don't just rename it.
(Flowcode does not use the filename but scans all components for a unique ID)

Leigh
Attachments
CAN.fcpx
(23.42 KiB) Downloaded 18 times

Barmaley_GMN
Posts: 44
Joined: Mon Aug 04, 2014 12:59 pm
Has thanked: 7 times
Been thanked: 3 times
Contact:

Re: SPEED CAN-BUS inernal external

Postby Barmaley_GMN » Tue Oct 24, 2017 8:33 pm

I removed the old CAN.fcpx and placed your to component directory.
Make new hex and... don't see any positive changes:
It steel sends 1 jf 10 frames and 1 from unused component (CAN1)
NewComponent.jpg
NewComponent.jpg (151.61 KiB) Viewed 820 times

Barmaley_GMN
Posts: 44
Joined: Mon Aug 04, 2014 12:59 pm
Has thanked: 7 times
Been thanked: 3 times
Contact:

Re: SPEED CAN-BUS inernal external

Postby Barmaley_GMN » Tue Oct 24, 2017 10:15 pm

There was my mistake about strange sending singular frames from CAN1. I didn't use additional pause for relay (it disconnects CAN1 and CAN2). And time to disconnect was enough for 1 frame.
Sorry.
But losses exists as described.

Barmaley_GMN
Posts: 44
Joined: Mon Aug 04, 2014 12:59 pm
Has thanked: 7 times
Been thanked: 3 times
Contact:

Re: SPEED CAN-BUS inernal external

Postby Barmaley_GMN » Wed Oct 25, 2017 8:27 am

THE FC5 works the same.9 loses from 10.
Can I check if the frame is sent and wait for it?

User avatar
LeighM
Matrix Staff
Posts: 1329
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 330 times
Been thanked: 480 times
Contact:

Re: SPEED CAN-BUS inernal external

Postby LeighM » Wed Oct 25, 2017 8:30 am

Hi,
Could you give a sketch overview of your CAN networks showing what is connected and where?

Barmaley_GMN
Posts: 44
Joined: Mon Aug 04, 2014 12:59 pm
Has thanked: 7 times
Been thanked: 3 times
Contact:

Re: SPEED CAN-BUS inernal external

Postby Barmaley_GMN » Wed Oct 25, 2017 10:12 am

Hi!
Sure!
board.rar
(280.9 KiB) Downloaded 22 times

Barmaley_GMN
Posts: 44
Joined: Mon Aug 04, 2014 12:59 pm
Has thanked: 7 times
Been thanked: 3 times
Contact:

Re: SPEED CAN-BUS inernal external

Postby Barmaley_GMN » Wed Oct 25, 2017 6:39 pm

As I see I can't use ext.CAN and SPI together or I have to run init. for every component before every operation?
p.s. If I use SPI (FCD_06c41_SPI_Master1__SendChar(129);) I see almost 2 times more frames (546 from 3000).
Now I have checked some variants (spi, can2,can1) All of them have the same timing about 0,005 sec. So, I think the main problem - is a trying to send a frame from TX before it get clear (send previous). But why does my main program want so big delays?...
SPI.jpg
SPI.jpg (124.01 KiB) Viewed 781 times

Barmaley_GMN
Posts: 44
Joined: Mon Aug 04, 2014 12:59 pm
Has thanked: 7 times
Been thanked: 3 times
Contact:

Re: SPEED CAN-BUS inernal external

Postby Barmaley_GMN » Wed Oct 25, 2017 9:04 pm

The problem seems to be solved.
I have achieved my main goal. It sends all the frames without external delays with check from your macro. And the program does it with the same timings.
It's a little bit strange, but internal CAN (I suppose) has a check from box but external CAN.
And THANK YOU VERY MUCH! :D
check.jpg
check.jpg (34.46 KiB) Viewed 778 times


P.S. In this case was lived only one buffer (1)
case 0... 0x10...
And of course it's only the main idea. It needs to be remade for exact tasks.
Last edited by Barmaley_GMN on Thu Oct 26, 2017 2:17 pm, edited 1 time in total.

User avatar
LeighM
Matrix Staff
Posts: 1329
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 330 times
Been thanked: 480 times
Contact:

Re: SPEED CAN-BUS inernal external

Postby LeighM » Thu Oct 26, 2017 8:17 am

Thanks for the updates. Glad to hear you have it working.