CN108199941A - A kind of CAN bus communication means based on CAN2.0B - Google Patents
A kind of CAN bus communication means based on CAN2.0B Download PDFInfo
- Publication number
- CN108199941A CN108199941A CN201711478076.5A CN201711478076A CN108199941A CN 108199941 A CN108199941 A CN 108199941A CN 201711478076 A CN201711478076 A CN 201711478076A CN 108199941 A CN108199941 A CN 108199941A
- Authority
- CN
- China
- Prior art keywords
- frame
- address
- main equipment
- register
- communication
- 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.)
- Granted
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L12/00—Data switching networks
- H04L12/28—Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
- H04L12/40—Bus networks
- H04L12/40006—Architecture of a communication node
- H04L12/40013—Details regarding a bus controller
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L12/00—Data switching networks
- H04L12/28—Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
- H04L12/40—Bus networks
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L12/00—Data switching networks
- H04L12/28—Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
- H04L12/40—Bus networks
- H04L12/40143—Bus networks involving priority mechanisms
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L12/00—Data switching networks
- H04L12/28—Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
- H04L12/40—Bus networks
- H04L2012/40208—Bus networks characterized by the use of a particular bus standard
- H04L2012/40215—Controller Area Network CAN
Abstract
The invention discloses a kind of CAN bus communication means based on CAN2.0B, include the following steps:Main equipment sends the communication frame with frame order encoding based on CAN bus communication protocol to slave device;Slave device receives communication frame, is operated according to the register position that the target register address of the command type of communication frame to main equipment is specified, and returns to the response frame with same number of frames order encoding to main equipment;The register position that main equipment specifies the response frame storage of reception to the destination register address of slave device.This method is by providing frame order encoding, the precedence of different command frame can be distinguished, coordinate command type that the response relation of order is determined simultaneously, the historical relation of message can be judged according to identification code part by sending and receiving end, for judging that bus receives and dispatches success status, the execution efficiency of application software is improved, and improves the reliability of information exchange.
Description
Technical field
The present invention relates to a kind of CAN bus communication means more particularly to a kind of CAN bus communication parties based on CAN2.0B
Method belongs to network communication technology field.
Background technology
CAN (Controller Area Network, controller local area network) bus can effectively support distributed control
System or the serial communication controlled in real time, have been widely used in industrial automation, automobile, ship, Medical Devices, industrial equipment
Etc..Compared with general communication bus, the communication of data based on CAN bus is with stronger reliability, real-time and flexibly
Property.
, it is specified that the message identification code of 29 is for judging priority and accepting filter in CAN2.0 agreements, 8 words
The data area of section is used for transmitting communication data.But it in practical applications, needs to design using message identification code and data field
Suitable communication mechanism, for implementing CAN bus communication.
In the practical application of CAN bus, application software deals with the decline that can lead to CAN bus communication efficiency improperly,
The real-time of CAN bus is reduced, therefore it is excellent to design under the framework of CAN bus a set of good reliability, efficient and real-time
Good communication mechanism is the technical issues of being badly in need of solving in CAN bus application to realize efficient, reliable communication.
Invention content
In view of the deficiencies of the prior art, the technical problems to be solved by the invention are to provide a kind of based on CAN2.0B's
CAN bus communication means.
For achieving the above object, the present invention uses following technical solutions:
A kind of CAN bus communication means based on CAN2.0B, includes the following steps:
Main equipment sends the communication frame with frame order encoding based on CAN bus communication protocol to slave device;
Slave device receives communication frame, is specified according to the target register address of the command type of communication frame to main equipment
Register position is operated, and returns to the response frame with same number of frames order encoding to main equipment;
The register position that main equipment specifies the response frame storage of reception to the destination register address of slave device.
Wherein more preferably, when the command type of communication frame is write command, communication process includes the following steps:
Main equipment sends the communication frame with frame order encoding based on CAN bus communication protocol to slave device;
Slave device receives communication frame, and the command type for obtaining communication frame is write command, by the data of data field in communication frame
Store the register position that the target register address of main equipment is specified;And it returns to main equipment and is compiled with same number of frames order
The response frame of code;
The register position that main equipment specifies the response frame storage of reception to the destination register address of slave device.
Wherein more preferably, when the command type of communication frame is write command, communication process includes the following steps:
Main equipment sends the write command communication frame with frame order encoding based on CAN bus communication protocol to slave device;
Slave device receives communication frame, and the command type for obtaining communication frame is reading instruction, obtains the destination register of main equipment
Address, and the data information of register position that the target register address for obtaining main equipment is specified are carried to main equipment return
The response frame of same number of frames order encoding and data information;
The register position that main equipment specifies the response frame storage of reception to the destination register address of slave device.
Wherein more preferably, when bursty state occurs, burst instruction is generated, slave device generation includes burst instruction
Burst communication frame according to the priority of the identification code part of burst communication frame, sends burst communication frame according to priority orders
To main equipment;Main equipment is according to the target register address of slave device, by the data zone content storage of burst communication frame to from setting
The register position that standby target register address is specified.
Wherein more preferably, when the command type of communication frame be broadcast frame when, main equipment to it is all with being provided with identical broadcasts
The slave device of location sends broadcast frame simultaneously, and slave device is by the target register address of the data information memory received to broadcast frame
In the register position specified, broadcast frame is without responding.
Wherein more preferably, the CAN bus communication protocol based on CAN2.0B includes identification code part and data portion.
Wherein more preferably, the identification code part represents the priority of CAN communication;The numerical value of identification code part is smaller
Priority is higher.
Wherein more preferably, the identification code part includes order grade, source device address, destination device address, order class
Type and frame coding;
The order grade is the Bit28-25 of identification code part, represents communication priority;
The source device address is the Bit24-17 of identification code part, represents to send the source device address of order;
The destination device address is the Bit16-9 of identification code part, represents to receive the destination device address of order;
The command type is the Bit8-6 of identification code part, represents the command type of this frame ordering;
The frame order encoding is the Bit5-0 of identification code part, represents the order encoding of this frame ordering.
Wherein more preferably, minimum 16 addresses give over to broadcast frame use or as commissioning device in the source device address
Address uses, not as commonly used equipment address;
Minimum 16 addresses give over to broadcast frame and use or used as commissioning device address in the destination device address,
Not as commonly used equipment address.
Wherein more preferably, the data portion includes target register address, source register address and data field;
Wherein, the target register address is the Byte0-1 of data portion, represents the order target device to be operated
Target register address, the register position that main equipment specifies target register address carries out write operation or read should
The content of register position;
Source register address is the Byte2-3 of data portion, represents to send the source register address of the main equipment of order,
The corresponding register position of source register address of the main equipment is written in response command content by response frame;
The data field is the Byte4-7 of data portion, is the data content to register manipulation.
In CAN bus communication means provided by the present invention, by providing frame order encoding, different command can be distinguished
The precedence of frame, while coordinate command type that the response relation of order is determined, sending and receiving end can be according to identification
Code partly judges the historical relation of message, and for judging that bus receives and dispatches success status, improve application software performs effect
Rate, and improve the reliability of information exchange.In addition to this, this method provides the data communication device based on register access
System, target register address and source register address are defined in data portion, consequently facilitating realizing that RDMA (is remotely directly counted
According to access) function.
Description of the drawings
Fig. 1 is the flow chart of CAN bus communication means provided by the present invention.
Specific embodiment
Detailed specific description is carried out to the technology contents of the present invention in the following with reference to the drawings and specific embodiments.
CAN bus communication means provided by the present invention realizes, CAN2.0B frame formats are shown in based on CAN2.0B communication frames
Shown in the following table 1.
The frame format of table 1CAN2.0B communication frames
Wherein, byte 1 is frame information, includes 8bit.
Bit7 is FF:Frame format (FF=0, the FF=1 in frame is extended in standard frame) is represented, provided by the present invention
Embodiment in, extend frame FF=1;
Bit6 is RTR:Represent the type (RTR=0 is expressed as data frame, and RTR=1 is expressed as remote frame) of frame, here two
Kind frame uses;
Bit3-0 is DLC:Represent the data length practical in transmission data frame.
Byte 2~5 is message identification code.Message identification code ID totally 4 bytes, wherein high 29 effectively, actually using
In pass through receiving filter (ACR) and shielding filter (AMR) (or two are ACR wave filters) and realize packet filtering work(
Can, the message only met with wave filter can be just stored in correspondingly received buffer queue, otherwise ignore the message.
Byte 6~13 is the real data of data frame, and when remote frame is invalid;
X:X in frame format is invalid bit.
In CAN bus communication means provided by the present invention, planned in 29 message identification codes the division of each field and
Specific function defines, it is specified that the function of each byte in data field defines, it is specified that the data field based on register access is specific
Access mechanism.The execution efficiency of software, bus utilization in communication process are improved, reduces the difficulty of applied software development.
In embodiment provided by the present invention, the CAN bus communication protocol message format based on CAN2.0B of use,
It is as shown in table 2 below.
CAN bus communication protocol message format of the table 2 based on CAN2.0B
The message format of planning is described in detail with reference to table 2.
Identification code ID:ID codes represent the priority arbitration of CAN communication, and the smaller priority of numerical value is higher.29 are planned
The division of each field and the definition of specific function in message identification code (identification code).
Wherein, Bit28-25 LEVEL:Order grade.
Order grade includes 16 grade 0-15, and 0 represents the highest instruction of grade, and 15 represent elementary instruction.
Bit24-17 is DVSA:Source device address.
Source device address represents the source device address of transmission order, 256 device address 0-255 is contained up to, wherein most
Low 16 address 0-15 give over to broadcast frame and use or used as commissioning device address, not as commonly used equipment address.
Bit16-9 is DVTA:Destination device address.
Destination device address represents the destination device address of reception order, contains up to 256 device address 0-255,
In minimum 16 address 0-15 give over to broadcast frame and use or used as commissioning device address, not as commonly used equipment address.
Bit8-6 is TYPE:Command type.
Command type represents the command type of this frame ordering, at most provides 8 kinds of command type 0-7.
Bit5-0 is FID:Frame encodes.
The order encoding of this frame ordering of frame coded representation is recycled from 0-63, is encoded by the equipment for initiating communication,
The frame coding of the response frame of response apparatus is identical with the frame coding received.
Define the function definition of each bytes of data field DATA.
Byte0-1 is RegTA:Target register address.
Target register address represents the target register address of the order target device to be operated, which is 16bit
Value 0-65535 can carry out write operation to the register position or read the content of the register position.
Byte2-3 is RegSA:Source register address.
Source register address is the source register address for the source device for sending order, which is 16bit values 0-
65535, which is that source device is to respond the register position that frame ordering is reserved, and response command content is written response frame
The register.
Byte4-7 is Data:Data field.
Specific data content to register manipulation is fixed 32bit length, is specifically defined according to practical application, works as reality
32bit uses of gathering together enough are also required to when being less than 32bit length in the application of border.
According to the above-mentioned CAN bus communication protocol based on CAN2.0B, with reference to specific flow chart, to provided by the present invention
The CAN bus communication means based on CAN2.0B, illustrate.
CAN bus communication means provided by the present invention, includes the following steps:Main equipment is based on CAN bus communication protocol
The communication frame with frame order encoding is sent to slave device;Slave device receives communication frame, according to the command type of communication frame to finger
The register position that the target register address of fixed main equipment is specified is operated, and is returned to main equipment with same number of frames
The response frame of order encoding;The deposit that main equipment specifies the response frame storage of reception to the destination register address of slave device
Device position, a sign off.This processing procedure is described in detail below.
CAN bus communication protocol based on CAN2.0B includes identification code part and data portion.Wherein, identification code part
It is encoded including order grade, source device address, destination device address, command type and frame.Identification code part represents CAN and leads to
The priority arbitration of letter, the smaller priority of numerical value are higher.Order grade is the Bit28-25 of identification code part, it is specified that being communication
Priority provides 0-15 totally 16 priority, represents instruction level.Source device address is the Bit24- of identification code part
17, it represents to send the source device address of order, 256 device address 0-255 is contained up to, wherein minimum 16 address 0-15
It gives over to broadcast frame to use or use as commissioning device address, not as commonly used equipment address.Destination device address is identification
The Bit16-9 of code part represents to receive the destination device address of order, contains up to 256 device address 0-255, wherein
Minimum 16 address 0-15 give over to broadcast frame and use or used as commissioning device address, not as commonly used equipment address.Life
The Bit8-6 that type is enabled to be identification code part represents the command type of this frame ordering.Frame is encoded to the Bit5- of identification code part
0, it represents the order encoding of this frame ordering, is recycled from 0~63, encoded by the main equipment for initiating communication, response
The frame coding of the response frame of slave device is identical with the frame coding received.It can be determined by command type and frame order encoding
The response relation of each frame ordering.
In CAN bus communication protocol, identification code ID represents the priority for occupying bus, and the smaller priority of ID codes is got over
It is high.Highest several is instruction level in ID codes, and the order grade of burst mode (mainly includes higher than master slave mode in the application
Reading and writing and broadcast mode) order grade.It is the source device address for sending order down again, followed by receives the mesh of order
Marking device address, this represents that the communication that main equipment is initiated in bus more preferably occupies bus.ID codes are finally frame types
With frame order encoding, the priority that the two fields determine is minimum.
Data portion defines the function definition of each bytes of data portion DATA, is deposited including target register address, source
Device address and data field.Wherein, target register address is the Byte0-1 of data portion, represents that the order target to be operated is set
Standby target register address can carry out write operation to the register position or read the content of the register position.Source
Register address is the Byte2-3 of data portion, represents to send the source register address of the source device of order, which is
Source device is to respond the register position that frame ordering is reserved, and the register is written in response command content by response frame.Data field is
The Byte4-7 of data portion is the specific data content to register manipulation, fixed 32bit length.The CAN bus communication protocols
It discusses as the communication mechanism based on register.Each equipment defines the register of multiple 32bit, and the instruction of this communication protocol is logical
It crosses read-write register and transmits the communication information, target register address is to initiate the order equipment slave device to be accessed in data field
Register address, source address is to initiate this device register address that order equipment receives response.
In embodiment provided by the present invention, communication instruction is all master slave instructions, i.e., main equipment initiates communication frame from setting
Standby returning response frame, primary communication are completed.The response relation of communication frame is compiled by frame type (command type) TYPE and frame order
Code FID determines that main equipment sends the communication frame with frame order encoding by CAN bus communication protocols to slave device;Slave device
Communication frame is received, is carried out according to the register position that the target register address of the command type of communication frame to main equipment is specified
Operation, and return to the response frame with same number of frames order encoding to main equipment;Main equipment is by the storage of the response frame of reception to from setting
The register position that standby destination register address is specified, a sign off.The FID of response frame and the communication frame received
FID it is identical, initiate in this way communication equipment can by frame type TYPE and frame order encoding FID judgements it is specific certain
Whether one frame ordering is responded.The process verified again can be reduced, reduces the complexity of communication, improves communication
Efficiency.
In embodiment provided by the present invention, the command type of communication frame includes write command and reading instruction.Work as communication frame
Command type when being write command, realize that register write and register write respond, communication process includes the following steps:
Main equipment sends the communication frame with frame order encoding based on CAN bus communication protocol to slave device;That is register
Write command is initiated by main equipment.
Slave device receives communication frame, and the command type for obtaining communication frame is write command, by the data of data field in communication frame
Store the register position that the target register address of main equipment is specified;And it returns to main equipment and is compiled with same number of frames order
The response frame of code.I.e. slave device stores the 32bit data of data field in instruction to target register address after receiving the instruction
The register position specified.The slave device sends out register write response instruction (i.e. response frame) to main equipment simultaneously, at this point, from
Target register address in the register write response instruction that equipment is sent out is the source deposit in the register write instruction of main equipment
Device address, the source register address in the register write response instruction that slave device is sent out is in the register write instruction of main equipment
Target register address.The data field of response instruction can be not concerned with that some status informations can also be added according to application.
The register position that main equipment specifies the response frame storage of reception to the destination register address of slave device, one
Secondary sign off.I.e. main equipment receives the response frame and represents that the instruction of this register write operates successfully.
When the command type of communication frame is write command, realize that register is read to read to respond with register, communication process includes
Following steps:
Main equipment sends the write command communication frame with frame order encoding based on CAN bus communication protocol to slave device;I.e.
Register read instructions are initiated by main equipment.
Slave device receives communication frame, and the command type for obtaining communication frame is reading instruction, obtains the destination register of main equipment
Address, and the data information of register position that the target register address for obtaining main equipment is specified are carried to main equipment return
The response frame of same number of frames order encoding and data information.I.e. slave device receive the 32bit data informations of data field after the instruction can
To be not concerned with.The slave device sends out register to main equipment and reads response instruction, the target deposit in read register response instruction
The corresponding register-bit in device address is set to the corresponding register-bit of source register address of the main equipment in read register instruction
It puts, the corresponding register-bit of source register address of slave device is set to the destination register of the main equipment in read register instruction
The corresponding register position in address, the register that 32bit data informations are specified for target register address in read register instruction
The information of position.
The register position that main equipment specifies the response frame storage of reception to the destination register address of slave device, one
Secondary sign off.I.e. main equipment receives the response frame, by mesh in the data information memory of 32bit to read register response instruction
In the register position that scalar register file address is specified, represent that this register read instructions operates successfully.
Pass through the source register address of the source register address of main equipment, target register address and slave device, mesh
Scalar register file address can realize the RDMA functions of CAN bus communication protocol planning, i.e. remote direct data access facility.Life
The register position for enabling originating end that order receiving terminal is specified to store returned data, order originating end receive order receiving terminal
Return instruction after, target register address that can be directly in return instruction enters returned data storage, RDMA
Function improves the execution efficiency of software, bus utilization, the difficulty for reducing applied software development.
In embodiment provided by the present invention, CAN bus communication means further includes broadcasting instructions and burst instructs, and leads to
The mode for crossing broadcast frame and burst communication frame communicates.When there is emergency case, such as slave device generation is wrong, alarm is different
During normal state, slave device can be with active upload wrong status information or other emergence messages to main equipment, and main equipment is slave device
Advance reservation goes out the register position of storage burst instruction, after main equipment receives burst instruction, by the data of 32bit
In the register position that information storage is specified to target register address.The priority of burst information is excellent higher than principal and subordinate's order
First grade.I.e. when bursty state occurs, burst instruction is generated, slave device generation includes the burst communication frame of burst instruction, root
According to the priority of the identification code part of burst communication frame, burst communication frame is sent to main equipment according to priority orders.Master sets
The standby target register address according to slave device deposits the target of data zone content storage to the slave device of burst communication frame
In the register that device address is specified.
In embodiment provided by the present invention, CAN bus communication protocol supports broadcast frame, it is desirable that the reception filter of equipment
Wave device at least 2 or more, wherein at least 1 receiving filter are reserved for broadcast frame, the destination device address of broadcast frame
It is not used for 0-15 as fixed equipment address, broadcast frame does not need to slave device response, and updating the content of registers specified can
With.Broadcast frame be main equipment initiate, i.e., when the command type of communication frame be broadcast frame when, main equipment to it is all be provided with it is identical
The slave device of broadcast address sends broadcast frame simultaneously, and slave device deposits the target of the data information memory received to broadcast frame
In the register position that device address is specified, broadcast frame is without responding.
In embodiment provided by the present invention, in communication process is carried out, need to establish heartbeat mechanism.In the bus
It can not determine whether equipment works online by the slave device that main equipment accesses for a long time, intervals are not interviewed
The slave device asked, main equipment need transmission state reading order to respond slave device to determine that slave device works online, have
Body includes the following steps:
Main equipment timing acquisition does not access the time span of each slave device, judges whether the time span is more than and accesses
Time threshold;
When the time span be more than access time threshold value when, main equipment be based on CAN bus communication protocol to this do not access when
Between length be more than access time threshold value slave device send with frame order encoding communication frame;
Slave device receives communication frame, and the command type for obtaining communication frame is transmission state reading order, is returned to main equipment
Response frame with same number of frames order encoding;
The register position that main equipment specifies the response frame storage of reception to the destination register address of slave device, really
Determine slave device to work online.
In conclusion the CAN bus communication means provided by the present invention based on CAN2.0B, it is total that main equipment is based on CAN
Line communication protocol sends the communication frame with frame order encoding to slave device;Slave device receives communication frame, according to the life of communication frame
The register position that the target register address for enabling type to the main equipment specified is specified is operated, and is returned to main equipment
Response frame with same number of frames order encoding;Main equipment stores the response frame of reception to the destination register address of slave device
The register position specified, a sign off.By providing frame order encoding, the priority time of different command frame can be distinguished
Sequence, while coordinate command type that the response relation of order is determined, sending and receiving end can sentence according to identification code part
The historical relation of disconnected message for judging that bus receives and dispatches success status, improves the execution efficiency of application software, and improve
The reliability of information exchange.In addition to this, this method provides the data communication device system based on register access, in data portion
Target register address and source register address are defined, consequently facilitating realizing RDMA (remote direct data access) function.
It is described in detail above to provided by the present invention.For those of ordinary skill in the art, not
To any obvious change that it is done under the premise of the true spirit, will all form to patent of the present invention
The infringement of power will undertake corresponding legal liabilities.
Claims (10)
1. a kind of CAN bus communication means based on CAN2.0B, it is characterised in that include the following steps:
Main equipment sends the communication frame with frame order encoding based on CAN bus communication protocol to slave device;
Slave device receives communication frame, the register specified according to the target register address of the command type of communication frame to main equipment
Position is operated, and returns to the response frame with same number of frames order encoding to main equipment;
The register position that main equipment specifies the response frame storage of reception to the destination register address of slave device.
2. CAN bus communication means as described in claim 1, it is characterised in that when the command type of communication frame is write command
When, communication process includes the following steps:
Main equipment sends the communication frame with frame order encoding based on CAN bus communication protocol to slave device;
Slave device receives communication frame, and the command type for obtaining communication frame is write command, and the data of data field in communication frame are stored
The register position specified to the target register address of main equipment;And return to the sound with same number of frames order encoding to main equipment
Answer frame;
The register position that main equipment specifies the response frame storage of reception to the destination register address of slave device.
3. CAN bus communication means as described in claim 1, it is characterised in that when the command type of communication frame is write command
When, communication process includes the following steps:
Main equipment sends the write command communication frame with frame order encoding based on CAN bus communication protocol to slave device;
Slave device receives communication frame, and the command type for obtaining communication frame is reading instruction, obtains the target register address of main equipment,
And the data information of register position that the target register address for obtaining main equipment is specified, it is returned to main equipment with same number of frames
The response frame of order encoding and data information;
The register position that main equipment specifies the response frame storage of reception to the destination register address of slave device.
4. CAN bus communication means as described in claim 1, it is characterised in that:
Burst instruction is generated when bursty state occurs, slave device generation includes the burst communication frame of burst instruction, according to prominent
The priority of the identification code part of communication frame is sent out, burst communication frame is sent to main equipment according to priority orders;Main equipment root
According to the target register address of slave device, by the target register address of the data zone content storage of burst communication frame to slave device
The register position specified.
5. CAN bus communication means as described in claim 1, it is characterised in that:
When the command type of communication frame is broadcast frame, main equipment is sent out simultaneously to all slave devices for being provided with identical broadcasts address
Send broadcast frame, the register position that slave device specifies the target register address of the data information memory received to broadcast frame
In, broadcast frame is without responding.
6. CAN bus communication means as described in claim 1, it is characterised in that:
CAN bus communication protocol based on CAN2.0B includes identification code part and data portion.
7. CAN bus communication means as claimed in claim 6, it is characterised in that:
The identification code part represents the priority of CAN communication, and the smaller priority of numerical value of identification code part is higher.
8. CAN bus communication means as claimed in claim 6, it is characterised in that:
The identification code part includes order grade, source device address, destination device address, command type and frame coding;
The order grade is the Bit28-25 of identification code part, represents communication priority;
The source device address is the Bit24-17 of identification code part, represents to send the source device address of order;
The destination device address is the Bit16-9 of identification code part, represents to receive the destination device address of order;
The command type is the Bit8-6 of identification code part, represents the command type of this frame ordering;
The frame order encoding is the Bit5-0 of identification code part, represents the order encoding of this frame ordering.
9. CAN bus communication means as claimed in claim 8, it is characterised in that:
Minimum 16 addresses give over to broadcast frame and use or used as commissioning device address in the source device address, not as
Commonly used equipment address;
Minimum 16 addresses give over to broadcast frame and use or used as commissioning device address in the destination device address, do not make
For commonly used equipment address.
10. CAN bus communication means as claimed in claim 6, it is characterised in that:
The data portion includes target register address, source register address and data field;
Wherein, the target register address is the Byte0-1 of data portion, represents the target of the order target device to be operated
Register address, main equipment carry out write operation to the register position that target register address is specified or read the register-bit
The content put;
Source register address is the Byte2-3 of data portion, represents to send the source register address of the main equipment of order, response frame
Response command content is written to the corresponding register position of source register address of the main equipment;
The data field is the Byte4-7 of data portion, is the data content to register manipulation.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201711478076.5A CN108199941B (en) | 2017-12-29 | 2017-12-29 | CAN bus communication method based on CAN2.0B |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201711478076.5A CN108199941B (en) | 2017-12-29 | 2017-12-29 | CAN bus communication method based on CAN2.0B |
Publications (2)
Publication Number | Publication Date |
---|---|
CN108199941A true CN108199941A (en) | 2018-06-22 |
CN108199941B CN108199941B (en) | 2022-03-08 |
Family
ID=62586544
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201711478076.5A Active CN108199941B (en) | 2017-12-29 | 2017-12-29 | CAN bus communication method based on CAN2.0B |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108199941B (en) |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111416722A (en) * | 2019-01-04 | 2020-07-14 | 郭洪威 | Communication method and device |
CN111586548A (en) * | 2020-05-09 | 2020-08-25 | 惠州市德赛西威汽车电子股份有限公司 | Method and system for realizing coding of multiple automobile sound equipment based on CAN bus |
CN112602287A (en) * | 2019-07-19 | 2021-04-02 | 华为技术有限公司 | CAN communication method, equipment and system |
CN112835823A (en) * | 2021-01-25 | 2021-05-25 | 无锡众星微系统技术有限公司 | Storage controller response sending method |
CN114221903A (en) * | 2021-11-30 | 2022-03-22 | 新华三技术有限公司合肥分公司 | Data transmission method and device |
CN115529205A (en) * | 2022-09-02 | 2022-12-27 | 上海精泰技术有限公司 | Communication interaction method between motor drivers and two-for-one twister system |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101626333A (en) * | 2009-08-07 | 2010-01-13 | 北京和利时电机技术有限公司 | Controller area network (CAN) bus system and application layer communication method in same |
US20100306457A1 (en) * | 2009-05-28 | 2010-12-02 | Microchip Technology Incorporated | Microcontroller with CAN Module |
CN102932224A (en) * | 2012-11-23 | 2013-02-13 | 哈尔滨工业大学 | CAN network-based data communication system and data communication method based on same |
CN107025203A (en) * | 2017-03-31 | 2017-08-08 | 新华三技术有限公司 | First board, the second board and a kind of equipment |
CN107231698A (en) * | 2016-03-25 | 2017-10-03 | 展讯通信(上海)有限公司 | The transmission method of data, terminal and base station in wireless cellular network |
-
2017
- 2017-12-29 CN CN201711478076.5A patent/CN108199941B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20100306457A1 (en) * | 2009-05-28 | 2010-12-02 | Microchip Technology Incorporated | Microcontroller with CAN Module |
CN101626333A (en) * | 2009-08-07 | 2010-01-13 | 北京和利时电机技术有限公司 | Controller area network (CAN) bus system and application layer communication method in same |
CN102932224A (en) * | 2012-11-23 | 2013-02-13 | 哈尔滨工业大学 | CAN network-based data communication system and data communication method based on same |
CN107231698A (en) * | 2016-03-25 | 2017-10-03 | 展讯通信(上海)有限公司 | The transmission method of data, terminal and base station in wireless cellular network |
CN107025203A (en) * | 2017-03-31 | 2017-08-08 | 新华三技术有限公司 | First board, the second board and a kind of equipment |
Cited By (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111416722A (en) * | 2019-01-04 | 2020-07-14 | 郭洪威 | Communication method and device |
CN112602287A (en) * | 2019-07-19 | 2021-04-02 | 华为技术有限公司 | CAN communication method, equipment and system |
CN111586548A (en) * | 2020-05-09 | 2020-08-25 | 惠州市德赛西威汽车电子股份有限公司 | Method and system for realizing coding of multiple automobile sound equipment based on CAN bus |
CN112835823A (en) * | 2021-01-25 | 2021-05-25 | 无锡众星微系统技术有限公司 | Storage controller response sending method |
CN112835823B (en) * | 2021-01-25 | 2022-03-01 | 无锡众星微系统技术有限公司 | Storage controller response sending method |
CN114221903A (en) * | 2021-11-30 | 2022-03-22 | 新华三技术有限公司合肥分公司 | Data transmission method and device |
CN114221903B (en) * | 2021-11-30 | 2024-03-12 | 新华三技术有限公司合肥分公司 | Data transmission method and device |
CN115529205A (en) * | 2022-09-02 | 2022-12-27 | 上海精泰技术有限公司 | Communication interaction method between motor drivers and two-for-one twister system |
CN115529205B (en) * | 2022-09-02 | 2023-08-11 | 上海精泰技术有限公司 | Communication interaction method between motor drivers and two-for-one twister system |
Also Published As
Publication number | Publication date |
---|---|
CN108199941B (en) | 2022-03-08 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108199941A (en) | A kind of CAN bus communication means based on CAN2.0B | |
CN103546467B (en) | The method applying Modbus rtu protocol on TCP/IP network | |
CN207530843U (en) | According to the communication apparatus of address table active reporting data | |
CN104008082A (en) | Converter of 1553B bus remote terminal (RT) node and controller area network (CAN) bus | |
CN110635982B (en) | Double-host communication method and system on communication bus, industrial control gateway and storage medium | |
CN102611710A (en) | Data interaction method and data interaction system for scheduling master station and transformer substation based on MMS (Multimedia Messaging Service) | |
CN110297797A (en) | Heterogeneous protocol conversion equipment and method | |
CN103701680A (en) | Cross-PCIe domain message transmitting method, equipment and system | |
CN101106504A (en) | Distributed communication system for intelligent independent robot based on CAN bus | |
CN107786406A (en) | The method to be worked using tables of data communication control equipment | |
CN107018151B (en) | CAN-LonWorks protocol conversion method of programmable conversion logic | |
CN1980171A (en) | Multi-host multi-sub-machine bus network | |
CN108512907A (en) | The equipment communication means of half transparent transmission | |
CN101415027B (en) | Communication module based on HDLC protocol, and control method for data real time forwarding and storage | |
CN101848062A (en) | Analogue quantity output module based on MVB (Multifunction Vehicle Bus) interface and MVB device | |
CN102955466A (en) | Method for operating an automation system | |
CN116055534A (en) | Multi-serial device data forwarding system and method | |
CN109600420A (en) | It is a kind of to realize the method and system remotely controlled online based on raspberry pie technology | |
CN114500158A (en) | Computer resolvable Modbus-RTU universal standardized configuration method | |
CN206024025U (en) | A kind of home gateway | |
CN101320359A (en) | Control circuit and method of serial port equipment | |
CN1889567B (en) | Medium-speed series connection bus controller | |
CN114285877A (en) | Universal industrial equipment communication system and method | |
CN1650277A (en) | Method and apparatus for transferring general purpose control information between processors | |
CN102023952A (en) | Communication system and communication control method thereof |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |