Automotive and Embedded Networks

cancel
Showing results for 
Search instead for 
Did you mean: 

Sharing of a CAN object/port for reading & writing

In looking through the NI examples for CAN, none of them were reading and writing through one port.
I was interested in finding out if this is possible to do with LabView.
0 Kudos
Message 1 of 2
(3,316 Views)
Hi Canewbe,

you can read and write on the same port. However, as you can't create two CAN Objects with the same ID on the same port, you can't read and write a particular ID just using CAN Objects on the same port. The following combinations will work:
  1. Read using the Network Interface Object, write through CAN Objects

  2. Read using the Network Interface Object, transmit through Network Interfac Objects

  3. Read using the CAN Object, write through Network Interfac Objects
However, reading through CAN Objects seems to be slower than through the Network Interface Object, so you should avoid option #3.

There is actually a (old?) LabVIEW example shipping with NI-CAN, but it doesn't show up in the example finder: Interact.vi
You c
an find it in the 'Frame - Basic.llb' file in the ...\National Instruments\LabVIEW\examples\nican\ folder.
I haven't seen an example like this for text-programming languages though.

-B2k
0 Kudos
Message 2 of 2
(3,316 Views)