Automotive and Embedded Networks

cancel
Showing results for 
Search instead for 
Did you mean: 

NI-CAN Bus Monitor always works but not the LabVIEW examples

Solved!
Go to solution

I have a USB-8473 on a Windows XP PC that I am trying to monitor CAN transmissions from an external device. No matter what settings I select in Measurent & Automation Explorer, the bus monitor never misses a message and is completely error free. Using the example "CAN Receive Error Frames.vi" included with NI-CAN 2.6.2, I get nearly 100% errors for all settings. I am using 125000 baud in MAX and in the VI.

 

Configuration:

USB-8473

NI-CAN 2.6.2

MAX 4.5.1

LabVIEW 8.6

 

Any Suggestions?

Thanks,

Jim

0 Kudos
Message 1 of 12
(12,213 Views)
Hope you closed(stopped) the bus monitor before running "CAN Receive Error Frames.vi".Both will not work simultaneously. Try re-starting the PC if the error repeats.




0 Kudos
Message 2 of 12
(12,211 Views)
Also,Can you be more specific on the error text when trying to open ncOpen.vi if you have any ?




0 Kudos
Message 3 of 12
(12,208 Views)

Yes, the bus monitor is closed when I run the VI.

I do not get any LabView errors. I get a couple of CAN bus error frames having ID 0 with the following 4 data bytes:

01 00 87 A8

01 00 87 AA

 

It appears to me that the NI-CAN VIs are not using the MAX configuration properly, but since I cannot access the CAN Module registers while the example VI is running, I cannot prove this.

 

Thanks,

Jim

0 Kudos
Message 4 of 12
(12,194 Views)

01 00 87 A8

---- Comm State = Error Passive

---- TX Error Counter = 0

---- RX Error Counter = x87

---- ECC Register =  0xA8 == b10101000 ==Stuff Error, RX, CRC Sequence

01 00 87 AA

---- Comm State = Error Passive

---- TX Error Counter = 0

---- RX Error Counter = x87

---- ECC Register =  0xAA == b10101010 ==Stuff Error, RX, Data Field

 

 

I am not sure why you are getting stuff errors... Are you terminated properly?

0 Kudos
Message 5 of 12
(12,183 Views)

We are using a DGE IF-CAN-BC High Speed to Low Speed Adapter which supplies 120 Ohms termination to the USB-8473 CAN controller. The CAN device at the other end has 500 Ohms termination. That was the first thing I thought of, but it is still strange I never get errors when using the NI-CAN bus monitor and I never miss any data. I almost never get through a valid message when using the example LabVIEW VI.

 

Thanks,

Jim

0 Kudos
Message 6 of 12
(12,180 Views)
Note: The frame API does not use MAX configuration. You set the configuraiton in the VIs.  The channel API and the bus monitor do use the MAX configuration.
0 Kudos
Message 7 of 12
(12,168 Views)

For the frame API, I only see a setting for baud. Is there a way to fine tune the CAN timing and sampling parameters with the frame API? I have found none so far. Unfortnately the USB-8473 does not support the channel API.

 

Thanks,

Jim

0 Kudos
Message 8 of 12
(12,163 Views)
Solution
Accepted by msijim
Do you know what your baud rate is? You can use the BTR values to program the SJA1000 with the actual baud rate bit settings. The actual  formula should be in the online help.
Message 9 of 12
(12,159 Views)

I previously tried the 0x8000zzyy formula for baud, but it still did not work.

 

Thanks,

Jim

0 Kudos
Message 10 of 12
(12,155 Views)