From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Automotive and Embedded Networks

cancel
Showing results for 
Search instead for 
Did you mean: 

Does anyone using CANcaseXL experience?

Solved!
Go to solution

TroyK 已寫:

It is better that you look at the vxlapi.dll documentation and understand what is going on, but I added a CAN receive example to the community document anyway.

 

CAN Receive Example.vi added due to popular demand.

 

 


Hello , TroyK , I can use this vi work normally but I found some word I don't understan like.. "DLC"

 

 

0 Kudos
Message 11 of 19
(3,924 Views)

http://en.wikipedia.org/wiki/CAN_bus

DLC = Data Length Code. Number of bytes of data (0–8 bytes)

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 12 of 19
(3,921 Views)

TroyK 已寫:

http://en.wikipedia.org/wiki/CAN_bus

DLC = Data Length Code. Number of bytes of data (0–8 bytes)


Thank you,, Your answer is really helpfulSmiley LOL

0 Kudos
Message 13 of 19
(3,914 Views)

TroyK 已寫:

http://en.wikipedia.org/wiki/CAN_bus

DLC = Data Length Code. Number of bytes of data (0–8 bytes)


So , I guess the relationship is like as below right?

------

DLC       DATA

0000      0byte

0001      1byte

0010      2bytes

0011      3bytes

0100      4bytes

0101      5bytes

0110      6bytes

0111      7bytes

1000      8bytes

 

------

I have another question, Can "DLC=000" possibly?

0 Kudos
Message 14 of 19
(3,900 Views)

Yes, DLC is 4 bits.

Standard CAN DLC 0-8, value = number of bytes.

b0000  d0  0bytes (Yes, you can have zero bytes for wake-up for example)

b0001  d1  1byte

b0010  d2  2bytes

b0011  d3  3bytes

b0100  d4  4bytes

b0101  d5  5bytes

b0110  d6  6bytes

b0111  d7  7bytes

b1000  d8  8bytes

 

In CAN-FD number of bytes above 8 is encoded:

 

b1001  d9   12bytes

b1010  d10  16bytes

b1011  d11  20bytes

b1100  d12  24bytes

b1101  d13  32bytes

b1110  d14  48bytes

b1111  d15  64bytes

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 15 of 19
(3,894 Views)

TroyK 已寫:

Yes, DLC is 4 bits.

Standard CAN DLC 0-8, value = number of bytes.

b0000  d0  0bytes (Yes, you can have zero bytes for wake-up for example)

b0001  d1  1byte

b0010  d2  2bytes

b0011  d3  3bytes

b0100  d4  4bytes

b0101  d5  5bytes

b0110  d6  6bytes

b0111  d7  7bytes

b1000  d8  8bytes

 

In CAN-FD number of bytes above 8 is encoded:

 

b1001  d9   12bytes

b1010  d10  16bytes

b1011  d11  20bytes

b1100  d12  24bytes

b1101  d13  32bytes

b1110  d14  48bytes

b1111  d15  64bytes


I have this question is from "Data field"

I can not understand why 0..64 ,, Is not 0..63(8byte)?

0 Kudos
Message 16 of 19
(3,889 Views)

DLC is a 4bit field used to specify how many bytes of data are contained in the CAN frame.

4 bits can have a value of 0-15.

For DLC values 0 to 8 the number of bytes is equal to the DLC value.

For DLC values 9 to 15 the number of bytes is determined by the table I listed before.

 

A standard CAN frame can have 0-8 bytes.

A CAN-FD frame can have 0-64 bytes. (BYTES! not BITS)

 

CAN-FD is new, prehaps I shouldn't have mentioned it.  A network will be either CAN-FD or CAN but not both.  You can't mix them on the same bus.

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 17 of 19
(3,885 Views)

TroyK 已寫:

DLC is a 4bit field used to specify how many bytes of data are contained in the CAN frame.

4 bits can have a value of 0-15.

For DLC values 0 to 8 the number of bytes is equal to the DLC value.

For DLC values 9 to 15 the number of bytes is determined by the table I listed before.

 

A standard CAN frame can have 0-8 bytes.

A CAN-FD frame can have 0-64 bytes. (BYTES! not BITS)

 

CAN-FD is new, prehaps I shouldn't have mentioned it.  A network will be either CAN-FD or CAN but not both.  You can't mix them on the same bus.


Thanks your explain,,,I think I just confused the index and length! Cat Very Happy

0 Kudos
Message 18 of 19
(3,876 Views)

Update to my statement for accuracy accounting for emerging technology:


@TroyK wrote:
A network will be either CAN-FD or CAN but not both.  You can't mix them on the same bus.

Actually you can mix CAN and CAN-FD if all the older CAN nodes are put to sleep in a partial networking scheme or the tranceivers they use are specially designed to filter out CAN-FD frames.

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 19 of 19
(3,740 Views)