Automotive and Embedded Networks

cancel
Showing results for 
Search instead for 
Did you mean: 

Receive Transmit Same Port

Hi, I realise this question has been asked before but other posters seem to have found different solutions so here goes.

 

I am trying to simultaneously send and receive a CAN message at 500k to a DUT using a 8461 Series 2 card. 

I can transmit a message successfully to turn on a LED on the DUT.

I can also receive the same message from another node and display its value.

 

However if I combine the two vi's into one I cannot transmit and receive the same message using my PXI card. The error out gives a warning code of 1073094665 which means there was no new data available. I have 2 init start tasks configured correctly as far as I can make out.

 

My vi is practically identical to the example vi ( Single Sample Input Output Same Port.vi) which also gives the same error funnily enough.

 

Attached are my VI's.

 

Thanks

Mike 

 

 

0 Kudos
Message 1 of 5
(7,401 Views)

Hi mike....

 

Use Frame APIs to achieve send/receive from the same CAN port. Channel API doesn't allow u to perform both actions on the same port. Configure the CAN port in a seperate VI and run this VI (only once, not continuously) before opening any CAN object on this port. Once you configure the port u can open different CAN objects in different VIs according to ur requirement (send/receive). read help of the two VIs "ncConfigCANNet.vi", "ncConfigCANObj.vi" very carefully. If u can understand these two VIs, you will get the solution. Once you close all the CAN objects you can over write the CAN port configuration, if u do it before closing all CAN objects u will get error with opened CAN objects.

Hope this helps u....still you have problems ?? I'll post the code.

Use Channel API to frame API conversion library  to configure CAN message before sending it to hardware.

 

Cheers....

Ravinder 

Message Edited by Ravi0709 on 09-24-2008 06:43 AM
Message Edited by Ravi0709 on 09-24-2008 06:45 AM
0 Kudos
Message 2 of 5
(7,383 Views)

Hi Ravinder,

 

Thank you for the reply and the link to conversion libraries ( I had not seen these before ).

I understand your suggestion about using the Frame API and it may be the only option if the Channel APIs do not allow this function.

However I'm sure simultaneous Channel Tx and Rx should be possible as there is an example bundled with NI_CAN titled "Single Sample Input Output Same Port.vi" which writes and reads the same channels on the same port using Channel APIs. The only caveat is that seperate Init Start tasks are required which is what I have done. It should work I think.

 

0 Kudos
Message 3 of 5
(7,377 Views)

HI mike...

 

Using channel APIs one should pre-specify the direction of the CAN message (send/receive). Because of this pre-specification you can perform only one action either send or receive. Observe the second point. If it is possible to send /receive on the same port using channel API, thats very good.

 

Ravinder 

0 Kudos
Message 4 of 5
(7,374 Views)

Figured it out. Self reception has to be enabled using the Set Property VI.

0 Kudos
Message 5 of 5
(7,349 Views)