CN103414620A - Double-channel CAN simulation system based on CAN buses - Google Patents

Double-channel CAN simulation system based on CAN buses Download PDF

Info

Publication number
CN103414620A
CN103414620A CN2013103547665A CN201310354766A CN103414620A CN 103414620 A CN103414620 A CN 103414620A CN 2013103547665 A CN2013103547665 A CN 2013103547665A CN 201310354766 A CN201310354766 A CN 201310354766A CN 103414620 A CN103414620 A CN 103414620A
Authority
CN
China
Prior art keywords
bus
node
microcontroller
usb
way
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.)
Pending
Application number
CN2013103547665A
Other languages
Chinese (zh)
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.)
SHANGHAI GUTAI TECHNOLOGY Co Ltd
Original Assignee
SHANGHAI GUTAI TECHNOLOGY 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 SHANGHAI GUTAI TECHNOLOGY Co Ltd filed Critical SHANGHAI GUTAI TECHNOLOGY Co Ltd
Priority to CN2013103547665A priority Critical patent/CN103414620A/en
Publication of CN103414620A publication Critical patent/CN103414620A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Information Transfer Systems (AREA)

Abstract

The invention relates to a double-channel CAN simulation system based on CAN buses. The double-channel CAN simulation system based on the CAN buses comprises a microcontroller, two CAN controllers and a USB module. The microcontroller is connected with the two CAN controllers, each CAN controller is connected to each CAN bus through a CAN transceiver, and each CAN transceiver can be replaced with a high-speed CAN, a low-speed CAN and a single-line CAN in a pluggable mode. Data transmission is carried out between the microcontroller and a PC machine through a USB bus, so CAN message transceiving based on the PC can be achieved. A simulation kernel operates on the PC and can simulate multiple CAN buses at the same time, a user can edit a code for a simulation CAN node on each virtual CAN bus, and thus each virtual CAN node can be communicated with a node on each real CAN bus connected with the virtual CAN node.

Description

A kind of analogue system of two-way CAN based on the CAN bus
Technical field
The present invention relates to a kind of electronic equipment, particularly a kind of analogue system based on the CAN bus.
Background technology
The CAN bus, as the communication interface between each microcontroller, has a wide range of applications in automobile and industry; In the development process of CAN bus, in order to verify the function of certain node, usually need to be by bus, mutual other nodes that do not have of node are by computer virtual out therewith, and communicate by letter together with real network, thereby to the properties of the tested node of abundant checking, and the performance of whole network.
Common way is to use USB to turn the interface card of CAN, and CAN bus and computer are coupled together, and on host computer, by USB interface, controls slave computer sending and receiving message, carries out emulation with the node on bus.The problem that such analogue system exists is: 1, a general system is only supported a CAN bus, supports bad to gateway and multichannel CAN bus; 2,, because transceiver is fixed, can not support simultaneously high-speed CAN, low speed CAN and single line CAN.
Summary of the invention
Purpose of the present invention, exactly in order to overcome multichannel CAN bus support issue and the scaling concern in CAN Bus simulator process, used the hardware of supporting two-way CAN, the method support that can replace by plug of the transceiver of each CAN interface simultaneously: high-speed CAN, low speed CAN and single line CAN.
Concrete technical scheme provided by the invention is as follows:
A kind of analogue system of two-way CAN based on the CAN bus, use microcontroller to be connected with two CAN controllers, each CAN controller is connected to respectively on the CAN bus, each CAN transceiver can replace with high-speed CAN, low speed CAN and single line CAN by pluggable mode, thereby microcontroller carries out by usb bus and PC the transmitting-receiving that transfer of data realizes the CAN message, on PC, carry out emulation, make each virtual emulation CAN node of PC that factum be arranged.
A kind of analogue system of two-way CAN based on the CAN bus, comprise hardware circuit, program of lower computer and host computer procedure.
A kind of analogue system of two-way CAN based on the CAN bus, described hardware circuit is comprised of microcontroller, two CAN controllers, USB modules; Microcontroller is connected with two CAN controllers, and each CAN controller connects a CAN transceiver, and each CAN transceiver all is connected to one independently on the CAN bus.
A kind of analogue system of two-way CAN based on the CAN bus, described CAN controller is after listening to CAN message or erroneous frame on bus, by the data feedback monitored to microcontroller, microcontroller reads in local message reception buffer zone by it, and the data in reception buffer zone are uploaded to PC by the USB module.
A kind of analogue system of two-way CAN based on the CAN bus, after described USB module receives the order of host computer, be configured microcontroller, comprises configuration of CAN bus parameter etc.
A kind of analogue system of two-way CAN based on the CAN bus, the dummy node in described host computer procedure artificial network, and by the USB driver, will need the message sent to pass to slave computer to send; By the USB driver, the message that slave computer receives is read and passes to dummy node simultaneously.
A kind of analogue system of two-way CAN based on the CAN bus, its advantage be, 1, reasonable in design, and clear in structure, can virtual any node, and node and node are complete independence, are independent of each other; 2, can support simultaneously two CAN buses to carry out while emulation, the gateway support function; 3 ,Mei road CAN buses are all supported high-speed CAN, low speed CAN and single line CAN.
The accompanying drawing explanation
Fig. 1 is total Organization Chart that in the invention process method, upper and lower computer connects
Fig. 2 is the actuating logic of hardware circuit in the invention process method
Fig. 3 is analogue system actuating logic in the invention process method
In Fig. 1, microcontroller (101), CAN controller (102), CAN transceiver block (103), CAN bus CANH(104), CAN bus CANL(105), USB module (106), PC (109), lower computer hardware circuit (110), USB line (111), power module (112), passage 1 sends indicator light (113), passage 1 codan lamp (114), the wrong indicator light of passage 1 (115), passage 2 sends indicator light (116), passage 2 codan lamps (117), the wrong indicator light of passage 2 (118), high-speed CAN transceiver daughter board (119), low speed CAN transceiver daughter board (120), single line CAN transceiver daughter board (121)
In Fig. 2, CAN controller reception buffer zone (201), the CAN controller sends buffering area (202), local CAN sends buffering area (203), local CAN reception buffer zone (204), testing engine (205), message USB sends buffering area (208), message USB reception buffer zone (209), computer CPU (211), CAN Bus simulator application program (212)
In Fig. 3, USB driver (301), USB reception buffer zone (302), USB sends buffering area (303), CAN Bus simulator program (304)
Embodiment
In Fig. 1, lower computer hardware circuit (110) comprises microcontroller (101), USB module (106) and CAN transceiver block (103), lower computer hardware circuit (110) is connected to PC (109) by USB cable (111), simultaneously by CAN bus CANH(104) and CANL(105) be connected to other nodes (112) on bus.
Microcontroller (101) connects at least one CAN controller (102), the TX pin of each CAN controller and RX pin are connected respectively TX pin and the RX pin of CAN transceiver block (103), the CANH of CAN transceiver is connected to CAN bus CANH(104), the CANL of CAN transceiver is connected to the CANL(105 of CAN bus).
Microcontroller (101), inner integrated CPU and internal memory, be connected with one or more independently CAN controllers; Or inner integrated one or more CAN controllers; What Fig. 1 showed is the situation of the inner integrated CAN controller of microcontroller (102).
CAN controller (102), as the protocol conversion chip of CAN bus, be responsible for the information such as the message on the CAN bus and erroneous frame are fed back to microcontroller, and each CAN controller has TX and the RX pin be connected with the CAN transceiver.
In Fig. 2, lower computer hardware circuit (110) is connected to PC (109) by USB cable (111), PC (109) comprises at least one central processing unit (211), PC (109) internal operation automated server application program (212) and at least one Automation Client application program (213).
Lower computer hardware circuit (110) is by connecting CAN bus CANH(104) and CAN bus CANL(105) communicate with other nodes.
The flow process that lower computer hardware circuit (110) receives from the message of CAN bus is, after the transceiver that its CAN controller (102) connects by CAN transceiver block (103) listens to the CAN message, by its buffer memory to inner CAN reception buffer zone (201), and notice microcontroller (101), microcontroller (101) is saved in message USB reception buffer zone (209) by the message that calls receiver function (204) and will receive, by USB module (106) by these data upload to PC (109).
The transmission flow of lower computer hardware circuit (110) is, slave computer microcontroller (101) sends buffering area (208) and reads the message data that will send from USB module (106) from message USB, by sending function (203), needs are sent to message on bus put into the CAN of CAN controller (102) and send buffering area again, via CAN controller (102), send to the CANH(104 of CAN bus by the transceiver of CAN transceiver block (103) connection) and CANL(105) on.
In Fig. 3, the CAN Bus simulator program (304) of host computer internal operation is connected to USB cable (111) by USB driver (301), thereby and sets up usb communication between lower computer hardware circuit (110).
Simulation flow in Fig. 3 is, the virtual two CAN buses of CAN Bus simulator program (304), and fictionalize the node that needs emulation on each virtual bus, USB transmission buffering area (303) is all put in sending request of the node of emulation, and be issued in lower computer hardware circuit (110) by USB driver (301), which by the virtual CAN network at simulation node place and the objective network of simulation node transmission, determine to send on the true CAN bus of root of slave computer; After when USB driver (301), having received the CAN message data of monitoring from slave computer, these data are deposited in USB reception buffer zone (302), CAN Bus simulator program (304) reads these data and sends it to each simulation node.

Claims (8)

1. analogue system of the two-way CAN based on the CAN bus, it is by microcontroller, two CAN controllers and USB module form, it is characterized in that, microcontroller is connected with two CAN controllers, each CAN controller is connected to the CAN bus by the CAN transceiver respectively, each CAN transceiver can replace with high-speed CAN by pluggable mode, low speed CAN and single line CAN, thereby microcontroller carries out transfer of data by usb bus and PC realizes the CAN packet sending and receiving based on PC, on PC, move simulation kernel, simulation kernel is virtual many CAN buses simultaneously, the user can write code for the emulation CAN node on every virtual CAN bus, thereby make each virtual CAN node can with coupled real CAN bus on node communicate.
2. a kind of analogue system of two-way CAN based on the CAN bus according to claim 1, is characterized in that, system comprises hardware circuit, program of lower computer and host computer procedure.
3. a kind of analogue system of two-way CAN based on the CAN bus according to claim 2, is characterized in that, described hardware circuit is comprised of microcontroller, two CAN controllers, USB modules; Microcontroller is connected with two CAN controllers, and each CAN controller connects a CAN transceiver, and each CAN transceiver all is connected to one independently on the CAN bus.
4. a kind of analogue system of two-way CAN based on the CAN bus according to claim 3, it is characterized in that, described CAN controller is after listening to CAN message or erroneous frame on bus, by the data feedback monitored to microcontroller, microcontroller reads in local message reception buffer zone by it, and the data in reception buffer zone are uploaded to PC by the USB module.
5. a kind of analogue system of two-way CAN based on the CAN bus according to claim 4, is characterized in that, after described USB module receives the order of host computer, microcontroller is configured, and comprises configuration of CAN bus parameter etc.
6. a kind of analogue system of two-way CAN based on the CAN bus according to claim 2, the dummy node in described host computer procedure artificial network, and by the USB driver, will need the message sent to pass to slave computer to send; By the USB driver, the message that slave computer receives is read and passes to dummy node simultaneously.
7. a kind of analogue system of two-way CAN based on the CAN bus according to claim 6, is characterized in that, described each emulation CAN node has relevant code to write interface, by compiling, obtains executable code, and calls execution via simulation engine.
8. a kind of analogue system of two-way CAN based on the CAN bus according to claim 7, it is characterized in that, described each emulation CAN node can receive the bus message of uploading by USB interface, logic by the corresponding executable code of each node is to determine the reaction of emulation CAN node for the CAN event on bus, the message that needs simulation node to send will be transferred to USB interface and be issued to the lower computer hardware circuit by simulation kernel, and be dealt on bus via the CAN module of slave computer.
CN2013103547665A 2013-08-15 2013-08-15 Double-channel CAN simulation system based on CAN buses Pending CN103414620A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2013103547665A CN103414620A (en) 2013-08-15 2013-08-15 Double-channel CAN simulation system based on CAN buses

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2013103547665A CN103414620A (en) 2013-08-15 2013-08-15 Double-channel CAN simulation system based on CAN buses

Publications (1)

Publication Number Publication Date
CN103414620A true CN103414620A (en) 2013-11-27

Family

ID=49607606

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2013103547665A Pending CN103414620A (en) 2013-08-15 2013-08-15 Double-channel CAN simulation system based on CAN buses

Country Status (1)

Country Link
CN (1) CN103414620A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106789449A (en) * 2017-02-22 2017-05-31 安徽优旦科技有限公司 A kind of CAN exploitation and method of testing and system
CN109660436A (en) * 2018-12-18 2019-04-19 广州亚美信息科技有限公司 A kind of double CAN channel data processing methods, gateway and system
CN110098989A (en) * 2018-01-30 2019-08-06 上海融聂电子科技有限公司 A kind of multichannel CAN analogue system and test method based on CANFD bus

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101639698A (en) * 2009-08-26 2010-02-03 意昂神州(北京)科技有限公司 Electrical test system and method of automotive body based on CAN bus
CN102306022A (en) * 2011-08-19 2012-01-04 中国农业大学 Automobile semi-physical simulation experimental system combining controller area network (CAN) bus and electronic control unit
WO2012089857A1 (en) * 2010-12-30 2012-07-05 Fundacion Tecnalia Research & Innovation System for testing and evaluating the behaviour and energy efficiency of the drive system of a hybrid-electric motor vehicle
CN102880171A (en) * 2012-10-15 2013-01-16 保定长安客车制造有限公司 Hardware-in-loop experimental system for an entire electric vehicle controller

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101639698A (en) * 2009-08-26 2010-02-03 意昂神州(北京)科技有限公司 Electrical test system and method of automotive body based on CAN bus
WO2012089857A1 (en) * 2010-12-30 2012-07-05 Fundacion Tecnalia Research & Innovation System for testing and evaluating the behaviour and energy efficiency of the drive system of a hybrid-electric motor vehicle
CN102306022A (en) * 2011-08-19 2012-01-04 中国农业大学 Automobile semi-physical simulation experimental system combining controller area network (CAN) bus and electronic control unit
CN102880171A (en) * 2012-10-15 2013-01-16 保定长安客车制造有限公司 Hardware-in-loop experimental system for an entire electric vehicle controller

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106789449A (en) * 2017-02-22 2017-05-31 安徽优旦科技有限公司 A kind of CAN exploitation and method of testing and system
CN110098989A (en) * 2018-01-30 2019-08-06 上海融聂电子科技有限公司 A kind of multichannel CAN analogue system and test method based on CANFD bus
CN109660436A (en) * 2018-12-18 2019-04-19 广州亚美信息科技有限公司 A kind of double CAN channel data processing methods, gateway and system
CN109660436B (en) * 2018-12-18 2021-08-06 广州亚美信息科技有限公司 Dual-CAN channel data processing method, gateway equipment and system

Similar Documents

Publication Publication Date Title
CN103428050A (en) Multipath CAN (controller area network) simulation system based on CAN bus
CN104348673B (en) A kind of method of commissioning, master control borad and business board
CN105159860A (en) Inter-integrated circuit (IIC) extended system and method
CN103616937A (en) Mainboard, PCIE network card and server system
CN100383544C (en) Method and apparatus for real-time monitoring level signal
CN105095037A (en) Wire card, backboard of wire card and wire card test method
CN105243044A (en) Serial port based management system and management method
CN103440187A (en) Hardware script-based automated CAN (Controller Area Network) bus test method
CN103067201B (en) A kind of multi-protocol communication manager
CN208386576U (en) A kind of industrial network exchange serial server with simple switched management function
CN102222056A (en) Electronic equipment with embedded system
CN103414620A (en) Double-channel CAN simulation system based on CAN buses
CN202975800U (en) CAN (controller area network) bus diagnosis system based on WIFI (wireless fidelity) and mobile intelligent terminal
CN105306352A (en) Industrial field bus protocol gateway device
CN205004841U (en) Intelligence substation equipment and data transmission system thereof
CN110098989A (en) A kind of multichannel CAN analogue system and test method based on CANFD bus
CN105100000B (en) Interface conversion device and network system
CN103414622A (en) Simulation method based on CAN buses
CN103425123A (en) Automated testing method for CAN (controller area network) bus based on software script
CN107563075B (en) Method for realizing CosiMate network and DDS network interconnection
CN103414618A (en) Multichannel FlexRay simulation system based on FlexRay buses
CN103428058A (en) Double-circuit FlexRay simulation system based on FlexRay bus
CN107769960B (en) BMC management architecture based on CAN bus
CN109802877A (en) A kind of CAN bus based Communication System Design
CN110096002A (en) A kind of automatization test system and test method based on CANFD bus

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
WD01 Invention patent application deemed withdrawn after publication
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20131127