Automotive and Embedded Networks

cancel
Showing results for 
Search instead for 
Did you mean: 

NI USB CAN 8473 write single frame and log all frame of network with read notification on the same port

Hello,

 

I am trying to code an application which:

- Write sometime (button click) a frame on a CAN network

- Log all frame of CAN NETWORK

My hardware is NI USB 8473 (1 port).

 

1/ After reading NI help about CAN APIs, I think it is not possible to do "log all CAN frame" with Channel API because I need to install a asynchronous callback to read all message, and this functionality is only present in frame API.

Anyone can confirm?

 

2/ No problem let's use Frame API

I have tried "CAN Receive with Notification" example delivered with NI-CAN driver, configured on virtual CAN256.

I start other sample program to generate some frame on virtual CAN257, no problem, everything is working.

So, i have tried to modify "CAN Receive with Notification" to add write function. I have mixed this source with "Transmit Receive same Port" sample (which works fine alone on CAN256).

My program is running, but nothing appens when I click on WRITE button.

I suppose some attribute are not confired, but which one.

Anyone can help? (source of my modified sample is joined to this post).

 

Thanx.

 

PS: please note im a newbie with CAN Smiley Frustrated

0 Kudos
Message 1 of 2
(6,227 Views)

Hi,

 

Thank you for posting your question on National Instruments' Forums.

 

I'm a little puzzled by your question.

 

If I understood well, you just want to receive every frame reaching the port and sometime write something through the port. Am I correct ?

 

You are right when you state that the NI USB 8473 can only work with frame API. However, if the operation you want to make is the one I discribed above, I can't see where you encounter a difficulty.

 

Indeed, for such a case, the example you mentionned in your post is perfectly suited. "Transmit Receive same Port" allows you to receive the frames reaching the port and write we needed too.

 

I think this example shoudl do the trick.

 

Or have you a more specific application in mind ?

 

I hope this information will help you.

 

Best regards,

Guillaume H.
National Instruments France

0 Kudos
Message 2 of 2
(6,188 Views)