12-12-2009 07:39 PM - edited 12-12-2009 07:43 PM
I got a trouble on CAN communication recently.
I need to commmunicate a Cluster with CAN BUS,the baud rate is 500kBPS,the CAN card is NI PCI-CAN/XS2. The operating system is Windows XP.
normally,the PC send a command to Cluster,then read back a frame of data from the Cluster,but for some commands,the Cluster will return two frames of data,and the programe on PC cannot receive the Seconds frame,it lost.
I searched the forum,most of the reslut is the error about CAN BUS overflow,which make the CAN frame lost,but there is not any error report on my programe,and the baud rate is no that fast,I also use another port of NI PCI- CAN/XS2 to monitor the CAN bus,the second data frame never appear,when I replace NI CAN card with Vector CanCaseXL(CAN card) ,and call CanCaseXL's DLL in labVIEW,it can get the second CAN frame,the monitor of Vector CanCaseXL can get the second data frame too.
so,is there some software/hardware configuration need to be done to get the second data frame?
the attached pictures are NI-CAN/Vector CAN monitor and CAN init/write&read in my programe.
Any reply is appreciate!!! thanks
Solved! Go to Solution.
12-12-2009 07:46 PM
CAN write&read block diagram.
12-14-2009
04:53 PM
- last edited on
01-30-2024
08:19 AM
by
migration-bot
Hello iwantofly014,
I'm sure the frame is not lost.
Could you post your code? Especially the Get Data VI?
Also, can you make an indicator on the output of the ncReadNetMult?
It seems you are trying to implement the UDS or KWP2000 protocol. Is that possible? We have a product that already implements both those protocols and really simplify this kind of application. Its called the Automotive Diagnostic Command Set.
Have a great day.
12-14-2009
09:00 PM
- last edited on
01-30-2024
08:20 AM
by
migration-bot
Thanks O_Proulx !
I Attached my code use NI CAN frame API.
"make an indicator on the output of the ncReadNetMult",is that mean to check the frame number return from ncReadNetMult? I checked it before,the number is about 26 or less,when I filter the other ID,the number of frame return from ncReadNetMult is 0 or 1.
There is nothing about UDS or KWP2000 protocol on Cluster specification,I will contact the manufature of the Cluster to check it out!
It seems there is not evaluation version of Automotive Diagnostic Command Set. Or I can try it in my program,but I think the Automotive Diagnostic Command Set is build on NI CAN frame/channel API,mybe there is some configure I missed,I will keep going!
Thank you!
12-16-2009 02:49 PM
Hello again,
Can you try the modified code I posted?
Thanks,
12-16-2009 08:00 PM - edited 12-16-2009 08:02 PM
Thanks your code.
I try the code you posted, It still no work, I found you has improved the "Get data.vi",It works better,but the second frame still no shown.
I used the NI CAN monitor in MAX to monitor the CAN bus,there is no second frame shown in the monitor,See attach pictures.but It shown in the Vector CAN monitor and the code call the Vector DLL.
Have a great day.
12-16-2009
08:17 PM
- last edited on
01-30-2024
08:21 AM
by
migration-bot
I forgot to mention that the Cluster truely uesd the KWP2000 Protocol, So It is sure the Automotive Diagnostic Command Set may useful, I will try this command set.
by the way,I am wondering can I implement the KWP2000 Protocol just use the NI CAN API? Is it a hard work for me?
or there is something more I need?Such as some NI CAN DLL no open to the user or hard to find.
Thanks!
12-17-2009
08:00 AM
- last edited on
05-23-2024
10:39 AM
by
Content Cleaner
Good news,I have got the second CAN data frame by using Automotive Diagnostic Command Set.
thank your for you help,gook luck!