LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Can't communicate with CAN1

Hi,

I am trying to get a small application that reads/write CAN frames and log them into a file.

I have two identical computer with a NI PCI-CAN/XS2 card within the first, and an IXXAT iPC-I 320/PCI II in the second.

For the first in the configuration the interfaces are named CAN0 and CAN1 and for the second CAN1 and CAN2.

I am able to communicate in both directions from/to interface CAN0 to/from CAN1 CAN2 but nothing works with CAN1 of first computer.

Schematically:

PC1           PC2    

CAN0 <-------> CAN1  OK
      |
        -----> CAN2  OK

CAN1 <-------> CAN1  NOK
      |
        -----> CAN2  NOK

The software configuration seems the same for both interfaces because the software loads exactly the same communication parameters, also both are defined as high-speed.

It is not a cable problem, because 2 cables are successfully used in the test (due to differences of gender).

Strange, when I perform a hardware connection between CAN0(PC1) and CAN2(PC2), the usable interface in software configuration of PC2 is CAN1 ?

I've tried to trace the CAN bus error by enabling Log CAN bus error: it returns ArbID 0 RTR 6 DLC 4 Data 01 00 87 A2 which does not help me much.

In order to eliminate possible software bugs, I've also tested with "Transmit Receive same Port.vi" from NI Example Finder, unsuccessfully.

Any suggestion ??

Thanks a lot for your help.

B. Seutin

0 Kudos
Message 1 of 6
(3,129 Views)

Can you connect the two CAN ports on the first computer to each other, and see if they can exchange data?  If not, upload the code you're using to test that part.  If you're using the older NI-CAN interface, you can verify that you've written your code properly by using the "virtual" interfaces CAN255 and CAN256, which are "connected" to each other such than anything sent on one is received on the other.  If that works, substitute the actual CAN interfaces and see if it still works.

Message 2 of 6
(3,112 Views)

Hello

 

Thanks for your reply.

 

As you suggested it, I used virtual interfaces to test data exchange.

In order to eliminate hypothesis, I used examples provided on NI Example Finder. On virtual interface #1, I ran "CAN Receive.vi" example, while on interface #2 I ran "Transmit Receive same Port.vi", and vice-versa.

I am able to communicate in both directions.

But if I use CAN0 and CAN1, nothing passes...

Do you think about an hardware problem ? Or do I have to use a special cable (the cable I used works for CAN0 between two cards).

 

Best regards,

 

B. Seutin

0 Kudos
Message 3 of 6
(3,094 Views)

mmm it seems I spoke too quickly, things seems to work as expected now. I don't know what I did change since.

I've retested between two cards: it seems also ok except 2 strange things:

- when CAN2 is physically connected on PC2, it seems CAN1 that listens instead (as if CAN1 was connected)

- trames sent from CAN0 and CAN1 on PC1 seems to be repeated from IXXAT card: they are returning respectively on CAN1 and CAN0.

0 Kudos
Message 4 of 6
(3,088 Views)

@Seube wrote:

mmm it seems I spoke too quickly, things seems to work as expected now. I don't know what I did change since.

I've retested between two cards: it seems also ok except 2 strange things:

- when CAN2 is physically connected on PC2, it seems CAN1 that listens instead (as if CAN1 was connected)

- trames sent from CAN0 and CAN1 on PC1 seems to be repeated from IXXAT card: they are returning respectively on CAN1 and CAN0.


Sorry, no idea on these two.  As for the first one, what happens if you connect CAN1 to CAN2 on PC2 (no connetion to PC1)?  I don't know anything about the IXXAT card.  Is there some switch that internally bridges the two ports?

0 Kudos
Message 5 of 6
(3,083 Views)

Nothing serious for the moment. All these last issues are related to IXXAT card, which will not be used in production.

 

Thanks a lot for your support, nathand, especially about virtual interfaces.

0 Kudos
Message 6 of 6
(3,078 Views)