Handhold portable CANOPEN network data analyzer and control method thereofTechnical field
The present invention relates to network system uses.
Background technology
CAN standard network bus is a kind of network system that can be used for railway territory, because its reliability, flexibility and adopted by more and more countries in the world.
The CAN network has only defined physical layer and link layer, present widely used CANOPEN standard definition the application layer protocol of CAN network, but because the CANOPEN network is professional very strong, and present means of testing and tester are also seldom, especially are suitable for the on-the-spot portable CANOPEN analytical equipment of using blank out especially.
The locomotive of this patent design just is being based on network system---the DAF of CAN standard network bus of railway territory with handhold portable CANOPEN network data analyzer.Be applicable in the locomotive with CAN bus network.
Summary of the invention
In view of existing problem in the above-mentioned prior art, the objective of the invention is research and design a kind of novel handhold portable CANOPEN network data analyzer and control method thereof, thus solve the present means of testing of CANOPEN network and tester also seldom problem filled up the blank of the portable CANOPEN analytical equipment of on-the-spot use.Handhold portable CANOPEN network data analyzer of the present invention is made up of main controller module, CAN signal gathering unit, data indicative control unit and power supply unit.Described CAN signal gathering unit is connected to bus cable by two bus termination CANH and the CANL with differential transmission and receiving function, and CAN transceiver interface CANRX, the CANTX built-in by special purpose interface TXD, RXD and main controller module link to each other; Described main controller module links to each other with the CAN signal gathering unit with the CANTX pin by CANRX, link to each other with the Data Input Interface D0-D7 of data indicative control unit by the D01-D08 data wire, switch controlling signal S1-S5 links to each other with the display screen control pin S1-S5 of data indicative control unit; Described power supply unit produces+and 5V voltage delivers to the VCC pin of CAN signal gathering unit and data indicative control unit, the 3.3V voltage that produces is delivered to the power pins of main controller module, the reference ground output GND of power supply unit then links to each other with all GND signals in the plate, constitutes the loop with positive voltage; The signal that transmits on the CAN bus is input to main controller module by the CAN signal interface unit, and data are resolved in main controller module, handle, stored, and the form with 8 parallel port data sends to the data indicative control unit at last.Main controller module of the present invention by AT91SAM7A3 constitute, the CAN signal gathering unit is made of PCA82C250, power supply unit comprises power conversion chip AS1117M3-3.3 and MIC5207, and isolating chip BO505T; Described data indicative control unit comprises LCM12864ZK type LCDs and LCDs supervisory keyboard.
A kind of handhold portable CANOPEN network data analyzer of the present invention and control method thereof, its control procedure comprise system initialization and the initialized step of CAN mailbox, it is characterized in that also comprising the steps:
A, CANOPEN parameter configuration;
B, whether main controller module received the CAN data judge, and in following step, select:
C, do not receive the CAN signal, return initialization;
D, receive the CAN signal, then it is handled;
E, data processing;
F, send data and retrieval system initialization to data indicative control unit module.
CAN, full name are " Controller Area Network ", i.e. controller local area network is one of most widely used fieldbus in the world.CAN can provide the message transmission rate up to 1Mbit/s, and this makes real-time control become very easy.In addition, the mistake of hardware calibrating characteristic has also strengthened the anti-electromagnetic interference capability of CAN.
CAN is a kind of serial communication bus of many master modes, and basic design specification requires that high bit rate is arranged, high anti-electromagnetic interference, and can detect any mistake of generation.When signal transmission distance reached 10Km, CAN still can provide the message transmission rate up to 50Kbit/s.Because the CAN bus has very high real-time performance, therefore, CAN has obtained extensive use in fields such as auto industry, aircraft industry, Industry Control, security protection.
The CAN communications protocol is mainly described the mode of intelligence transmission between the equipment.The definition of CAN layer is consistent with Open Systems Interconnect, has defined the bottom two-layer of model: physical layer and data link layer.
The CANopen agreement is one of standard of CAN-in-Automation (CiA) definition.It is the application layer protocol of CAN.Most of important device types, for example the numeral and the simulation input/output module, driving arrangement, operating equipment, controller, Programmable Logic Controller or encoder all are described in the agreement that is called " subset of devices ".Subset of devices has defined dissimilar standard devices and function corresponding thereof.Rely on the support of CANopen protocol suite, can the equipment of different vendor be configured and system reconfiguration by bus.
Handhold portable CANOPEN network data analyzer of the present invention just is being based on CAN standard network bus and is using.This data analyzer is at problem set forth above, can carry out analytic record to the CANOPEN data, just can finish data analysis work as long as equipment inserted in the CAN standard network, easy for installation, simple to operate, using reliably, is the new product that arises at the historic moment under the overall situation of Train Control networking.
Because the CAN network technology is the industry spot network technology that many in the world major companies adopt, the scope of application is extensive further, and the analysis of network data is to an important job in train debugging, maintenance, the maintenance, therefore not only comply with development trend but also have very strong practicality based on the locomotive of CAN network with handhold portable CANOPEN network data analyzer, filled up this instrument design blank at home.
The purpose of this invention is to provide a kind of CANOPEN interface based on the CAN network system.Handhold portable CANOPEN network data analyzer of the present invention and control method thereof, whole system comprises hardware and software two parts.
The effect of hardware mainly provides physical connection, is responsible for the work of control CAN transceiver, reads CAN bus related data, the data demonstration of liquid crystal display screen is provided and finishes controlled function, also will be responsible for providing of working power etc. simultaneously.
The effect of software is to the control module initialization, disposes various related datas, requires the CAN data to be handled in main control module, stored and data are sent into indicative control unit according to The field.
Description of drawings
The present invention has seven width of cloth accompanying drawings, wherein:
Fig. 1 is a structured flowchart of the present invention;
Fig. 2 is a circuit structure diagram of the present invention;
Fig. 3 is a main controller module circuit diagram of the present invention;
Fig. 4 is a CAN signal gathering unit circuit diagram of the present invention;
Fig. 5 is a data indicative control unit circuit diagram of the present invention;
Fig. 6 is a power supply unit circuit diagram of the present invention;
Fig. 7 is a software control flow chart of the present invention.
Among the figure: 1, CANsignal gathering unit 2,main controller module 3, dataindicative control unit 4, power supply unit.
Embodiment
Specific embodiments of the invention as shown in drawings, accompanyingdrawing 1 is depicted as structured flowchart of the present invention, is made up of CANsignal gathering unit 1,main controller module 2, dataindicative control unit 3,power supply unit 4 four parts.Accompanyingdrawing 2 is a circuit structure diagram of the present invention, handhold portable CANOPEN network data analyzer of the present invention, 6,7 pins by CANsignal gathering unit 1 receive the CAN signal, after level conversion, be sent tomain controller module 2 by 57,58 pin, after the processing and conversion ofmain controller module 2, link to each other with the 9-16 pin of dataindicative control unit 3 by 34-37,41-44 pin, send data message, 21-24,32 pin link to each other as the S1-S5 of operating key line with dataindicative control unit 3.
Because the CAN controller of processor inside is a protocol controller just, can not provide physical layer to drive, so also need add the CAN bus transceiver in use, CAN bus transceiver commonly used has the PCA82C250 transceiver of Philips company, high speed TJA1050 transceiver etc.Used herein is the PCA82C250 transceiver, and it can improve the differential transmission and the receiving ability of bus.It and ISO11898 standard are compatible fully, and three kinds of different working methods are arranged, and promptly high speed, slope control and standby can be selected according to actual conditions.
Protocol controller is connected to transceiver by serial data output line TX and serial data incoming line RX.Be connected to bus cable (seeing accompanying drawing 4) by two bus termination CANH and the CANL that differential transmission and receiving function are arranged.Input Rs is used for pattern control reference voltage.The output voltage of output VREF is 0.5 times of specified VCC, and wherein the rated supply voltage of transceiver is 5V.The transmission data of a serial of protocol controller output flow to the TxD pin of transceiver.Draw function that logic high is arranged in the TxD input on inner, that is to say that bus output driver acquiescence is passive in recessive state, CANH and CANL input are the receiver fan-in networks of 17k by the typical internal impedance, be biased to the rated voltage of 2.5V, in addition, if TxD is a logic low, the output stage of bus will be activated, and produce the signal level of a dominance on bus cable.Output driver is made up of a source output stage and a drop-down output stage.CANH is connected to the source output stage, and CANL is connected to drop-down output stage.In dominance condition, the rated voltage of CAN_H is 3.5V, and CAN_L is 1.5V.
Accompanying drawing 3 is the circuit diagram ofmain controller module 2 of the present invention, and themain controller module 2 that AT91SAM7A3 constitutes is cores of entire equipment, has finished the function control of data analysis.AT91SAM7A3 is 32 a member in the ARM7 Series of MCU, is integrated with the CAN controller.256K byte high speed Flash and 32K byte SRAM and a complete set of ancillary equipment are arranged on the sheet, comprise two 2.0B CAN controllers, and a whole set of makes the functional unit of peripheral device component minimum number.The Flash memory can have programming in the JTAG-ICE interface system in the sheet in this microprocessor.Built-in locking bit can be protected firmware, prevents that it from being covered by mistake.The Flash module is totally 1024 pages in the sheet of AT91SAM7A3, every page 256 byte.Have 65536 32 words altogether.The Flash module comprises the buffer memory of writing of one 256 byte, can be by 32 interface accessing.(read or write visit) when Flash does not use, it will enter standby automatically.Inner CAN controling appliance has following characteristics:
● complete compatible CAN2.0B dynamic controller;
● Bit Transmission Rate is 1Mbit/s;
● have 16 OO mailboxes, CAN2.0A and 2.0B are able to programme concerning each message; Configurable object is for receiving or sending; When sending or receive message, use 16 bit time labels; Can programme to the reception buffer storage length of a plurality of mailbox objects.
Accompanyingdrawing 5 is the circuit diagram of dataindicative control unit 3 of the present invention, and the font ROM of the LCM12864ZK type LCDs of dataindicative control unit 3 inside includes the letter character font of character type and 128 16*8 half-breadths in 8192 16*16 points; Power operation wide ranges (2.7V to5.5V), low power dissipation design can satisfy the power saving requirement of product; Simultaneously with the connection interface of micro controller such as single-chip microcomputer (three kinds of patterns: parallel 8/4, serial 3 lines/2 lines) flexibly.On piece has/down/left side/order that moves right current display screen and clear screen.
Accompanying drawing 6 is circuit diagrams ofpower supply unit 4, comprises the power supply chip and the protective circuit of several grades, is responsible for the power supply of whole system.The electric pressure that produces comprise isolation+5V voltage ,+3.3V voltage and+2.5V voltage.
Accompanyingdrawing 7 is a software control flow chart of the present invention.