Automotive and Embedded Networks

cancel
Showing results for 
Search instead for 
Did you mean: 

I search an example to transmit message on CAN and to receive a message on the same CAN

Hello,

 

I search a simple example about CAN bus.

I want to send a message on the CAN bus, and receive others messages that I could look into a windows (with the ID, data lenght, etc...)  in the same API.

 

Does anyone could help me please?

 

Thank you.

0 Kudos
Message 1 of 8
(9,425 Views)

Hi

att an example

 

gibson

0 Kudos
Message 2 of 8
(9,418 Views)

Thank you !

 

I have an other question, I have tried to send a message on the CAN bus, I have a PCI 6221 (CAN0 & CAN1), I start the VI, then I choose CAN0, on the baurates etc... and when I click on the xrite button there ise nothing that happen... I don't see the message on the screen...

 

Have you an example to test this VI how send and receive messages ?

 

Thank you

0 Kudos
Message 3 of 8
(9,409 Views)

if you transmit on CAN0 you need to read back the frames on CAN1. 

An easy communication check would be to use the basic examples from the example finder under \hardware Input and Output\CAN\Frame API\Basic\...

CAN Receive.Vi on CAN 0 and CAN Transmit - event based.vi on CAN1 with the same settings (baudrate).

Keep in mind that beyond baudrates of 125kb you need to use a terminated CAN cable.

0 Kudos
Message 4 of 8
(9,407 Views)

Yes but with the example that you put here I though that I can look a message received and a message transmit  on the same screen...

 

I have an other question why should I have send a message on one CAN and look the messages received on an other CAN? Why the communication can't be on one CAN only like if you use a CANCArd XL from vector?

 

 

0 Kudos
Message 5 of 8
(9,404 Views)

In my last response I  showed you the easiest way to do what you asked for.

 

You could read back what  you transmited on the same port by activating the Self Reception property.

 

 Self-reception, when enabled, a successfully transmitted message is received simultaneously. This feature is provided as the
Self Reception attribute of the Frame API and the Interface Self eception property of the Channel API

 

Interface Self Reception specifies whether to echo successfully transmitted CAN frames as received frames. Each reception occurs just as if the frame were received from another CAN device. This enables you to initialize the same channels for both input and output. For self reception to operate properly, another CAN node must receive and acknowledge each transmit.

 

Enabling self-reception will cause the receive portion of the CAN transceiver to be enabled even during write operations. Thus, even frames sent by your NI-CAN interface will be received as incoming frames by your interface. However, there is no special treatment of these frames, they are seen on the CAN bus by the receive portion of the transceiver just as any other frame transmitted on the CAN bus.




 

0 Kudos
Message 6 of 8
(9,402 Views)

Hello I tried to do a test with your example but I have an error (pb of ID), I create a message with the labview example: CAN transmit periodic And I used the Channel Monitor (example of labview) to see the traffic on the CAN Bus with a database).

 

To transmit I put the box like in your message with the same attributes for the API frame, and in the channel editor I put the same box that in your message for the API channel.

 

Have you an simple example  that I could use to solve my problem ?

 

Bye.

0 Kudos
Message 7 of 8
(9,278 Views)

Hi,

 

I am also facing the same problem. the CAN transmit examples given with labview are not working. When i tried to write some value & monitor the CAN bus with Oscilliscope nothing is happening.

 

Sometime i am getting train of pulse even when i have pressed the write button once or sometimes nothing.

 

Kindly help me out or send some example for transmitting over CAN in Labview 7.1. it is urgent.

 

I am using high speed CAN, one port

0 Kudos
Message 8 of 8
(9,045 Views)