The story of DBC (ii)

Source: Internet
Author: User

The previous article describes the MSB and LSB, which describes more complex: signed and unsigned numbers.

1. Signal Symbols

The can signal has its physical significance, such as temperature, torque, etc., these signals are negative, there are 2 common solutions:

1) Set offset to negative value

If the temperature offset=-40, the temperature minimum-40.

2) can signal type is set to signed

As mentioned in the previous article, the signal definition has signedflag, when Signedflag is the minus sign, the signal is represented by the symbol.

    • Format: Sg_ Name : StartBit Length @ byteorder signedflag (Factor,Offset) [Minimum | Maximum] "Unit" Receiver1,Receiver2

2. signal Transmission

The comparison length is a byte (8 bit) data transfer.

1) Unsigned number

Value range: 0~255 (2^8-1), transfer the original code. For example: 7=00000111.

2) signed number

The highest bit is the sign bit, the value range: -128~127, positive transmission of the original code, negative transmission complement. For example-7, the original code = 10000111, complement (except the sign bit counter, plus 1) = 11111001. The network transmits is the complement.

3. Signal Parsing

Based on the previous article, the Dbcvalue project was updated to compare the values of unsigned data. Reply to "dbc example" to get.

1) Unsigned number

2) signed number

The story of DBC (ii)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.