LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Mixed message lengths on CAN Bus using USB-8473 Device

I am attempting to use the Frame API functions for LabVIEW
and send both 11-bit and 29-bit headers over a bus that uses both address lengths.  I am currently successfully sending 11-bit
packets but the 29-bit packets are having their addressing truncated to the 11-bit
length when put on the bus.   

As far as I can see I should have to set the standard
comparator to 0xCFFFFFFFF and then send messages.  I am using a NI USB-8473 CAN Device for doing
this.  Is there anything else I need to
change for extended addressing?

0 Kudos
Message 1 of 3
(2,252 Views)

The NCwriteNet.vi (used for writing under the Frame API) states  "In order to specify an extended ID (29-bit), OR in the bit mask 20000000 hex".   What is not clear is where to OR this in.  ORing this with the address will change the address on the CAN Bus even though this is listed under the ArbitrationId description.

0 Kudos
Message 2 of 3
(2,247 Views)

You need to OR your Extended ID with the 0x20000000 before giving it to the NCwriteNet.vi.
This is the way that the underlying CAN driver and hardware know that is it an extended ID you are trying to send.
The ID on the CAN bus will NOT have the ORed ID but only your ID. The driver/hardware filter the 0x20000000 from the ID.

 

This is the same for reading an extended ID on the CAN bus. 

Before using the ArbitrationId, you need to AND the ArbitrationId with 0x1FFFFFFF to filter the extended flag out. 

0 Kudos
Message 3 of 3
(2,239 Views)