Automotive and Embedded Networks

cancel
Showing results for 
Search instead for 
Did you mean: 

CAN Communication

I am very new to Labview, and I am struggling with sending and receiving CAN Messages.  I just got a NI PCI-CAN Card Dual port, and I am pretty sure it is installed correctly, but I think my code is missing something.  I have tried to copy the examples I found online and with the Labview software, but I have not gotten it to work.  If someone knows of a very basic example that exist online I would appreciate it.  Was there something I needed to do in MAX? 
 
Here is some information on my particular application:
I am trying to send a simple CAN message to Arbitration ID 078 Hex, and the data I am trying to send is 8F 00 00 Hex.  And in regards to reading the CAN message, I am trying to set it up so it will continously read.
 
I would appreciate any help, or any information to get me going in the right direction.
0 Kudos
Message 1 of 4
(4,664 Views)
I would recommend playing around with the "Waveform Input.vi" and "Waveform Output.vi" examples.  You can find these in the example finder (Help >> Find Examples...) and browsing to Hardware Input Output >> CAN >> Channel API >> Basic.  You will need to set up the channels in MAX.  The documentation for either example explains how to do this:

This example demonstrates input of waveform plots from multiple CAN channels.  The CAN channel data is sampled into a waveform at the specified Sample Rate.

The default Channel List uses channels from the example.ncd file, located in \Program Files\National Instruments\NI-CAN.  You can load example.ncd into MAX and use the default, or you can change Channel List to your own channels.

If you have a 2-port NI CAN card with CAN0 and CAN1 cabled together, you can execute this example along with the Waveform Output example.

I would also recommend reviewing the NI-CAN Software and Hardware Manual (Start >> Programs >> National Instruments >> NI-CAN) to get started.

Hope this helps!
Robert Mortensen
Software Engineer
National Instruments
0 Kudos
Message 2 of 4
(4,650 Views)

hello

i am new to CAN .i am having a 2-port NI CAN card with CAN0 and CAN1 .I want to run the Waveform Input.vi" and "Waveform Output.vi" examples .

For using this example for writing on CAN & for reading from CAN , is it require to shorted the CAN0 & CAN1 Ports ??

regards

RJ

0 Kudos
Message 3 of 4
(4,492 Views)
Hi RJ,

You can connect both ports on your CAN card using a CAN cable, and then you can write to one port, and read from the other. So for instance, in Waveform input.vi, you would select CAN0, and in Waveform output.vi, you would select CAN1. Look at Robert's post above for some more information. Hope this helps.

Regards,


Message Edited by _Belle on 08-14-2006 03:15 PM

Ebele O.
National Instruments
0 Kudos
Message 4 of 4
(4,461 Views)