Background technology
In the industrial automation field, (Controller Area Network CAN) is present several kinds of more common measurement and control networks for serial ports network (RS-232C/RS-485 (RS-422A)), controller local area network.These networks have been because separately advantage has obtained using widely, but this network exists the effective radius of communication little and be isolated to shortcoming such as Internet, far can not satisfy the needs of Long-distance Control.
Nowadays, along with the development of Internet technology, be the open network technology of representative with TCP/IP and Ethernet, just little by little be used on many automated systems, in order to connect and the control application apparatus.Therefore, in same system, above-mentioned serial line interface, CAN interface, Ethernet interface; The probability that these three kinds of interfaces occur can get more and more; For information transmission smoothly between the assurance equipment, guarantee the operate as normal of whole system various piece equipment, relevant communication network transducer is developed out; But existing transducer all relates to the conversion of two kinds of communication network protocol basically: like serial port networked server; The DEU data exchange unit of serial communication and CAN bus communication, CAN bus and ethernet communication, the mutual conversion between the serial communication.
In order to guarantee information transmission smoothly between the different communication interface equipment; If be responsible for the conversion of communication protocol with existing protocol conversion apparatus one to one; This need be equipped with protocol converter for each terminal; Along with increasing of terminal, transducer also increases accordingly, and the cost of networking and network complexity also can increase accordingly.
Summary of the invention
In order to overcome the deficiency of above-mentioned prior art; The utility model provides a kind of embedded configurable multi-protocol communication network commutator, makes functions such as serial communication commonly used, CAN communication, ethernet communication can be changed each other, local configuration management, Remote configuration management in one.
To achieve these goals, the purpose of the utility model realizes through following technical proposals:
A kind of embedded configurable multi-protocol communication network commutator; Comprise multi-protocol communication interface module, microcontroller, EEPROM data memory module, human-computer interaction module and power module; The multi-protocol communication interface module; EEPROM data memory module and human-computer interaction module are electrically connected with microcontroller respectively;, said power module is said multi-protocol communication interface module, microcontroller, EEPROM data memory module and human-computer interaction module power supply, also is provided with Remote configuration administration web page server in the multi-protocol communication network commutator.
Described multi-protocol communication interface module is by serial communication interface, and CAN communication interface, ethernet interface constitute.
Said serial communication interface comprises RS-232C communication interface, half-duplex RS-485 communication interface and full duplex RS-422A communication interface, and described RS-232C communication interface is to be connected to form successively by the built-in serial line interface of microcontroller, communication isolating chip ADUM1412, MAX232 serial communication transceiver and 2 DB9 sockets; Described half-duplex RS-485 communication interface is to be connected to form successively by the built-in serial line interface of microcontroller, communication isolating chip ADUM1412, MAX485 semi-duplex serial port communication transceiver and 2 DB9 sockets; Described full duplex RS-422A communication interface is to be connected to form successively by the built-in serial line interface of microcontroller, communication isolating chip ADUM1412, MAX3535E full duplex serial communication transceiver and 2 DB9 sockets;
Said CAN communication interface is to be connected to form successively by the built-in CAN controller of microcontroller, communication isolating chip ADUM1412, SN65HVD230CAN transceiver and 2 DB9 sockets;
Said ethernet interface is to be connected to form successively by ENC28J60 ethernet control chip, 11FB-05NL Ethernet transformer and 2 RJ45 sockets;
Described microcontroller adopts 32 ARM nuclear STM32F103VC, and comprising the required resource of native system on its sheet has 5 road serial communication interfaces, 1 road CAN communication interface, 3 road spi bus interfaces, 256KFLASH, 64KRAM.
Described EEPROM data memory module adopts the PCT25VF106B of the 2M capacity of 1 SPI interface to form.
Described human-computer interaction module; The LJD-ZU070 touch-screen, indicator of the power supply status (2 paths of LEDs indicator light) and the communication interface working station indicator (5 paths of LEDs indicator light) that comprise toggle switch, RS232C serial line interface; Toggle switch and touch-screen are used for the local configuration management to transducer; Toggle switch is used to select the communication protocol type of transducer conversion, and touch-screen is used to dispose the messaging parameter (like the communication baud rate of serial ports and CAN etc.) and the communication protocol relevant parameter (like IP address, gateway, mask and the physical address etc. of Ethernet) of various communication controlers.
Utilization is based on the LJD-ZU070 touch-screen of RS232C serial ports; Can be after having disposed native system; Take off and be used for configuration other transducers; The Remote configuration of this transducer management for ease, the also embedded Remote configuration administration web page of the utility model server makes the user to be configured this transducer through browser.
Described power module is used to produce required 5V of System on Chip/SoC work and 3.3V power supply, and the 5V power supply is produced by the LM317L three-terminal voltage regulator, and it is mainly the various transceiver power supplies in the above-mentioned communication interface; 3.3V power supply is produced by the SPX1117 of adjustable output voltage, it is mainly the chip power supply except that communication transceiver.
Described employing communicates forwarding of data based on the communication protocol handling process of state machine and refers to; Operational order according to local configuration management or Remote configuration management; The state of state machine in the configuration protocol handling process; The communication protocol handling process is according to the state that is disposed (communication network protocol that promptly need change); Select the corresponding communication method for converting protocol, thereby realize the conversion of many-to-many communication agreement, the communication network translation-protocol of said transducer acquiescence is the mutual conversion between Ethernet and the RS-485 communication network.
The utility model compared with prior art has following beneficial effect:
One, realizes multiple communication network protocol conversion.Be integrated into three kinds of communication buss commonly used on the communication protocols converter; Realize multiple communication network protocol conversion between serial communication, CAN communication, the ethernet communication; And serial communication (RS-232C; RS-485 and RS-422A) between transition of communications, can satisfy in practical applications the data communication of the multiple communication network of same system needs, can reduce networking cost to a certain extent;
Two, the communication protocol of transducer conversion is configurable.Can be according to the application need of actual communication networks protocol conversion, through local configuration management and Remote configuration management function, the equipped with switches concrete function is to satisfy requirements of different users;
Three, utilize high performance 32 ARM nuclear microcontroller STM32F103VC design of communications network commutator, improve communication Protocol Conversion efficient;
Four, every road communication interface all has two communication line gang sockets, conveniently utilizes daisy chain to connect to carry out networking and convenient that communication network is debugged to system;
Five, utilize resourceful STM32F103VC microcontroller; This controller is inner integrated watchdog module, clock module, 256KFLASH, 64KRAM, 5 road serial line interfaces; 3 road spi bus interfaces, 1 road CAN interface etc.; Effectively simplify the design of peripheral circuit, improved the reliability of system.
Embodiment
Below in conjunction with accompanying drawing the utility model is done further detailed explanation.
With reference to Fig. 1, this is that the utility model hardware configuration connects block diagram.A kind of embedded configurable multi-protocol communication network commutator comprises microcontroller 1, power module 2, EEPROM data memory module 3, human-computer interaction module 4, serial communication interface 5, ethernet interface 6, CAN communication interface 7.
Microcontroller 1 is the core of multi-protocol communication network commutator, the realization software of executive communication network switch agreement and administration configuration function, the configuration parameter that EEPROM data memory module 3 storing communication baud rates, communication protocol etc. are relevant.
Annexation between the above-mentioned hardware configuration assembly: EEPROM data memory module 3 links to each other with microcontroller 1 through the SPI interface; Touch-screen in the human-computer interaction module 4 links to each other with microcontroller 1 through the RS-232C interface, and 7 paths of LEDs indicator lights in the human-computer interaction module 4 directly are connected with the port pinout of microcontroller 1; Serial communication interface 5 is connected with the serial line interface of microcontroller 1; Ethernet interface 6 links to each other with microcontroller 1 through the SPI interface; CAN communication interface 7 is connected with the CAN port pinout of microcontroller 1.
With reference to Fig. 2, this is the workflow diagram of the utility model.As shown in the figure; A kind of workflow of embedded configurable multi-protocol communication network commutator is following: when transducer energising operation " beginning "; " system initialization " accomplished the initial work of systems soft ware and hardware, follows " touch-screen button " and judged whether that button presses, if there is button to press; Then carrying out corresponding key configurations handles; If not then carry out the Ethernet data request type that " Ethernet COS " judges that transducer receives, if " webpage configuration service ", just give " webpage configuration server data processing "; If not, then judged whether " communication Protocol Conversion " request,, then give " multiprotocol conversion handling process " if having, turn back to " judging the touch-screen button " at last and locate.
With reference to Fig. 3, this is the multiprotocol conversion schematic diagram of the utility model.As shown in the figure, it is responsible for the mutual conversion between Control Network Frame and the ethernet data frame, and the mutual conversion between serial communication data and CAN Frame, the serial communication Frame.
For example; Communication converter receives the Ethernet data bag, at first, by certain queue discipline packet is lined up earlier; Data are placed in the buffering area in certain sequence; When arriving certain limit, inner data processor begins process frames of data, and the form with Control Network Frame (serial data frame or CAN Frame) sends then; Otherwise when Control Network Frame (serial data frame or CAN Frame) arrived, communication converter converted the serial data frame into Ethernet data, and its processing procedure is similarly, and two processing procedures are inverse process each other.In addition, the Frame between serial communication Frame and CAN Frame, serial ports RS-232C and the RS-485 (RS-422A) is changed each other, and their transfer principle and above-mentioned transfer principle are similar.
Utilize this transducer can realize interconnecting and the information transmission easily to different communication interface equipment in the same system; Former cause different manufacturers equipment that developed, dissimilar are fully utilized, give full play to the usefulness of existing equipment, thereby avoid eliminating more existing equipment; Like this; Basically do not increasing under the situation of investment, improving the utilance and the production efficiency of existing equipment, and then improving economic benefit of enterprises and social benefit.
Along with the continuous development of industrial circle automation, the probability that above-mentioned three kinds of communication interfaces occur in same system is increasing, needs similar communication protocols converter more and more, and the utility model has very big application space.