Automotive and Embedded Networks

cancel
Showing results for 
Search instead for 
Did you mean: 

Filter CAN extended Id in XNET Bus Monitor

I have set following extended CAN IDs to filter in Bus Monitor: 

Madottati_0-1674633660995.png

On the 'Monitor' tab page I can see the right frames:

Madottati_1-1674633725164.png

The most important thing would be for me to see the frames in the ID-Logger, but the list is empty 😞 Even the logfile is empty, if enabled. 

 

Is there any trick to log filtered IDs? 

 

I use NI-XNET 21.8

 

0 Kudos
Message 1 of 14
(2,098 Views)

On the Monitor Tab, the frame type is E/BRS. I believe that those are error frames. Is the LED of your NI-XNET devices in red?

Usually, the bus error is caused by the physical layer parameters. Make sure you have termination resistors connected or enabled. Specifically for CAN FD, there is another possibility of Incorrect/Unexpected Behaviour or Slow CAN Frames When Using NI-XNET in CAN FD & BRS. NI-XNET uses the sample point of 87.5% at 500k+2M whereas Vector uses 75%. Try sampling point of 75% or 80%.

-------------------------------------------------------
Control Lead | Intelline Inc
0 Kudos
Message 2 of 14
(2,079 Views)

Thanks for the reply!

I am not sure what "E" means, but these are not error frames. The frames will correctly exchanged between XNET and my ECU.

But, I analyzed the frame using NI I/O Trace, the frame type is 0x18, means

CAN FD (0x10)

CAN 2.0 (0x08)

 

How can a CAN frame be FD and 2.0 at the same time? 

0 Kudos
Message 3 of 14
(2,054 Views)

@Madottati wrote:

 

How can a CAN frame be FD and 2.0 at the same time? 


With BRS.  When CANFD was being created they wanted it to be backwards compatible, so non CANFD devices could still operate on the bus like normal.  To accomplish this a CANFD frame can send the ID at the normal CAN 2.0 baud rate, so all devices on the bus can see it and know there is traffic.  Then when the CANFD frame goes to send the payload, it can increase the baud rate to the CANFD rate.  Now CAN 2.0 devices on the bus won't understand what they are seeing, but it doesn't really matter they just need to know there is traffic, and to wait until the bus is idle before trying again.  BRS CANFD messages work this way, but you can also send a CANFD message where the ID and payload are all sent at the CANFD high speed rate.  These network configurations will mean only CANFD capable devices should be on the bus.

Message 4 of 14
(2,041 Views)

I'm not sure this answer is entirely correct @Hooovahh.

I suspect the 'E' means Extended Identifier (29 bit)

 

@Madottati wrote: How can a CAN frame be FD and 2.0 at the same time?

I don't think they can be both at the same time. A CAN-FD frame with no BRS (Bit Rate Switch and no EDL (Extended Data Length) looks the same as a CAN 2.0 message on the bus. But if the BRS bit is true, then it's CAN-FD. Maybe it's a bug or the flag means something different in CAN-FD context?

 

@Hooovahh wrote:  When CANFD was being created they wanted it to be backwards compatible, so non CANFD devices could still operate on the bus like normal. 

If you transmit a CAN-FD message on a bus with CAN 2.0 devices then the CAN 2.0 devices will flag EVERY CAN-FD message as an ERROR. CAN-FD can work on the same PHYSICAL bus wiring as CAN 2.0, but it was never meant to be backward compatible with CAN 2.0 devices.  The only way it could work is if all the non-CAN-FD devices on the bus could detect a CAN-FD frame in the control field after arbitration and ignore the rest of the message, not setting an error flag.  This capability is not in CAN 2.0.  It would have to be added to the protocol, making it something other than 2.0.

 

@Hooovahh wrote:  CANFD frame can send the ID at the normal CAN 2.0 baud rate, so all devices on the bus can see it and know there is traffic.  ... but you can also send a CANFD message where the ID and payload are all sent at the CANFD high speed rate.

Arbitration is ALWAYS at a maximum of 1MBit/s.  This a physical limitation determined by the way CAN arbitration works relating to the maximum bus length and the speed of light (or the speed of an electrical signal through copper conductors). BRS only ever affects the parts of the message after arbitration.

 

Troy - CLD "If a hammer is the only tool you have, everything starts to look like a nail." ~ Maslow/Kaplan - Law of the instrument
0 Kudos
Message 5 of 14
(1,970 Views)

@TroyK wrote:

I'm not sure this answer is entirely correct @Hooovahh.


My confidence level on the specifics of CAN-FD are low so I'm welcome to being wrong.

 


A CAN-FD frame with no BRS (Bit Rate Switch and no EDL (Extended Data Length) looks the same as a CAN 2.0 message on the bus. But if the BRS bit is true, then it's CAN-FD. Maybe it's a bug or the flag means something different in CAN-FD context?


When you do CAN-FD without BRS, you still specify a 2.0 Baud and a FD Baud, which is why I assumed it was at the faster rate all the time.  If you wanted a bus at just 2.0 baud, I assumed you wouldn't even specify CAN-FD.  But I've never seen it on a scope, so you might be right that it is always at the non-FD rate when using CAN-FD without BRS.  In any case I've never actually seen CAN FD non-BRS used in the real world.  Maybe CAN-FD without BRS just allows for the larger payload but at 2.0 rates?

 


If you transmit a CAN-FD message on a bus with CAN 2.0 devices then the CAN 2.0 devices will flag EVERY CAN-FD message as an ERROR. CAN-FD can work on the same PHYSICAL bus wiring as CAN 2.0, but it was never meant to be backward compatible with CAN 2.0 devices.  The only way it could work is if all the non-CAN-FD devices on the bus could detect a CAN-FD frame in the control field after arbitration and ignore the rest of the message, not setting an error flag.  This capability is not in CAN 2.0.  It would have to be added to the protocol, making it something other than 2.0.


Oh yes totally agree here about the error frames.  If a CAN 2.0 device sees this weird CAN-FD traffic that it can't figure out, it will be detected as error frames.  But I don't think it matters.  When the bus is idle, it will still be able to send out the 2.0 frames, and then all devices on the bus will be able to read and understand it.  This is what I mean by being backwards compatible.  I've seen CAN-FD, and CAN 2.0 only devices wired on the bus at the same time.  The CAN 2.0 devices will only be able to understand the 2.0 frames, and the CAN-FD frames will be seen as error frames which are clearly not intended for that device to read.  But this all functions just fine if you ignore the error frames from data not intended for the device.

 


Arbitration is ALWAYS at a maximum of 1MBit/s.  This a physical limitation determined by the way CAN arbitration works relating to the maximum bus length and the speed of light (or the speed of an electrical signal through copper conductors). BRS only ever affects the parts of the message after arbitration.


This again goes back to my assumption that CAN-FD non-BRS is always at the faster FD rate.  It sounds like I'm wrong here and made that assumption since CAN-FD non-BRS needs to specify a FD rate.  I can't understand why you would need to specify a FD rate in non-BRS if it is never used.

0 Kudos
Message 6 of 14
(1,930 Views)

...and does anyone have the answer to my question? 😄

 

I just can't filter on extended identifiers in bus monitor, there could be a hidden trick, like an expression or marking the extended Id, I just can't find it

0 Kudos
Message 7 of 14
(1,713 Views)

Have you set the "CAN:Extended Identifier?" property to True?

https://www.ni.com/docs/en-US/bundle/ni-xnet/page/nixnet/nxpropfrm_canextid.html

 

If there's no way to do that in the "Bus Monitor" you keep referring to, then the filter may need bit 29 set to 1 in the extended CAN ID so that it is recognized as an extended id.

OR the CAN ID with 0x20000000
So 0x1C440046 becomes 0x3C440046

 

Only bits 0 to 28 are used for the actual ID.

I think for NI hardware bit 29 is used internally as a flag for Extended IDs.

(Incidentally, Vector hardware uses bit 31 for this purpose)

Troy - CLD "If a hammer is the only tool you have, everything starts to look like a nail." ~ Maslow/Kaplan - Law of the instrument
0 Kudos
Message 8 of 14
(1,696 Views)

Is there a way to set the "CAN:Extended Identifier?" flag to true?

https://www.ni.com/docs/en-US/bundle/ni-xnet/page/nixnet/nxpropfrm_canextid.html

 

If there's no way to do that in the "Bus Monitor" you keep referring to, then the filter may need bit 29
set to 1 in the extended CAN ID so that it is recognized as an extended id.

 

OR the CAN ID with 0x20000000


So 0x1C440046 becomes 0x3C440046


Only bits 0 to 28 are used for the actual ID.
I think for NI hardware bit 29 is used internally as a flag for Extended IDs.
(Incidentally, Vector hardware uses bit 31 for this purpose)

Troy - CLD "If a hammer is the only tool you have, everything starts to look like a nail." ~ Maslow/Kaplan - Law of the instrument
Message 9 of 14
(1,692 Views)

I can't find a way to set the extended ID flag, I just thought there may be a way, a kind of syntax to tell the bus monitor, that the ID's are extended. Either is this syntax hidden, or it's not possible...

 

This is everything you can set on the bus monitor.

Madottati_0-1679461881689.png

 

0 Kudos
Message 10 of 14
(1,655 Views)