CN100428701C - CAN wrong frame generating and detecting system and its method - Google Patents

CAN wrong frame generating and detecting system and its method Download PDF

Info

Publication number
CN100428701C
CN100428701C CNB2006100104237A CN200610010423A CN100428701C CN 100428701 C CN100428701 C CN 100428701C CN B2006100104237 A CNB2006100104237 A CN B2006100104237A CN 200610010423 A CN200610010423 A CN 200610010423A CN 100428701 C CN100428701 C CN 100428701C
Authority
CN
China
Prior art keywords
node
processor
bus
connects
section point
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.)
Expired - Fee Related
Application number
CNB2006100104237A
Other languages
Chinese (zh)
Other versions
CN1909484A (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.)
Harbin Institute of Technology
Original Assignee
Harbin Institute of Technology
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 Harbin Institute of Technology filed Critical Harbin Institute of Technology
Priority to CNB2006100104237A priority Critical patent/CN100428701C/en
Publication of CN1909484A publication Critical patent/CN1909484A/en
Application granted granted Critical
Publication of CN100428701C publication Critical patent/CN100428701C/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention relates to a system for generating and checking the CAN error frame and a relative method, wherein said system is formed by three nodes and one CAN bus (4); and the method comprises: starting the checking system; initializing each node, and setting the mark field, control field, and data field for each node; pressing down the start sending buttons of first, second and third nodes (1, 2, 3); pressing the sending stop button of first node (1) to obtain the MAC frame detecting voltage. The invention has high accuracy.

Description

Generation of a kind of CAN erroneous frame and detection system and method thereof
Technical field
The present invention relates to generation of a kind of CAN erroneous frame and detection system and method thereof.
Background technology
Field bus technique has been applied to industry spot more and more.The CAN bus is especially with distinct advantages such as its high efficiency, low price, high reliability and obtained application more and more widely.CAN communication protocol has been stipulated 4 kinds of different frame types, i.e. Frame, remote frame, erroneous frame and overload frame.In these several frame types, people often are concerned about is to send with data and receive closely-related Frame and remote frame, has but ignored the existence and the importance thereof of erroneous frame.Erroneous frame is a big difficult point of CAN technology, and it is directly connected to the quality of whole system communication.At present, fewer both at home and abroad at the research and analysis of CAN bus error frame, and also the effective means of neither one detect erroneous frame, and this has hindered carrying out of CAN bus education experiment and training to a great extent.
Summary of the invention
Can't realize problem that the erroneous frame on the CAN bus is detected at present in order to solve, the invention provides generation of a kind of CAN erroneous frame and detection system and method thereof, thereby can in depth learn and study core contents such as the erroneous frame of CAN bus, type of errors.
CAN erroneous frame of the present invention produces with detection system to be made up of CAN bus, first node, Section Point and the 3rd node, is mounted with first node, Section Point and the 3rd node on the CAN bus; Described first node by first processor, detecting unit, first communication unit, first display unit, first keyboard, stop to send button A and start to send button B and form; The bus communication end of first processor connects the node communication end of first communication unit, and the bus communication end of first communication unit links to each other with the CAN bus; Detecting unit is gathered the digital signal on the CAN bus, the data output end of detecting unit connects the data input pin of first processor, the data output end of first keyboard connects the control input end of first processor, the state shows signal output of first processor connects the input of first display unit, the control signal output ends that stops to send button A connects the stop signal receiving terminal of first processor, starts the enabling signal receiving terminal that the control signal output ends that sends button B connects first processor; Described Section Point is identical with the structure of the 3rd node; Described Section Point, the 3rd node is by second processor, second display unit, the second communication unit, second keyboard and startup send button C and form, the data output end of second keyboard connects the control input end of second processor, the bus communication end of second processor connects the node communication end of second communication unit, the bus communication end of second communication unit links to each other with the CAN bus, the node state shows signal output of second processor connects the input of second display unit, starts the enabling signal receiving terminal that the control signal output ends that sends button C connects second processor.Detecting unit is gathered the digital signal on the CAN bus, obtain " 0 " or " 1 " signal on the CAN bus by comparison circuit and given reference voltage, be used for the CAN bus level is detected, also can detect CAN bus MAC (media interviews control) frame.
Produce and detection method based on the CAN erroneous frame of above-mentioned CAN erroneous frame generation, carry out according to the following steps successively with detection system: 101, start detection system, preparation powers on; 102, initialization first node, and identifier field, controlling filed and the data fields of first node are set; 103, initialization Section Point, and identifier field, controlling filed and the data fields of Section Point are set will guarantee when identifier field is set that the message priority that Section Point sends is lower than the message priority that first node sends; 104, initialization the 3rd node, and identifier field, controlling filed and the data fields of the 3rd node be set, will guarantee when identifier field is set that the message priority of the 3rd node transmission and the message that Section Point sends have equal priority, and the 3rd node is provided with the data fields of Section Point different; 105, press the startup transmission button B of first node, make first node send the message of high priority continuously, make bus be in the state of " doing "; 106, press the startup transmission button C of Section Point, make Section Point begin to send message; 107, press the startup transmission button C of the 3rd node 3, make the 3rd node begin to send message; That 108, presses first node stops to send button A, when first node detect stop to send button A and press after, whether detection messages sends and finishes again, does not finish if message sends, and then continues to detect; If message is sent completely, then stop to send the testbus level immediately; 109, first node send first display unit to show the detected mac frame of erroneous frame that comprises.The initialization content of first node, Section Point and the 3rd node comprises by the initialization of keyboard to the display unit of the initialization of each register of CAN controller and needs.
Operation principle: make bus be in the state of " doing " by first node, created the condition that makes the message competition bus that different nodes send here.Then, send the identical and all low message of priority by Section Point, the 3rd node than first node priority, after first node stops to send, Section Point, the 3rd node be competition bus simultaneously, because first node has identical identifier field and different data fields with the message that the 3rd node sends, and will produce mistake like this.After first node detected " stopping " and sends button and press, whether detection messages sent and finishes, if do not finish, then continues to detect; If finish, then stop to send the testbus level immediately, when detecting continuous 11 " 1 ", detecting unit stops to detect, and send first display unit to show the detected mac frame of erroneous frame that comprises.
The invention effect: the present invention has provided the generation of a kind of CAN erroneous frame and detection system and method thereof, can be used for CAN bus education experiment and training, made things convenient for the research of core contents such as erroneous frame to the CAN bus, type of error, thereby can study and study CAN further in depth, establish theoretical foundation for using the CAN bus better.The present invention has not only created the condition that erroneous frame produces, the detection and the demonstration of erroneous frame have also been realized simultaneously, method/step of the present invention is concrete, clear and definite, be of universal significance, and helps deep grasp, understands erroneous frame, type of error and the correlation technique content thereof of CAN bus.In industry spot, can articulate a plurality of nodes on the general bus, there is a large amount of messages on bus, to transmit, therefore the very possible mistake that produces, based on system and method for the present invention, just can provide fundamental basis in industrial application, thereby reduce wrong appearance, and can do relevant detection and processing making a mistake for the CAN bus.
Description of drawings
Fig. 1 is a system construction drawing of the present invention; Fig. 2 is the realization flow figure of method of the present invention; Fig. 3 is the structural representation of the detecting unit 1-1 of first node 1 of the present invention.
Embodiment
Embodiment one: specify present embodiment below in conjunction with Fig. 1.The CAN erroneous frame of this embodiment produces with detection system to be made up of CAN bus 4, first node 1, Section Point 2 and the 3rd node 3, is mounted with first node 1, Section Point 2 and the 3rd node 3 on CAN bus 4; Described first node 1 by first processor 1-6, detecting unit 1-1, the first communication unit 1-3, the first display unit 1-4, the first keyboard 1-2, stop to send button A 1-7 and start to send button B 1-5 and form; The bus communication end of first processor 1-6 connects the node communication end of the first communication unit 1-3, and the bus communication end of the first communication unit 1-3 links to each other with CAN bus 4; Detecting unit 1-1 gathers the digital signal on the CAN bus 4, the data output end of detecting unit 1-1 connects the data input pin of first processor 1-6, the data output end of the first keyboard 1-2 connects the control input end of first processor 1-6, the state shows signal output of first processor 1-6 connects the input of the first display unit 1-4, the control signal output ends that stops to send button A 1-7 connects the stop signal receiving terminal of first processor 1-6, starts the enabling signal receiving terminal that the control signal output ends that sends button B 1-5 connects first processor 1-6; Described Section Point 2 is identical with the structure of the 3rd node 3; Described Section Point 2, the 3rd node 3 is by the second processor 2-1, the second display unit 2-4, second communication unit 2-3, the second keyboard 2-2 and startup send button C 2-5 and form, the data output end of the second keyboard 2-2 connects the control input end of the second processor 2-1, the bus communication end of the second processor 2-1 connects the node communication end of second communication unit 2-3, the bus communication end of second communication unit 2-3 links to each other with CAN bus 4, the node state shows signal output of the second processor 2-1 connects the input of the second display unit 2-4, starts the enabling signal receiving terminal that the control signal output ends that sends button C 2-5 connects the second processor 2-1.Communication unit inside has CAN bus driver controller and bus is joined; Detecting unit 1-1 gathers the digital signal on the CAN bus 4, obtain " 0 " or " 1 " signal on the CAN bus by comparison circuit and given reference voltage, be used for the CAN bus level is detected, also can detect CAN bus MAC (media interviews control) frame.It is little process chip of 8051 series, 8096 series, C8051F series that first processor 1-6 can adopt element; The first display unit 1-4 adopts 12864-2W; The first keyboard 1-2 adopts OMRON; Stop to send button A1-7 and adopt OMRON; Start and send button B 1-5 employing OMRON; The first communication unit 1-3 adopts SJA1000,82C250,6N137 etc.The correlation unit of other nodes is identical with first node 1.Processor in each node can be used for obtaining the needed message information of each node, control the various piece of each node according to the certain time sequence operate as normal; The keyboard of each node is used for the processor input control information to each node.
Embodiment two: specify present embodiment below in conjunction with Fig. 1 and Fig. 3.As shown in Figure 3, detecting unit 1-1 is by first resistance R 1, second resistance R 2, the 3rd resistance R 3, the 4th resistance R 4, DC power supply V1 forms, one end ground connection of second resistance R 2, the other end of second resistance R 2 connects the inverting input CP-of the inside comparing unit of end of first resistance R 1 and first processor 1-6, the other end of first resistance R 1 connects the output of DC power supply V1, one end of the 3rd resistance R 3 connects CAN bus 4, the other end of the 3rd resistance R 3 connects the in-phase input end CP+ of the inside comparing unit of end of the 4th resistance R 4 and first processor 1-6, the other end ground connection of the 4th resistance R 4.Detecting unit 1-1 gathers the digital signal on the CAN bus, obtain " 0 " or " 1 " signal on the CAN bus by comparison circuit and given reference voltage, be used for the CAN bus level is detected, also can detect CAN bus MAC (media interviews control) frame.Other compositions are identical with embodiment one with annexation.
Embodiment three: specify present embodiment below in conjunction with Fig. 2.Generation is carried out successively according to the following steps with detection method based on the CAN erroneous frame on the basis of embodiment one: 101, start detection system, and preparation powers on; 102, the initialization first node 1, and identifier field, controlling filed and the data fields of first node 1 are set, and the initialization content of first node 1 comprises by the first keyboard 1-2 the initialization of each register of CAN controller and the initialization of the first display unit 1-4; 103, the initialization Section Point 2, and identifier field, controlling filed and the data fields of Section Point 2 be set, promptly the second keyboard 2-2 that passes through Section Point 2 will guarantee when identifier field is set that to each initialization of register of CAN controller the message priority of Section Point 2 transmissions is lower than the message priority that first node 1 sends; 104, initialization the 3rd node 3, and identifier field, controlling filed and the data fields of the 3rd node 3 be set, promptly the second keyboard 2-2 keyboard of the 3rd node 3 is to each initialization of register of CAN controller, will guarantee when identifier field is set that the message priority of the 3rd node 3 transmissions and the message that Section Point 2 sends have equal priority, and the 3rd node 3 is provided with the data fields of Section Point 2 different; 105, press the startup transmission button B of first node 1, make first node 1 send the message of high priority continuously, make bus be in the state of " doing "; 106, press the startup transmission button C of Section Point 2, make Section Point 2 begin to send message; 107, press the startup transmission button C of the 3rd node 3, make the 3rd node 3 begin to send message; That 108, presses first node 1 stops to send button A, when first node 1 detect stop to send button A and press after, whether detection messages sends and finishes again, does not finish if message sends, and then continues to detect; If message is sent completely, then stop to send the testbus level immediately; 109, first node 1 send the first display unit 1-4 to show the detected mac frame of erroneous frame that comprises.When carrying out step 109, can work as and stop when detecting unit detects continuous 11 " 1 " detecting.

Claims (2)

1, a kind of CAN erroneous frame produces and detection system, it is characterized in that described detection system is made up of CAN bus (4), first node (1), Section Point (2) and the 3rd node (3), on CAN bus (4), be mounted with first node (1), Section Point (2) and the 3rd node (3); Described first node (1) by first processor (1-6), detecting unit (1-1), first communication unit (1-3), first display unit (1-4), first keyboard (1-2), stop to send button A (1-7) and start to send button B (1-5) and form; The bus communication end of first processor (1-6) connects the node communication end of first communication unit (1-3), and the bus communication end of first communication unit (1-3) links to each other with CAN bus (4); Detecting unit (1-1) is gathered the digital signal on the CAN bus (4), the data output end of detecting unit (1-1) connects the data input pin of first processor (1-6), the data output end of first keyboard (1-2) connects the control input end of first processor (1-6), the state shows signal output of first processor (1-6) connects the input of first display unit (1-4), the control signal output ends that stops to send button A (1-7) connects the stop signal receiving terminal of first processor (1-6), starts the enabling signal receiving terminal that the control signal output ends that sends button B (1-5) connects first processor (1-6); Described Section Point (2) is identical with the structure of the 3rd node (3); Described Section Point (2), the 3rd node (3) is by second processor (2-1), second display unit (2-4), second communication unit (2-3), second keyboard (2-2) and startup send button C (2-5) and form, the data output end of second keyboard (2-2) connects the control input end of second processor (2-1), the bus communication end of second processor (2-1) connects the node communication end of second communication unit (2-3), the bus communication end of second communication unit (2-3) links to each other with CAN bus (4), the node state shows signal output of second processor (2-1) connects the input of second display unit (2-4), starts the enabling signal receiving terminal that the control signal output ends that sends button C (2-5) connects second processor (2-1); Described CAN erroneous frame produces with detection system carries out according to the following steps:
101, start detection system, preparation powers on;
102, initialization first node (1), and identifier field, controlling filed and the data fields of first node (1) are set;
103, initialization Section Point (2), and identifier field, controlling filed and the data fields of Section Point (2) are set will guarantee when identifier field is set that the message priority that Section Point sends is lower than the message priority that first node sends;
104, initialization the 3rd node (3), and identifier field, controlling filed and the data fields of the 3rd node (3) be set, will guarantee when identifier field is set that the message priority of the 3rd node (3) transmission and the message that Section Point (2) sends have equal priority, and the 3rd node is provided with the data fields of Section Point different;
105, press the startup transmission button B of first node (1), make first node (1) send the message of high priority continuously, make bus be in the state of " doing ";
106, press the startup transmission button C of Section Point (2), make Section Point (2) begin to send message;
107, press the startup transmission button C of the 3rd node (3), make the 3rd node (3) begin to send message;
That 108, presses first node (1) stops to send button A, when first node (1) detect stop to send button A and press after, whether detection messages sends and finishes again, does not finish if message sends, and then continues to detect; If message is sent completely, then stop to send the testbus level immediately;
109, first node (1) send first display unit (1-4) to show the detected mac frame of erroneous frame that comprises.
2, a kind of CAN erroneous frame according to claim 1 produces and detection system, it is characterized in that described detecting unit (1-1) is by first resistance (R1), second resistance (R2), the 3rd resistance (R3), the 4th resistance (R4), DC power supply (V1) is formed, one end ground connection of second resistance (R2), the other end of second resistance (R2) connects the inverting input (CP-) of the inside comparing unit of end of first resistance (R1) and first processor (1-6), the other end of first resistance (R1) connects the output of DC power supply (V1), one end of the 3rd resistance (R3) connects CAN bus (4), the other end of the 3rd resistance (R3) connects the in-phase input end (CP+) of the inside comparing unit of end of the 4th resistance (R4) and first processor (1-6), the other end ground connection of the 4th resistance (R4).
CNB2006100104237A 2006-08-22 2006-08-22 CAN wrong frame generating and detecting system and its method Expired - Fee Related CN100428701C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNB2006100104237A CN100428701C (en) 2006-08-22 2006-08-22 CAN wrong frame generating and detecting system and its method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNB2006100104237A CN100428701C (en) 2006-08-22 2006-08-22 CAN wrong frame generating and detecting system and its method

Publications (2)

Publication Number Publication Date
CN1909484A CN1909484A (en) 2007-02-07
CN100428701C true CN100428701C (en) 2008-10-22

Family

ID=37700479

Family Applications (1)

Application Number Title Priority Date Filing Date
CNB2006100104237A Expired - Fee Related CN100428701C (en) 2006-08-22 2006-08-22 CAN wrong frame generating and detecting system and its method

Country Status (1)

Country Link
CN (1) CN100428701C (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101051881B (en) * 2007-05-15 2010-05-26 哈尔滨工业大学 Method capable of producing Modbus CRC error and comparing and displaying error
CN101610142B (en) * 2009-06-30 2013-03-27 奇瑞汽车股份有限公司 Detection method of CAN of hybrid motor vehicle
CN101783759B (en) * 2010-01-19 2012-02-01 浙江吉利汽车研究院有限公司 Bus error recovery processing method
CN110696746B (en) * 2014-05-08 2023-03-24 松下电器(美国)知识产权公司 Abnormal handling method, vehicle-mounted network system and electronic control unit
CN111665821B (en) * 2020-06-08 2022-06-07 重庆长安汽车股份有限公司 Error frame checking method based on vehicle diagnosis service

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1061862A (en) * 1990-11-28 1992-06-10 株式会社日立制作所 Field bus system and virtual field device
EP1383368A2 (en) * 2002-07-19 2004-01-21 Weidmüller Interface GmbH & Co. Modul for electronic device, especially field bus modul
CN1629813A (en) * 2003-12-15 2005-06-22 上海电器科学研究所(集团)有限公司 Field bus communication failure recording device

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1061862A (en) * 1990-11-28 1992-06-10 株式会社日立制作所 Field bus system and virtual field device
EP1383368A2 (en) * 2002-07-19 2004-01-21 Weidmüller Interface GmbH & Co. Modul for electronic device, especially field bus modul
CN1629813A (en) * 2003-12-15 2005-06-22 上海电器科学研究所(集团)有限公司 Field bus communication failure recording device

Also Published As

Publication number Publication date
CN1909484A (en) 2007-02-07

Similar Documents

Publication Publication Date Title
CN100428701C (en) CAN wrong frame generating and detecting system and its method
CN100420228C (en) Transmitting and receiving display system for CAN message of different priorities and its detecting method
CN101309236A (en) Multi-protocol data integration control communication gateway and working method thereof
CN101630158B (en) Industrial control system and serial communication method thereof
CN101051881B (en) Method capable of producing Modbus CRC error and comparing and displaying error
CN201555656U (en) Dynamic number weighting converter
CN100454877C (en) CAN message priority generation and detection system and its method
CN201226531Y (en) Multi-protocol data integration control telecommunication gateway
CN201054609Y (en) High-speed industrial real time communication bus system based on optical fiber
CN106448117A (en) Electronic information wireless communication system
CN100463421C (en) Device and method of detection and display of CAN error frame
CN201222744Y (en) On-site bus isolation transmission equipment
CN108089952B (en) Automatic change test equipment
CN202535392U (en) Protocol conversion device
CN108391245A (en) Plug and play type wireless sensor network node
CN205139637U (en) Multi -functional energy consumption data acquisition controller based on MBUS
CN207264051U (en) A kind of LCD screen ageing management system
CN207304023U (en) A kind of photovoltaic DC-to-AC converter based on high speed Ethernet industrial bus
CN100407680C (en) System and method for confirming CAN node message transmission waiting condition and waiting time
CN103425617A (en) Device utilizing RS232 interfaces to realize one-to-many data transmission and data transmission method of device
YunxiaJiang et al. Design and implementation of CAN-bus experimental system
CN103929457A (en) Internet of things application data interaction system and method based on mobile internet
CN203325203U (en) Infrared remote controller module, and intelligent terminal and remote control device with same
CN202711046U (en) Singlechip remote data acquisition system
CN106484597A (en) A kind of intelligent substation SCD file and the consistency detecting method of empty terminal list file

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
C17 Cessation of patent right
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20081022

Termination date: 20100822