[go: up one dir, main page]

CN115174307B - Communication method supporting CAN bus to transmit data with more than 8 bytes - Google Patents

Communication method supporting CAN bus to transmit data with more than 8 bytes Download PDF

Info

Publication number
CN115174307B
CN115174307B CN202210803933.9A CN202210803933A CN115174307B CN 115174307 B CN115174307 B CN 115174307B CN 202210803933 A CN202210803933 A CN 202210803933A CN 115174307 B CN115174307 B CN 115174307B
Authority
CN
China
Prior art keywords
frame
length
data
index
payload
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202210803933.9A
Other languages
Chinese (zh)
Other versions
CN115174307A (en
Inventor
叶继超
高晓川
顾仓
姜波
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Anhui Xiaojun Intelligent Equipment Co ltd
Original Assignee
Anhui Xiaojun Intelligent Equipment Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Anhui Xiaojun Intelligent Equipment Co ltd filed Critical Anhui Xiaojun Intelligent Equipment Co ltd
Priority to CN202210803933.9A priority Critical patent/CN115174307B/en
Publication of CN115174307A publication Critical patent/CN115174307A/en
Application granted granted Critical
Publication of CN115174307B publication Critical patent/CN115174307B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/40Bus networks
    • H04L12/4013Management of data rate on the bus
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/40Bus networks
    • H04L2012/40208Bus networks characterized by the use of a particular bus standard
    • H04L2012/40215Controller Area Network CAN

Landscapes

  • Engineering & Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Small-Scale Networks (AREA)

Abstract

The invention discloses a communication method supporting CAN bus to transmit more than 8 bytes of data, and relates to the technical field of data transmission. The invention comprises a data sending method and a data receiving method; receiving a frame of data, and judging whether the receiving device_id is equal to the node device_id; judging whether the result of subtracting frame_index from payload_length by 8 is greater than or equal to 8; if yes, the data frame is put into an 8-byte length memory from the frame_index of recv_buf multiplied by 8; if not, the data frame is put into a (payload_length minus frame_index multiplied by 8) length memory from the recv_buf frame_index multiplied by 8; the content of the data segment is stored in the recv_buf memory, and the receiving is finished. According to the invention, the data to be transmitted is intercepted through the CAN protocol, the integer frame and the remainder frame generated after interception are judged, each section of identification of the data frame is multiplied by eight, and then the data frame is put into the payload_length minus frame_index multiplied by 8 memory from the frame_index multiplied by 8 of recv_buf, so that the data transmission efficiency is improved.

Description

Communication method supporting CAN bus to transmit data with more than 8 bytes
Technical Field
The invention belongs to the technical field of data transmission, and particularly relates to a communication method supporting CAN bus to transmit more than 8 bytes of data.
Background
With the development of microcomputer control technology and industrial field bus technology, communication modes based on field buses are increasingly widely applied in industrial control. The CAN bus is favored by a plurality of developers due to the characteristics of simple structure, low cost, good functional characteristics, extremely high reliability, strong field anti-interference capability and openness.
The CAN serial bus has the advantages of long transmission distance and high transmission speed, has a perfect error detection mechanism, and CAN ensure that information is not lost by adopting a frame transmission mode of a multiple access conflict arbitration mechanism; a maximum of 8 bytes of data can be transmitted per frame, providing high real-time performance, etc. The advantage of performance ensures that the CAN CAN be applied to a plurality of fields, and CAN be applied to the automobile industry, ship transportation, mechanical control, factory automation, building automation and the like.
The CAN fieldbus system is composed of a physical layer, a data link layer and an application layer 3 layer. The basic protocol specification of CAN only has physical layer protocol and data link layer protocol, and one of the core tasks of the system using CAN bus as transmission mechanism is to design CAN bus application layer protocol CAN2.0a standard CAN protocol and CAN2.0b extended CAN communication protocol to support to transmit 8 bytes of data at most each time, when one node transmits a frame of data segment exceeding 8 bytes to another node, it is unable to satisfy the requirement of transmitting data segment of the length at one time by using CAN2.0a or CAN2.0b communication protocol. The current embedded system is often single in function, simple in structure and limited in resources, but requires high transmission speed, high reliability and high efficiency, so that a novel application layer protocol with a simple structure is required.
A communication protocol currently completed by university of Zhejiang Wu Chaohui et al, which is applied to a large number of data connection-based CAN buses, implements a connection-based application layer protocol for message transmission of data greater than 8 bytes. This protocol, although implementing packetized transmissions of data greater than 8 bytes, lacks a response mechanism for transmission and therefore cannot handle transmission errors. In particular, the protocol can only realize the maximum data transmission of 256 x 7 bytes, has no mass data transmission mechanism, and can not guarantee the accuracy of data transmission. Meanwhile, the protocol is based on connection, and connection needs to be established first for each transmission, so that the transmission efficiency is low.
The name of the specialty used in the present document notes:
1. CAN data buffer: a data field interval in the CAN data frame.
2. Data segment: and a piece of data with the size ranging from 1 to 2, namely the payload_length to the power of unit bytes, cannot be transmitted through the CAN bus at one time when the size is more than 8 bytes.
3. Data frame: one frame of data, the size range is 0-8, and the unit bytes CAN be transmitted through the CAN bus at one time.
4. Payload_length: data segment length, unit bytes.
5. Integer frame: starting from the start position in the data segment, a segment is cut every 8 bytes in size, and the segment of data is called an integer frame.
6. Remainder frame: and a section of data with the size smaller than or equal to 8 is intercepted from the data section, and the length is equal to the remainder of dividing the payload_length by 8.
7. Frame_count: number of integer frames.
8. Domain_frame_length: the length of the remainder frame is equal to the remainder of the payload_length divided by 8.
9. Frame_index: after the data segment is intercepted, the identification of each segment is uniquely expressed relative to other segments.
10. Extension frame id: the identifier field in the can2.0b communication protocol.
11. Standard frame id: the identifier field in the can2.0a communication protocol.
12. Data frame id: the id of the CAN data frame is equal to the standard frame id when the CAN2.0a protocol is used and is equal to the extended frame id when the CAN2.0b protocol is used.
13. Device_id: the device id, unlike the extended frame id/standard frame id, is part of the extended frame id/standard frame id.
14. Extend _id_head: and (3) performing bit-wise or operation on the result obtained by shifting the device_id left by 25 bits, the result obtained by shifting the payload_length left by 11 bits and the frame_index.
15. Extend _id: synonymous with extended frame id, equal to extend _id_head, frame_index per bit or result.
16. Recv_buf: and the memory buffer of the received data segment is used for storing the content of the received data segment, and the length of the memory buffer is more than or equal to that of the data segment.
17. Id_length: this value is 11 when the can2.0a communication protocol is selected and 29 when the can2.0b communication protocol is selected.
Disclosure of Invention
The invention aims to provide a communication method for supporting the transmission of data with more than 8 bytes by a CAN bus, which solves the problem that the transmission efficiency is low because the traditional CAN bus cannot upload data with more than 8 bytes by transmitting data segments with more than 8 bytes between two nodes of the CAN bus and not using a CAN data buffer zone.
In order to solve the technical problems, the invention is realized by the following technical scheme:
The invention relates to a communication method supporting CAN bus to transmit more than 8 bytes of data, which comprises a data transmitting method and a data receiving method;
the data sending method comprises the following steps:
step S1: calculating a frame_count, a main_frame_length, and initializing the frame_index to 0;
Step S2: judging whether the frame_index is smaller than the frame_count;
step S3: if frame_index is less than frame_count, then extend _id_head is obtained, extend _id= extend _id_head bit by bit or frame_index is calculated;
if frame_index is greater than or equal to frame_count, then step S6 is performed;
Step S4: acquiring an 8-byte data frame starting from frame_index x 8 bytes as a data frame to be transmitted;
Step S5: the current node sends the data frame to the CAN bus, then adds up the frame_index to 1, and returns to the step S2;
step S6: the extend _ id _ head is obtained, calculation of extend _id = extend _id/u head bitwise or frame_index;
Step S7: acquiring data with a length of domain_frame_length from a frame_index of 8 bytes of a data segment as a data frame to be transmitted;
step S8: the current node sends the data frame to the CAN bus, and the content of the sent data segment is finished;
the data receiving method comprises the following steps:
step F1: receiving a frame of data, and calculating device_id, payload_length and frame_index values;
step F2: judging whether the receiving device_id is equal to the node device_id;
if the two types are equal, executing the step F3;
If not, discarding the data frame, and continuing to execute the step F1;
step F3: judging whether the result of subtracting frame_index from payload_length by 8 is greater than or equal to 8;
If yes, executing the step F4;
If not, executing the step F5;
step F4: putting the data frame into an 8-byte length memory from the frame_index of recv_buf multiplied by 8;
Step F5: placing the data frame into a (payload_length minus frame_index multiplied by 8) length memory from recv_buf frame_index multiplied by 8;
step F6: the content of the data segment is stored in the recv_buf memory, and the receiving is finished.
As a preferred technical solution, in the step F1, the payload_length represents a length of a data segment, an integer frame and a remainder frame are generated after the data segment is intercepted, the length of the integer frame is 8 bytes, the number of the integer frame is defined as frame_count, the length of the remainder segment is defined as domain_frame_length, and the number of the remainder frame is 1, and the calculation formula between the frame_ count, payload _length and the domain_frame_length is as follows:
frame_count=payload_length/8
remain_frame_length=payload_length%8。
As a preferable technical solution, the device_id, payload_length, and frame_index are fields of a data frame ID, and the sizes are sequentially defined as m bits, n bits, and k bits;
Wherein m, n and k satisfy the following relationship:
As a preferable technical scheme, the values of m, n and k are all user-defined; after m is well defined, on the premise that n and k are removed, the following conditions are satisfied:
as a preferred technical solution, the CAN bus uses a CAN communication protocol for transmission; the CAN communication protocol includes CAD2.0A communication protocol and CAD2.0B communication protocol.
As a preferred technical solution, CAD2.0A communication protocols support 11-bit extended frame ids; 11 is an extended frame ID, bit 10-bit 9 is used for identifying a device ID, and is defined as a device_id, the size is 2 bits, the value range is 0-3, and 4 devices are supported to be communicated at most; bit 8-bit 3 are used for storing payload_length, the size is 6 bits, the value range is 0-63, and the maximum supporting transmission data segment size is 64 bytes; bit 2-bit 0 are used for storing frame_index, the size is 3 bits, the value range is 0-7, and the maximum transmission of 8 segments of data frames is supported.
As a preferred technical solution, CAD2.0B communication protocol supports 29-bit extended frame id; in the 29-bit expansion frame ID, bits 28 to 25 are used for identifying the device ID, are defined as device_id, have a size of 4 bits, have a value range of 0 to 15, and support 16 devices to communicate at most; bit 24-bit 11 are used for storing payload_length, the size is 14 bits, the value range is 0-16383, and the size of a transmission data segment is 16384 bytes at most; bit 10-bit 0 are used for storing frame_index, the size is 11 bits, the value range is 0-2047, and 2048 segments of data frames are maximally supported to be transmitted.
The invention has the following beneficial effects:
According to the invention, the data to be transmitted is intercepted through the CAN protocol, the integer frame and the remainder frame generated after interception are judged, each section of identification of the data frame is multiplied by eight, and then the data frame is put into a (payload_length minus frame_index multiplied by 8) length memory from the frame_index multiplied by 8 of recv_buf, so that the data transmission efficiency is improved.
Of course, it is not necessary for any one product to practice the invention to achieve all of the advantages set forth above at the same time.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings that are needed for the description of the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of data transmission according to the present invention;
fig. 2 is a flow chart of the data receiving method of the present invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
The method CAN support the CAN bus to transmit data segments with more than 8 bytes between two nodes, does not use a CAN data buffer area, and improves the transmission efficiency.
When in communication, the length of a data segment is defined as payload_length, the data segment is intercepted, an integer frame and a remainder frame are generated after interception, the length of the integer frame is 8 bytes, the number of the integer frame is defined as frame_count, the length of the remainder segment is defined as domain_frame_length, and the number of the remainder frame is 1. The variables are defined and calculated as follows,
frame_count=payload_length/8
remain_frame_length=payload_length%8
The data frame ID is decomposed as shown in table 1 below:
device_id payload_length frame_index
device_id: the region stores a device_id value, the size of which is defined as m bits.
Payload_length: the region stores a payload_length value, the size of which is defined as n bits.
Frame_index: the region stores the frame_index value, the size of which is defined as k bits.
Wherein m, n, k satisfy the following relationship,
Wherein the values of m, k and n are set by user definition, but generally, on the premise of ensuring that n and k are rounded after m is well determined,
The invention mainly solves the problems that the traditional CAN protocol of the CAN2.0A standard and the CAN2.0B extended CAN communication protocol support to transmit 8 bytes of data at most each time, and when one node transmits a frame of data segment with the size exceeding 8 bytes to the other node, the data segment with the length cannot be transmitted at one time no matter the CAN2.0A or the CAN2.0B communication protocol is used.
Example one (CAN2.0A protocol transmission is taken as an example)
Can2.0a supports an 11-bit extended frame ID, so id_length=11, assuming m=2, n= 6,k =3, defined as follows,
① Bits 10 to 9 are used for identifying the device ID, and are defined as device_id, the size is 2 bits, the value range is 0-3, and at most 4 devices are supported for communication.
② Bits 8 to 3 are used for storing payload_length, the size is 6 bits, the value range is 0 to 63, and the maximum supporting transmission data segment size is 64 bytes.
③ Bit 2-bit 0 are used for storing frame_index, the size is 3 bits, the value range is 0-7, and the maximum transmission of 8 segments of data frames is supported.
Assuming that the data length to be transmitted is 64 bytes, bit10 to bit9 are other node device ids to be transmitted by the user, and are defined by the user, bit8 to bit3 are 0x3F, and bit2 to bit0 are 0x7.
As shown in fig. 1, the transmission flow is as follows:
Step ①: frame_count, remain_frame_length, is calculated and frame_index is initialized to 0.
Step ②: is it determined that frame_index is less than frame_count?
Step ③: if frame_index is less than frame_count, extend _id_head is obtained and extend _id is calculated. If frame_index is greater than or equal to frame_count, then step ⑥ is performed.
Step ④: the frame_index data frame is obtained as a data frame to be transmitted, and the data frame length is 8 bytes.
Step ⑤: the current node sends the data frame onto the CAN bus and then accumulates frame_index by 1.
Step ⑥: and obtaining extend _id_head and calculating extend _id.
Step ⑦: acquiring a frame_index data frame as a data frame to be transmitted, wherein the frame_index data frame has a length of main_frame_length
Step ⑧: and the current node sends the data frame to the CAN bus, and the content of the sent data segment is finished.
As shown in fig. 2, the receiving flow is as follows:
step ①: one frame of data is received, and device_id, payload_length, frame_index values are calculated.
Step ②: is it determined whether the received device_id is equal to the node device_id? If equal, go to step ③, if not, discard the data frame, then go to step ①
Step ③: if the result of subtracting frame_index from payload_length is greater than or equal to 8, then step ④ is performed, otherwise step ⑤ is performed.
Step ④: this data frame is placed in 8 byte length memory starting at recv_buf frame_index by 8.
Step ⑤: this data frame is placed in the (payload_length minus frame_index by 8) length memory starting from recv_buf frame_index by 8.
Step ⑥: the content of the data segment is stored in the recv_buf memory, and the receiving is finished.
Example two (CAN2.0B protocol transmission is taken as an example)
Can2.0b supports a 29-bit extended frame ID, so id_length=29, assuming that m=4, n=14, k=11 is taken, it is defined as follows,
① Bits 28 to 25 are used for identifying device IDs, defined as device_id, with the size of 4 bits and the value range of 0 to 15, and support 16 devices to communicate at most.
② Bits 24-11 are used for storing payload_length, the size is 14 bits, the value range is 0-16383, and the maximum supporting transmission data segment size is 16384 bytes.
③ Bits 10 to 0 of San are used for storing frame_index, the size is 11 bits, the value range is 0 to 2047, and 2048 segments of data frames are maximally supported to be transmitted.
Assuming that the data length to be transmitted is 16384 bytes, bit28 to bit25 are other node device ids to be transmitted by the user, and are defined by the user, bit24 to bit11 are 0x3FFF, and bit10 to bit0 are 0x7FF.
As shown in fig. 1, the transmission flow is as follows:
Step ①: frame_count, remain_frame_length, is calculated and frame_index is initialized to 0.
Step ②: is it determined that frame_index is less than frame_count?
Step ③: if frame_index is less than frame_count, extend _id_head is obtained and extend _id is calculated. If frame_index is greater than or equal to frame_count, then step ⑥ is performed.
Step ④: the frame_index data frame is obtained as a data frame to be transmitted, and the data frame length is 8 bytes.
Step ⑤: the current node sends the data frame onto the CAN bus and then accumulates frame_index by 1.
Step ⑥: and obtaining extend _id_head and calculating extend _id.
Step ⑦: acquiring a frame_index data frame as a data frame to be transmitted, wherein the frame_index data frame has a length of main_frame_length
Step ⑧: and the current node sends the data frame to the CAN bus, and the content of the sent data segment is finished.
As shown in fig. 2, the receiving flow is as follows:
step ①: one frame of data is received, and device_id, payload_length, frame_index values are calculated.
Step ②: is it determined whether the received device_id is equal to the node device_id? If equal, go to step ③, if not, discard the data frame, then go to step ①.
Step ③: if the result of subtracting frame_index from payload_length is greater than or equal to 8, then step ④ is performed, otherwise step ⑤ is performed.
Step ④: this data frame is placed in 8 byte length memory starting at recv_buf frame_index by 8.
Step ⑤: this data frame is placed in the (payload_length minus frame_index by 8) length memory starting from recv_buf frame_index by 8.
Step ⑥: the content of the data segment is stored in the recv_buf memory, and the receiving is finished.
It should be noted that, in the above system embodiment, each unit included is only divided according to the functional logic, but not limited to the above division, so long as the corresponding function can be implemented; in addition, the specific names of the functional units are also only for distinguishing from each other, and are not used to limit the protection scope of the present invention.
In addition, those skilled in the art will appreciate that all or part of the steps in implementing the methods of the embodiments described above may be implemented by a program to instruct related hardware, and the corresponding program may be stored in a computer readable storage medium.
The preferred embodiments of the invention disclosed above are intended only to assist in the explanation of the invention. The preferred embodiments are not exhaustive or to limit the invention to the precise form disclosed. Obviously, many modifications and variations are possible in light of the above teaching. The embodiments were chosen and described in order to best explain the principles of the invention and the practical application, to thereby enable others skilled in the art to best understand and utilize the invention. The invention is limited only by the claims and the full scope and equivalents thereof.

Claims (7)

1. The communication method supporting the CAN bus to transmit more than 8 bytes of data is characterized by comprising a data transmitting method and a data receiving method;
the data sending method comprises the following steps:
step S1: calculating a frame_count, a main_frame_length, and initializing the frame_index to 0;
Step S2: judging whether the frame_index is smaller than the frame_count;
step S3: if frame_index is less than frame_count, then extend _id_head is obtained, extend _id= extend _id_head bit by bit or frame_index is calculated;
if frame_index is greater than or equal to frame_count, then step S6 is performed;
Step S4: acquiring an 8-byte data frame starting from frame_index x 8 bytes as a data frame to be transmitted;
Step S5: the current node sends the data frame to the CAN bus, then adds up the frame_index to 1, and returns to the step S2;
step S6: the extend _ id _ head is obtained, calculation of extend _id = extend _id/u head bitwise or frame_index;
Step S7: acquiring data with a length of domain_frame_length from a frame_index of 8 bytes of a data segment as a data frame to be transmitted;
step S8: the current node sends the data frame to the CAN bus, and the content of the sent data segment is finished;
the data receiving method comprises the following steps:
step F1: receiving a frame of data, and calculating device_id, payload_length and frame_index values;
step F2: judging whether the receiving device_id is equal to the node device_id;
if the two types are equal, executing the step F3;
If not, discarding the data frame, and continuing to execute the step F1;
step F3: judging whether the result of subtracting frame_index from payload_length by 8 is greater than or equal to 8;
If yes, executing the step F4;
If not, executing the step F5;
step F4: putting the data frame into an 8-byte length memory from the frame_index of recv_buf multiplied by 8;
step F5: putting the data frame into a length memory of which the frame_index is multiplied by 8 and the payload_length is subtracted from the frame_index which starts from the recv_buf;
step F6: the content of the data segment is stored in the recv_buf memory, and the receiving is finished;
Wherein frame_count is the number of integer frames; the remainder_frame_length is the length of the remainder frame, and the size is equal to the remainder of the payload_length divided by 8; after the frame_index is intercepted for the data segment, the identification of each segment is uniquely expressed relative to other segments; extend _id_head is a value obtained by performing bit-wise or operation on the result of shifting the device_id by 25 bits, the result of shifting the payload_length by 11 bits, and the frame_index; extend _id is synonymous with extended frame id, equal to extend _id_head, frame_index bit or result; payload_length is a data segment length, unit byte; recv_buf is a memory buffer of the received data segment, and is used for storing the content of the received data segment, and the length of the received data segment is greater than or equal to the length of the received data segment.
2. The communication method according to claim 1, wherein in the step F1, the payload_length represents a length of a data segment, the data segment is truncated to generate an integer frame and a remainder frame, the length of the integer frame is 8 bytes, the number of the integer frame is defined as frame_count, the length of the remainder frame is defined as remaining_frame_length, and the number of the remainder frame is 1, and the calculation formula between frame_ count, payload _length and remaining_frame_length is as follows:
frame_count=payload_length/8
remain_frame_length=payload_length%8;
where payload_length/8 represents an integer of payload_length divided by 8, and payload_length%8 represents a remainder of payload_length divided by 8.
3. The communication method for supporting more than 8 bytes of data transmitted by CAN bus according to claim 2, wherein said device_id, payload_length, frame_index are fields of data frame ID, and the sizes are sequentially defined as m bits, n bits and k bits;
Wherein m, n and k satisfy the following relationship:
where id_length is 11 when the can2.0a communication protocol is selected and 29 when the can2.0b communication protocol is selected.
4. A communication method supporting CAN bus transmission of more than 8 bytes of data according to claim 3, wherein the values of m, n and k are all user-defined; after m is well defined, on the premise that n and k are removed, the following conditions are satisfied:
5. A communication method supporting CAN bus transmission of more than 8 bytes of data according to claim 1, wherein said CAN bus is transmitted using CAN communication protocol; the CAN communication protocol includes a CAN2.0A communication protocol and a CAN2.0B communication protocol.
6. The communication method supporting more than 8 bytes of data transmitted over a CAN bus according to claim 5, wherein said CAN2.0a communication protocol supports an 11-bit extended frame id; in the 11-bit expansion frame ID, bits 10 to 9 are used for identifying the device ID, are defined as device_id, have a size of 2 bits, have a value range of 0 to 3, and support 4 devices to be communicated at most; bit 8-bit 3 are used for storing payload_length, the size is 6 bits, the value range is 0-63, and the maximum supporting transmission data segment size is 64 bytes; bit 2-bit 0 are used for storing frame_index, the size is 3 bits, the value range is 0-7, and the maximum transmission of 8 segments of data frames is supported.
7. The communication method supporting more than 8 bytes of data transmitted over a CAN bus according to claim 5, wherein said CAN2.0b communication protocol supports a 29 bit extended frame id; in the 29-bit expansion frame ID, bits 28 to 25 are used for identifying the device ID, are defined as device_id, have a size of 4 bits, have a value range of 0 to 15, and support 16 devices to communicate at most; bit 24-bit 11 are used for storing payload_length, the size is 14 bits, the value range is 0-16383, and the size of a transmission data segment is 16384 bytes at most; bit 10-bit 0 are used for storing frame_index, the size is 11 bits, the value range is 0-2047, and 2048 segments of data frames are maximally supported to be transmitted.
CN202210803933.9A 2022-07-07 2022-07-07 Communication method supporting CAN bus to transmit data with more than 8 bytes Active CN115174307B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210803933.9A CN115174307B (en) 2022-07-07 2022-07-07 Communication method supporting CAN bus to transmit data with more than 8 bytes

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210803933.9A CN115174307B (en) 2022-07-07 2022-07-07 Communication method supporting CAN bus to transmit data with more than 8 bytes

Publications (2)

Publication Number Publication Date
CN115174307A CN115174307A (en) 2022-10-11
CN115174307B true CN115174307B (en) 2024-10-15

Family

ID=83493405

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210803933.9A Active CN115174307B (en) 2022-07-07 2022-07-07 Communication method supporting CAN bus to transmit data with more than 8 bytes

Country Status (1)

Country Link
CN (1) CN115174307B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1560806A (en) * 2004-03-04 2005-01-05 深圳市泛海三江电子有限公司 Fire alarm application layer data transmission method based on CAN2.0B
CN102664779A (en) * 2012-03-31 2012-09-12 航天东方红卫星有限公司 CAN bus data transmitting method

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20100073846A (en) * 2008-12-23 2010-07-01 한국전자통신연구원 Data frame transmissing and receiving method in a can protocol
JP5770925B2 (en) * 2011-04-06 2015-08-26 ローベルト ボッシュ ゲゼルシャフト ミット ベシュレンクテル ハフツング Method and apparatus for increasing data transmission capacity in a serial bus system
US9432289B2 (en) * 2011-04-26 2016-08-30 Robert Bosch Gmbh Method and device for serial data transmission which is adapted to memory sizes
CN107919947B (en) * 2017-11-28 2020-09-29 南瑞集团有限公司 A coding method for CAN bus long message transmission

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1560806A (en) * 2004-03-04 2005-01-05 深圳市泛海三江电子有限公司 Fire alarm application layer data transmission method based on CAN2.0B
CN102664779A (en) * 2012-03-31 2012-09-12 航天东方红卫星有限公司 CAN bus data transmitting method

Also Published As

Publication number Publication date
CN115174307A (en) 2022-10-11

Similar Documents

Publication Publication Date Title
RU2596582C2 (en) Method and device for memory size adapted serial data transfer
US5072374A (en) Method for communicating among a plurality of programmable logic controllers each having a dma controller
CN110177013B (en) A Design and Implementation Method of EtherCAT Master-Slave Station Based on FPGA
CN107547574B (en) A communication system and method based on general protocol
CN104852825A (en) Bus communication test method and system
CN108989243B (en) A real-time Ethernet scheduling method for transmitting real-time data
CN113225406A (en) Communication method of host and multiple slaves
CN115174307B (en) Communication method supporting CAN bus to transmit data with more than 8 bytes
CN113196709B (en) Data transmission method and automatic communication network
KR101332279B1 (en) Method and device for transmitting data packets
CN102710656B (en) Communication protocol inverse analysis method based on automotive gateway system
CN113220607A (en) Data processing method based on FIFO
CN102710479A (en) Automobile gateway system for inverse resolution of communication protocols
US8554966B2 (en) Method for data exchange
Wang et al. Research on the time delay of controller area network for vehicle
CN113132468B (en) Communication method, communication device, communication system and storage medium based on ModbusTCP protocol
CN110769049B (en) Power distribution terminal and SOE data uploading method thereof
US8279894B2 (en) Method and device for data packet assembly
Wang et al. The real-time networked data gathering systems based on EtherCAT
CN107229571B (en) Control method and system for FMMU in EtherCAT slave station
CN116527710B (en) Electric power communication network system
CN113014547B (en) Sequencing mapping-based direct data transmission system and method
CN119788748A (en) Communication system and chip of Ethernet and AUTBUS
CN118612290A (en) A transmission system for converting AXI bus to general data stream
CN114760364A (en) Time-triggered serial device communication management method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20240626

Address after: No. 99 Zhenxing Road, Economic Development Zone, Hanshan County, Ma'anshan City, Anhui Province, 238101

Applicant after: Anhui Xiaojun Intelligent Equipment Co.,Ltd.

Country or region after: China

Address before: Room 1056, No. 19, Tianzhi Road, Hefei High-tech Development Zone, Hefei City, Anhui Province, 230000

Applicant before: Hefei Zhixingtong Intelligent Technology Co.,Ltd.

Country or region before: China

GR01 Patent grant
GR01 Patent grant