CN106161168A - A kind of programmable double on-site bus translation interface and method - Google Patents

A kind of programmable double on-site bus translation interface and method Download PDF

Info

Publication number
CN106161168A
CN106161168A CN201610524243.4A CN201610524243A CN106161168A CN 106161168 A CN106161168 A CN 106161168A CN 201610524243 A CN201610524243 A CN 201610524243A CN 106161168 A CN106161168 A CN 106161168A
Authority
CN
China
Prior art keywords
communication
profibus
ncuc
bus
module
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
Application number
CN201610524243.4A
Other languages
Chinese (zh)
Other versions
CN106161168B (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.)
Wuhan University of Technology WUT
Original Assignee
Wuhan University of Technology WUT
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 Wuhan University of Technology WUT filed Critical Wuhan University of Technology WUT
Priority to CN201610524243.4A priority Critical patent/CN106161168B/en
Publication of CN106161168A publication Critical patent/CN106161168A/en
Application granted granted Critical
Publication of CN106161168B publication Critical patent/CN106161168B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/40Bus networks
    • H04L12/40006Architecture of a communication node
    • H04L12/40032Details regarding a bus interface enhancer
    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B19/00Programme-control systems
    • G05B19/02Programme-control systems electric
    • G05B19/04Programme control other than numerical control, i.e. in sequence controllers or logic controllers
    • G05B19/042Programme control other than numerical control, i.e. in sequence controllers or logic controllers using digital processors
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/40Bus networks
    • H04L12/40169Flexible bus arrangements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/40Bus networks
    • H04L2012/40208Bus networks characterized by the use of a particular bus standard
    • H04L2012/40221Profibus
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/40Bus networks
    • H04L2012/40208Bus networks characterized by the use of a particular bus standard
    • H04L2012/40254Actuator Sensor Interface ASI

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Automation & Control Theory (AREA)
  • Communication Control (AREA)
  • Small-Scale Networks (AREA)

Abstract

The invention discloses a kind of programmable double on-site bus translation interface and method, support the interface arrangement of two kinds of fieldbus conversions of NCUC and Profibus DP, this interface switching device can make the serial communication equipment of access or network interface communication equipment carry out reliable communication with the equipment supporting NCUC or Profibus DP fieldbus respectively simultaneously, it is achieved heterogeneous network internetworking.Present invention employs STM32F103RET6 microcontroller, be 32 high-performance microcontrollers, use special Profibus DP protocol chip, it is achieved user data is to the communication of Profibus DP bus, and processing speed is faster.Achieve serial equipment, network port device is linked into NCUC fieldbus, Profibus DP fieldbus communicates function.There is the features such as processing speed is fast, motility strong, reliable communications, can reduce industry spot NCUC, Profibus DP slave station design complexities, reduction user uses NCUC, Profibus DP technical threshold and development cost, beneficially product are integrated and product rapid development.

Description

A kind of programmable double on-site bus translation interface and method
Technical field
The invention belongs to field bus technique field, be specifically related to a kind of programmable double on-site bus translation interface and side Method.
Background technology
The generation of fieldbus plays very important effect to industrial expansion, and the growth to national economy has very Important impact.At present, having the fieldbus that kind more than 40 differs from one another in the world, these fieldbus achieve on-the-spot automatization Multipoint digital communication between equipment, also achieves equipment and the exchange of extraneous information.Market at home, Profibus-DP, NCUC is two kinds of representational bus protocols of comparison.Research field bus technique, development support multiple fieldbus are changed Interface equipment tool is of great significance.
Currently, design based on fieldbus translation interface, mainly have following several: serial equipment is to single fieldbus Conversion;Network port device is changed to single fieldbus;Conversion etc. between Different field bus.Assuming that device A is with equipment B respectively Have employed two kinds of Different field bussing techniques.Device A to be in communication with each other with equipment B, then need one between device A, B Bus conversion device;Another equipment C to communicate with the said equipment A, B, then it is on-the-spot that equipment C is necessary for both to be realized Bussing technique, and equipment C (generally great majority) is from serial ports or network interface communication interface, equipment C wants real Now communicate with re-starting with device A, B and design and develop, thus make the application of equipment C have limitation, and uneconomical. Therefore, exploitation has the interface arrangement that the conversion of general-purpose interface such as serial ports and network interface communication equipment was changed and can be supported to multibus Just seem the most necessary.
Summary of the invention:
In order to overcome the defect of above-mentioned background technology, the present invention provide a kind of programmable double on-site bus translation interface and Method, it is achieved heterogeneous network internetworking, processing speed is fast, motility is strong, reliable communications.
In order to solve above-mentioned technical problem the technical solution adopted in the present invention it is:
A kind of programmable double on-site bus translation interface, including: controller, and it is connected to the NCUC bus of controller Communication module, Profibus-DP bus communication module, serial communication modular, network interface communication module and equipment choice switch module;
Controller includes the first communication control module, is used for controlling between NCUC bus communication module and serial communication modular Two-way communication;Second communication control module, two-way for control between NCUC bus communication module and network interface communication module Communication;Third communication control module, two-way for control between Profibus-DP bus communication module and serial communication modular Communication;Fourth communication control module, two-way for control between Profibus-DP bus communication module and network interface communication module Communication;Fifth communication control module, for controlling between NCUC bus communication module and Profibus-DP bus communication module Two-way communication;
Equipment choice switch module include being used, respectively, to initiate the first communication control module, the second communication control module, First switch of three communication control modules, fourth communication control module and fifth communication control module, second switch, the 3rd open Close, the 4th switch and the 5th switchs.
It is preferred that NCUC bus communication module include being sequentially connected with fpga chip, Ethernet chip, first network transformation Device and adapter, fpga chip is also connected with controller, and adapter is used for connecting NCUC bus network;
Profibus-DP bus communication module includes that the SPC3 controller being sequentially connected with, isolation circuit and the first data connect Mouth adapter, SPC3 controller is also connected with controller, and the first data interface connector is used for connecting Profibus-DP bus network Network;
Serial communication modular includes interconnective electrical level transferring chip and the second data interface connector, level conversion core Sheet is also connected with controller, and the second data interface connector is used for connecting serial ports field apparatus or instrument;
Network interface communication module includes interconnective Ethernet transceiving chip and the second network transformer, Ethernet transmitting-receiving core Sheet is also attached to controller, and the second network transformer is used for connecting network interface field apparatus or instrument.
It is preferred that the first data interface connector and the second data interface connector are 9 pin D type data interface connectors, Electrical level transferring chip is MAX3232 electrical level transferring chip.
The present invention also provides for a kind of method utilizing above-mentioned interface to carry out programmable double on-site bus conversion:
The key selection signal of equipment choice switch module acquisition user's input:
If the first switch is chosen, then starts the first communication control module and control NCUC bus communication module and serial communication Two-way communication between module;
If second switch is chosen, then starts the second communication control module and control NCUC bus communication module and network interface communication Two-way communication between module;
If the 3rd switch be chosen, then start third communication control module control Profibus-DP bus communication module with Two-way communication between serial communication modular;
If the 4th switch be chosen, then start fourth communication control module control Profibus-DP bus communication module with Two-way communication between network interface communication module;
If the 5th switch be chosen, then start fifth communication control module control NCUC bus communication module with Two-way communication between Profibus-DP bus communication module.
It is preferred that the first communication control module controls the two-way between NCUC bus communication module and serial communication modular The method of letter is:
Step S11, whether inquiry NCUC bus communication module receives data, the most then enter step S12, if it is not, then Enter step S13;
Step S12, runs NCUC service subprogram, enters step S13;
Step S13, whether inquiry serial communication modular receives data, the most then enter step S14, if it is not, then return to Step S11;
Step S14, runs serial port service subprogram, returns to step S11;
Second communication control module controls the side of the two-way communication between NCUC bus communication module and network interface communication module Method is:
Step S21, whether inquiry NCUC bus communication module receives data, the most then enter step S22, if it is not, then Enter step S23;
Step S22, runs NCUC service subprogram, enters step S23;
Step S23, whether inquiry network interface communication module receives data, the most then enter step S24, if it is not, then return to Step S21;
Step S24, runs network interface service subprogram, returns to step S21;
Third communication control module controls the two-way between Profibus-DP bus communication module and serial communication modular The method of letter is:
Step S31, whether inquiry Profibus-DP bus communication module receives data, the most then enter step S32, If it is not, then enter step S33;
Step S32, runs Profibus-DP service subprogram, enters step S33;
Step S33, whether inquiry serial communication modular receives data, the most then enter step S34, if it is not, then return to Step S31;
Step S34, runs serial port service subprogram, returns to step S31;
Fourth communication control module controls the two-way between Profibus-DP bus communication module and network interface communication module The method of letter is:
Step S41, whether inquiry Profibus-DP bus communication module receives data, the most then enter step S42, If it is not, then enter step S43;
Step S42, runs Profibus-DP service subprogram, enters step S43;
Step S43, whether inquiry network interface communication module receives data, the most then enter step S44, if it is not, then return to Step S41;
Step S44, runs network interface service subprogram, returns to step S41;
It is double that fifth communication control module controls between NCUC bus communication module and Profibus-DP bus communication module Method to communication is:
Step S51, whether inquiry NCUC bus communication module receives data, the most then enter step S52, if it is not, then Enter step S53;
Step S52, runs NCUC service subprogram, enters step S53;
Step S53, whether inquiry Profibus-DP bus communication module receives data, the most then enter step S54, If it is not, then return to step S51;
Step S54, runs Profibus-DP service subprogram, returns to step S51.
It is preferred that NCUC service subprogram includes:
Step S61, reads NCUC data, it is judged that whether the first switch is connected, the most then enter step S62, if it is not, then Enter step S63;
The NCUC data of reading are converted into serial port protocol data, and are sent to serial communication modular by step S62, enter Step S66;
Step S63, it is judged that whether second switch is connected, the most then enter step S64, if it is not, then enter step S65;
The NCUC data of reading are converted into network interface protocol data, and are sent to network interface communication module by step S64, enter Step S66;
The NCUC data of reading are converted into Profibus-DP protocol data, and are sent to Profibus-DP by step S65 Bus communication module, enters step S66;
Step S66, subprogram returns.
It is preferred that Profibus-DP service subprogram includes:
Step S71, reads Profibus-DP data, it is judged that whether the 3rd switch is connected, the most then enter step S72, If it is not, then enter step S73;
The Profibus-DP data of reading are converted into serial port protocol data, and are sent to serial communication mould by step S72 Block, enters step S76;
Step S73, it is judged that whether the 4th switch is connected, the most then enter step S74, if it is not, then enter step S75;
The Profibus-DP data of reading are converted into network interface protocol data, and are sent to network interface communication mould by step S74 Block, enters step S76;
The Profibus-DP data of reading are converted into NCUC protocol data, and it are logical to be sent to NCUC bus by step S75 Letter module, enters step S76;
Step S76, subprogram returns.
It is preferred that serial port service subprogram includes:
Step S81, reads serial data, it is judged that whether the first switch is connected, the most then enter step S82, if it is not, then Enter step S83;
Step S82, is converted into the serial data of reading NCUC protocol data, and is sent to NCUC bus communication module, Enter step S84;
Step S83, is converted into Profibus-DP protocol data by the serial data of reading, and is sent to Profibus-DP Bus communication module, enters step S84;
Step S84, subprogram returns.
It is preferred that network interface service subprogram includes:
Step S91, reads network interface data, it is judged that whether second switch is connected, the most then enter step S92, if it is not, then Enter step S93;
The network interface data of reading are converted into NCUC protocol data, and are sent to NCUC bus communication module by step S92, Enter step S94;
The network interface data of reading are converted into Profibus-DP protocol data, and are sent to Profibus-DP by step S93 Bus communication module, enters step S94;
Step S94, subprogram returns.
The beneficial effects of the present invention is: the present invention supports connecing of two kinds of fieldbus conversions of NCUC and Profibus-DP Mouthful device, simultaneously this interface switching device can make the serial communication equipment of access or network interface communication equipment respectively with support NCUC or The equipment of Profibus-DP fieldbus carries out reliable communication, it is achieved heterogeneous network internetworking.Present invention employs STM32F103RET6 microcontroller, is 32 high-performance microcontrollers, uses special Profibus-DP protocol chip, it is achieved User data is to the communication of Profibus-DP bus, and processing speed is faster.The present invention uses 32 high-performance microcontrollers and profit By the NCUC fieldbus communications module that FPGA is main realization, it is achieved user data is to the communication of NCUC bus.Achieve serial ports The function that equipment, network port device are linked into NCUC fieldbus, Profibus-DP fieldbus communicates, also realizes simultaneously The function that NCUC fieldbus is in communication with each other with Profibus-DP fieldbus.Have that processing speed is fast, motility strong, logical The features such as letter is reliable, it is possible to reduce industry spot NCUC, Profibus-DP slave station design complexities, reduce user use NCUC, Profibus-DP technical threshold and development cost, beneficially product be integrated and product rapid development.
Accompanying drawing explanation
Fig. 1 is the population structure schematic diagram of interface described in the embodiment of the present invention one;
Fig. 2 is the embodiment of the present invention one NCUC bus communication inside modules structure and illustrates with controller attachment structure Figure;
Fig. 3 is the internal module structural representation of the embodiment of the present invention one fpga chip;
Fig. 4 is the embodiment of the present invention one Profibus-DP bus communication inside modules structure and is connected knot with controller Structure schematic diagram;
Fig. 5 be the embodiment of the present invention one serial communication inside modules structure and with controller attachment structure schematic diagram;
Fig. 6 be the embodiment of the present invention one network interface communication module internal structure and with controller attachment structure schematic diagram;
Fig. 7 be the embodiment of the present invention one equipment choice switch module with controller attachment structure schematic diagram;
Fig. 8 is the two-way communication stream between the embodiment of the present invention two NCUC bus communication module and serial communication modular Cheng Tu;
Fig. 9 is the two-way communication stream between the embodiment of the present invention two NCUC bus communication module and network interface communication module Cheng Tu;
Figure 10 is the two-way communication side of the embodiment of the present invention two Profibus-DP bus communication module and serial communication modular Method flow chart;
Figure 11 is the two-way communication side of the embodiment of the present invention two Profibus-DP bus communication module and network interface communication module Method flow chart;
Figure 12 is the two-way of the embodiment of the present invention two NCUC bus communication module and Profibus-DP bus communication module Letter method flow diagram;
Figure 13 is the embodiment of the present invention two NCUC service subprogram flow chart;
Figure 14 is the embodiment of the present invention two Profibus-DP service subprogram flow chart;
Figure 15 is the embodiment of the present invention two serial port service subroutine flow chart;
Figure 16 is the embodiment of the present invention two network interface service subprogram flow chart.
In figure, 1-controller, 2-NCUC bus communication module, 2.1-FPGA chip, 2.2-Ethernet chip, 2.3-first Network transformer, 2.4-adapter, 3-Profibus-DP bus communication module, 3.1-SPC3 controller, 3.2-isolates circuit, 3.3-the first data interface connector, 4-serial communication modular, 4.1-electrical level transferring chip, 4.2-the second data-interface connects Device, 5-network interface communication module, 5.1-Ethernet transceiving chip, 5.2-the second network transformer, 6-equipment choice switch module.
Detailed description of the invention
The present invention is described further with embodiment below in conjunction with the accompanying drawings.
Embodiment one
As it is shown in figure 1, a kind of programmable double on-site bus translation interface, including: controller 1, and be connected to control The NCUC bus communication module 2 of device 1, Profibus-DP bus communication module 3, serial communication modular 4, network interface communication module 5 and Equipment choice switch module 6;Controller 1 in the present embodiment is STM32F103RET6 microcontroller 1.
Controller 1 includes the first communication control module, is used for controlling NCUC bus communication module 2 and serial communication modular 4 Between two-way communication;Second communication control module, is used for controlling between NCUC bus communication module 2 and network interface communication module 5 Two-way communication;Third communication control module, be used for controlling Profibus-DP bus communication module 3 and serial communication modular 4 it Between two-way communication;Fourth communication control module, is used for controlling Profibus-DP bus communication module 3 and network interface communication module 5 Between two-way communication;Fifth communication control module, is used for controlling NCUC bus communication module 2 and leads to Profibus-DP bus Two-way communication between letter module 3;
Equipment choice switch module 6 include being used, respectively, to initiate the first communication control module, the second communication control module, First switch of three communication control modules, fourth communication control module and fifth communication control module, second switch, the 3rd open Close, the 4th switch and the 5th switchs.
The PA0 pin of STM32F103RET6 microcontroller 1, PA1 pin, PA2 pin, PA3 pin and PA8 pin are respectively It is the first communication control module, the second communication control module, third communication control module, fourth communication control module and five-way The triggering pin of letter control module.
As it is shown in fig. 7, the switch of equipment choice switch module 6 first switchs Key1, second switch Key2, the 3rd switch Key3, the 4th switch Key4 and the 5th switch Key5 respectively with the PA0 pin of STM32F103RET6 microcontroller 1, PA1 pin, PA2 pin, PA3 pin and PA8 pin are sequentially connected with.
As in figure 2 it is shown, NCUC bus communication module 2 include being sequentially connected with fpga chip 2.1, Ethernet chip 2.2, One network transformer 2.3 and adapter 2.4, fpga chip 2.1 is also connected with controller 1, and adapter 2.4 is used for connecting NCUC bus Network,
Fpga chip 2.1 selects CycloneII Series FPGA chip 2.1, and model is EP2C8T144C8, Ethernet chip 2.2 select EPA chip 2.2KSZ8721BLI, and the model of first network transformator 2.3 is HX1188NL, adapter The model of 2.4 is 3E106.
As it is shown on figure 3, fpga chip 2.1 that model is EP2C8T144C8 internal realize including SPI communication interface, SPI with NCUC communication conversion, NCUC communication interface part, SPI communication interface realizes SPI protocol communication, and NCUC communication interface realizes NCUC Protocol communication;The conversion that SPI with NCUC communication conversion realizes between two agreements is connected.As for NCUC protocol contents packing and Resolve and then complete in STM32.
I/O pin CS/40, SCK/41, SI/42, SO/43 of fpga chip 2.1EP2C8T144C8 with Pin PA4, PA5, PA6, PA7 connection that STM32F103RET6 microcontroller 1 is corresponding, fpga chip 2.1EP2C8T144C8 I/O pin R1V/44, R1_1/45, R1_0/47 and bus data receive side EPA chip 2.2KSZ8721BLI phase Corresponding pin RXDV, RXD1, RXD0 connects, the I/O pin T2E/57 of fpga chip 2.1EP2C8T144C8, T2_1/58, Pin TXEN, TXD1, TXD0 that T2_0/59 is corresponding with bus data sending side EPA chip 2.2KSZ8721BLI Connecting, I/O pin PRST/142, PCLK/143 of fpga chip 2.1EP2C8T144C8 and bus data receive, sending side work Pin RST, REFCLK corresponding for industrial Ethernet chip 2.2KSZ8721BLI connects, and bus data receives side EPA Pin TX+, TX-, RX+, RX-of chip 2.2KSZ8721BLI receives drawing of side network transformer HX1188NL with bus data Foot TD+, TD-, RD+, RD-connect, the pin TX+ of bus data sending side EPA chip 2.2KSZ8721BLI, TX-, RX+, RX-are connected with pin TD+, TD-, RD+, RD-of bus data transmission side network transformator HX1188NL, and bus data connects Pin TX+, TX-, RX+, RX-of receiving side network transformer HX1188NL receive drawing of side 3E106 adapter 2.4 with bus data Foot TX+, TX-, RX+, RX-connect, pin TX+, TX-, RX+, RX-of bus data transmission side network transformator HX1188NL with Pin TX+, TX-, RX+, RX-of bus data sending side 3E106 adapter 2.4 connects.
As shown in Figure 4, Profibus-DP bus communication module 3 includes SPC3 controller 3.1, the isolation electricity being sequentially connected with Road 3.2 and the first data interface connector 3.3, SPC3 controller 3.1 is also connected with controller 1, the first data interface connector 3.3 For connecting Profibus-DP bus network;
The first data interface connector 3.3 in the present embodiment is that 9 pin D type data interface connectors 2.4 (can be called for short DB9), the pin DB [0...7] of SPC3 controller 3.1, AB [0...7], INT0 respectively with STM32F103RET6 microcontroller 1 Corresponding pin PB [0...7], PC [0...7], PC8 connect, pin RD, WR, ALE of SPC3 controller 1 with Corresponding pin PC12, PC13, the PC9 of STM32F103RET6 microcontroller 1 connects, the pin RXD of SPC3 controller 1, TXD, RTS is connected with pin TXD, RXD, RTS of isolation circuit 3.2ADM2486 chip;The pin of isolation circuit 3.2ADM2486 chip The pin 8,3,4 of A, B, DE and the first data interface connector 3.3DB9 plug connects.
As it is shown in figure 5, serial communication modular 4 includes interconnective electrical level transferring chip 4.1 and the second data-interface even Connecing device 4.2, electrical level transferring chip 4.1 is also connected with controller 1, and the second data interface connector 4.2 is used for connecting serial ports scene and sets Standby or instrument;
In the present embodiment, the electrical level transferring chip 4.1 of serial communication modular 4 selects MAX3232 chip, the second data-interface 9 pin D type data interface connectors 2.4 (being called for short DB9) also selected by adapter 4.2.
Pin R1OUT, T1OUT of electrical level transferring chip 4.1MAX3232 and STM32F103RET6 microcontroller 1 PA10, PA9 correspondence connects;Pin R1IN, T1OUT of electrical level transferring chip 4.1MAX3232 and the second data interface connector The pin 3,2 of 4.2DB9 plug connects.
As shown in Figure 6, network interface communication module 5 includes interconnective Ethernet transceiving chip 5.1 and the second network transformation Device 5.2, Ethernet transceiving chip 5.1 is also attached to controller 1, and the second network transformer 5.2 is used for connecting network interface field apparatus Or instrument.
In the present embodiment, the model of Ethernet transceiving chip 5.1 is ENC28J60, the model of the second network transformer 5.2 Form for HR911105A.Pin SO, SI, SCK, CS of Ethernet transceiving chip 5.1ENC28J60 chip with PB14, PB15, PB13, PB12 connection that STM32F103RET6 microcontroller 1 is corresponding;Ethernet transceiving chip Pin TPIN-, TPIN+, TPOUT-, TPOUT+ of 5.1ENC28J60 chip and the second network transformer 5.2HR911105A phase Corresponding RD-, RD+, TD-, TD+ connects.
The operation principle of interface described in the present embodiment is: NCUC bus communication module 2 realizes (this communication of NCUC bus protocol FPGA in module realizes NCUC bus functionality, SPI communication function, and STM32F103RET6 microcontroller is total by SPI with NCUC Line carries out data interaction), Profibus-DP bus communication module 3 realizes Profibus-DP bus protocol, serial communication modular 4 Processing serial port protocol, STM32F103RET6 microcontroller 1 and network interface communication module 5 process procotol.Meanwhile, Software in STM32F103RET6 microcontroller 1 realizes the association between serial ports, network interface and NUUC bus, Profibus-DP bus View conversion.Five first switch Key1 of equipment choice switch module 6, second switch Key2, the 3rd switch Key3, the 4th switch Key4, the 5th switch Key5 control the switching of five kinds of communication patterns.When selecting the first switch Key1, NCUC network and bottom serial ports Equipment two-way communication;When selecting second switch Key2, NCUC network and underlying network jaws equipment two-way communication;Select the 3rd switch During Key3, Profibus-DP network and bottom serial equipment two-way communication;When selecting the 4th switch Key4, Profibus-DP net Network and underlying network jaws equipment two-way communication;When selecting the 5th switch Key5, NCUC network leads to Profibus-DP network bi-directional Letter.
Embodiment two
The method that the present embodiment utilization interface as described in embodiment one carries out programmable double on-site bus conversion:
Step S1, arranges systematic parameter, initializes each communication module;
Step S2, equipment choice switch module 6 obtains the key selection signal of user's input;
Step S3, it is judged that whether user selects any one in five switches of equipment choice switch module 6, the most then Enter step S4, if it is not, then return to step S2;
Step S4, it is judged that the switch that user selects be the first switch Key1, second switch Key2, the 3rd switch Key3, the Four switch Key4 or the 5th switch Key5;
If the first switch Key1 is chosen, then starts the first communication control module and control NCUC bus communication module 2 and string Two-way communication between port communications module 4;
If second switch Key2 is chosen, then starts the second communication control module and control NCUC bus communication module 2 and net Two-way communication between port communications module 5;
If the 3rd switch Key3 is chosen, then starts third communication control module and control Profibus-DP bus communication mould Two-way communication between block 3 and serial communication modular 4;
If the 4th switch Key4 is chosen, then starts fourth communication control module and control Profibus-DP bus communication mould Two-way communication between block 3 and network interface communication module 5;
If the 5th switch Key5 is chosen, then start fifth communication control module control NCUC bus communication module 2 with Two-way communication between Profibus-DP bus communication module 3;
Equipment the most only allows to carry out a mode button and selects and be only the one in five kinds of patterns.
When the first switch Key1 is chosen, the first communication control module controls NCUC bus communication module 2 and leads to serial ports Two-way communication between letter module 4 is activated, and as shown in Figure 8, its communication means is:
Step S11, whether inquiry NCUC bus communication module 2 receives data, the most then enter step S12, if it is not, Then enter step S13;
Step S12, runs NCUC service subprogram, enters step S13;
Step S13, whether inquiry serial communication modular 4 receives data, the most then enter step S14, if it is not, then return To step S11;
Step S14, runs serial port service subprogram, returns to step S11;
When second switch Key2 is chosen, the second communication control module controls NCUC bus communication module 2 and leads to network interface Two-way communication between letter module 5 is activated, as it is shown in figure 9, communication means is:
Step S21, whether inquiry NCUC bus communication module 2 receives data, the most then enter step S22, if it is not, Then enter step S23;
Step S22, runs NCUC service subprogram, enters step S23;
Step S23, whether inquiry network interface communication module 5 receives data, the most then enter step S24, if it is not, then return To step S21;
Step S24, runs network interface service subprogram, returns to step S21;
When the 3rd switch Key3 is chosen, third communication control module control Profibus-DP bus communication module 3 with Two-way communication between serial communication modular 4 is activated, and as shown in Figure 10, the method for communication is:
Step S31, whether inquiry Profibus-DP bus communication module 3 receives data, the most then enters step S32, if it is not, then enter step S33;
Step S32, runs Profibus-DP service subprogram, enters step S33;
Step S33, whether inquiry serial communication modular 4 receives data, the most then enter step S34, if it is not, then return To step S31;
Step S34, runs serial port service subprogram, returns to step S31;
When the 4th switch Key4 is chosen, fourth communication control module control Profibus-DP bus communication module 3 with Two-way communication between network interface communication module 5 is activated, and as shown in figure 11, the method for communication is:
Step S41, whether inquiry Profibus-DP bus communication module 3 receives data, the most then enters step S42, if it is not, then enter step S43;
Step S42, runs Profibus-DP service subprogram, enters step S43;
Step S43, whether inquiry network interface communication module 5 receives data, the most then enter step S44, if it is not, then return To step S41;
Step S44, runs network interface service subprogram, returns to step S41;
When the 5th switch Key5 is chosen, fifth communication control module control NCUC bus communication module 2 with Two-way communication between Profibus-DP bus communication module 3 is activated, and as shown in figure 12, the method for communication is:
Step S51, whether inquiry NCUC bus communication module 2 receives data, the most then enter step S52, if it is not, Then enter step S53;
Step S52, runs NCUC service subprogram, enters step S53;
Step S53, whether inquiry Profibus-DP bus communication module 3 receives data, the most then enters step S54, if it is not, then return to step S51;
Step S54, runs Profibus-DP service subprogram, returns to step S51.
As shown in figure 13, NCUC service subprogram includes:
Step S61, reads NCUC data, it is judged that whether the first switch is connected, the most then enter step S62, if it is not, then Enter step S63;
The NCUC data of reading are converted into serial port protocol data, and are sent to serial communication modular 4 by step S62, enter Step S66;
Step S63, it is judged that whether second switch is connected, the most then enter step S64, if it is not, then enter step S65;
The NCUC data of reading are converted into network interface protocol data, and are sent to network interface communication module 5 by step S64, enter Step S66;
The NCUC data of reading are converted into Profibus-DP protocol data, and are sent to Profibus-DP by step S65 Bus communication module 3, enters step S66;
Step S66, subprogram returns.
As shown in figure 14, Profibus-DP service subprogram includes:
Step S71, reads Profibus-DP data, it is judged that whether the 3rd switch is connected, the most then enter step S72, If it is not, then enter step S73;
The Profibus-DP data of reading are converted into serial port protocol data, and are sent to serial communication mould by step S72 Block 4, enters step S76;
Step S73, it is judged that whether the 4th switch is connected, the most then enter step S74, if it is not, then enter step S75;
The Profibus-DP data of reading are converted into network interface protocol data, and are sent to network interface communication mould by step S74 Block 5, enters step S76;
The Profibus-DP data of reading are converted into NCUC protocol data, and it are logical to be sent to NCUC bus by step S75 Letter module 2, enters step S76;
Step S76, subprogram returns.
As shown in figure 15, serial port service subprogram includes:
Step S81, reads serial data, it is judged that whether the first switch is connected, the most then enter step S82, if it is not, then Enter step S83;
Step S82, is converted into the serial data of reading NCUC protocol data, and is sent to NCUC bus communication module 2, Enter step S84;
Step S83, is converted into Profibus-DP protocol data by the serial data of reading, and is sent to Profibus-DP Bus communication module 3, enters step S84;
Step S84, subprogram returns.
As shown in figure 16, network interface service subprogram includes:
Step S91, reads network interface data, it is judged that whether second switch is connected, the most then enter step S92, if it is not, then Enter step S93;
The network interface data of reading are converted into NCUC protocol data, and are sent to NCUC bus communication module 2 by step S92, Enter step S94;
The network interface data of reading are converted into Profibus-DP protocol data, and are sent to Profibus-DP by step S93 Bus communication module 3, enters step S94;
Step S94, subprogram returns.
It should be appreciated that for those of ordinary skills, can be improved according to the above description or be converted, And all these modifications and variations all should belong to the protection domain of claims of the present invention.

Claims (9)

1. a programmable double on-site bus translation interface, it is characterised in that including: controller (1), and it is connected to described NCUC bus communication module (2) of controller (1), Profibus-DP bus communication module (3), serial communication modular (4), net Port communications module (5) and equipment choice switch module (6);
Described controller (1) includes the first communication control module, is used for controlling described NCUC bus communication module (2) and described string Two-way communication between port communications module (4);Second communication control module, is used for controlling described NCUC bus communication module (2) And the two-way communication between described network interface communication module (5);Third communication control module, is used for controlling described Profibus-DP Two-way communication between bus communication module (3) and described serial communication modular (4);Fourth communication control module, is used for controlling Two-way communication between described Profibus-DP bus communication module (3) and described network interface communication module (5);Fifth communication control Molding block, is used for controlling between described NCUC bus communication module (2) and described Profibus-DP bus communication module (3) Two-way communication;
Described equipment choice switch module (6) include being used, respectively, to initiate the first communication control module, the second communication control module, First switch of third communication control module, fourth communication control module and fifth communication control module, second switch, the 3rd open Close, the 4th switch and the 5th switchs.
One the most according to claim 1 programmable double on-site bus translation interface, it is characterised in that:
Fpga chip (2.1) that described NCUC bus communication module (2) includes being sequentially connected with, Ethernet chip (2.2), the first net Network transformator (2.3) and adapter (2.4), described fpga chip (2.1) is also connected with described controller (1), described adapter (2.4) it is used for connecting NCUC bus network;
Described Profibus-DP bus communication module (3) includes SPC3 controller (3.1), isolation circuit (3.2) being sequentially connected with With the first data interface connector (3.3), described SPC3 controller (3.1) is also connected with described controller (1), described first data Interface connector (3.3) is used for connecting Profibus-DP bus network;
Described serial communication modular (4) includes interconnective electrical level transferring chip (4.1) and the second data interface connector (4.2), described electrical level transferring chip (4.1) is also connected with described controller (1), and the second data interface connector (4.2) is for even Connect serial ports field apparatus or instrument;
Described network interface communication module (5) includes interconnective Ethernet transceiving chip (5.1) and the second network transformer (5.2), described Ethernet transceiving chip (5.1) is also attached to described controller (1), and described second network transformer (5.2) is used In connecting network interface field apparatus or instrument.
One the most according to claim 2 programmable double on-site bus translation interface, it is characterised in that: described first number It is 9 pins D type data interface connector (2.4) according to interface connector (3.3) and described second data interface connector (4.2), institute Stating electrical level transferring chip (4.1) is MAX3232 electrical level transferring chip (4.1).
4. utilize the method that interface as described in any one of claim 1-3 carries out programmable double on-site bus conversion, its It is characterised by:
Described equipment choice switch module (6) obtains the key selection signal of user's input,
If the first switch is chosen, then starts the first communication control module and control described NCUC bus communication module (2) with described Two-way communication between serial communication modular (4);
If second switch is chosen, then starts the second communication control module and control described NCUC bus communication module (2) with described Two-way communication between network interface communication module (5);
If the 3rd switch is chosen, then starts third communication control module and control described Profibus-DP bus communication module (3) And the two-way communication between described serial communication modular (4);
If the 4th switch is chosen, then starts fourth communication control module and control described Profibus-DP bus communication module (3) And the two-way communication between described network interface communication module (5);
If the 5th switch is chosen, then starts fifth communication control module and control described NCUC bus communication module (2) with described Two-way communication between Profibus-DP bus communication module (3).
One the most according to claim 4 programmable double on-site bus conversion method, it is characterised in that:
Described first communication control module controls between described NCUC bus communication module (2) and described serial communication modular (4) The method of two-way communication be:
Step S11, inquires about whether described NCUC bus communication module (2) receives data, the most then enter step S12, if No, then enter step S13;
Step S12, runs NCUC service subprogram, enters step S13;
Step S13, inquires about whether described serial communication modular (4) receives data, the most then enter step S14, if it is not, then Return to step S11;
Step S14, runs serial port service subprogram, returns to step S11;
Described second communication control module controls between described NCUC bus communication module (2) and described network interface communication module (5) The method of two-way communication be:
Step S21, inquires about whether described NCUC bus communication module (2) receives data, the most then enter step S22, if No, then enter step S23;
Step S22, runs NCUC service subprogram, enters step S23;
Step S23, inquires about whether described network interface communication module (5) receives data, the most then enter step S24, if it is not, then Return to step S21;
Step S24, runs network interface service subprogram, returns to step S21;
Described third communication control module controls described Profibus-DP bus communication module (3) and described serial communication modular (4) method of the two-way communication between is:
Step S31, inquires about whether described Profibus-DP bus communication module (3) receives data, the most then enter step S32, if it is not, then enter step S33;
Step S32, runs Profibus-DP service subprogram, enters step S33;
Step S33, inquires about whether described serial communication modular (4) receives data, the most then enter step S34, if it is not, then Return to step S31;
Step S34, runs serial port service subprogram, returns to step S31;
Described fourth communication control module controls described Profibus-DP bus communication module (3) and described network interface communication module (5) method of the two-way communication between is:
Step S41, inquires about whether described Profibus-DP bus communication module (3) receives data, the most then enter step S42, if it is not, then enter step S43;
Step S42, runs Profibus-DP service subprogram, enters step S43;
Step S43, inquires about whether described network interface communication module (5) receives data, the most then enter step S44, if it is not, then Return to step S41;
Step S44, runs network interface service subprogram, returns to step S41;
Described fifth communication control module controls described NCUC bus communication module (2) and described Profibus-DP bus communication The method of the two-way communication between module (3) is:
Step S51, inquires about whether described NCUC bus communication module (2) receives data, the most then enter step S52, if No, then enter step S53;
Step S52, runs NCUC service subprogram, enters step S53;
Step S53, inquires about whether described Profibus-DP bus communication module (3) receives data, the most then enter step S54, if it is not, then return to step S51;
Step S54, runs Profibus-DP service subprogram, returns to step S51.
One the most according to claim 5 programmable double on-site bus conversion method, it is characterised in that described NCUC takes Business subprogram includes:
Step S61, reads NCUC data, it is judged that whether described first switch is connected, the most then enter step S62, if it is not, then Enter step S63;
The described NCUC data read are converted into serial port protocol data, and are sent to serial communication modular (4), enter by step S62 Enter step S66;
Step S63, it is judged that whether described second switch is connected, the most then enter step S64, if it is not, then enter step S65;
The described NCUC data read are converted into network interface protocol data, and are sent to network interface communication module (5), enter by step S64 Enter step S66;
The described NCUC data read are converted into Profibus-DP protocol data, and are sent to Profibus-DP by step S65 Bus communication module (3), enters step S66;
Step S66, subprogram returns.
One the most according to claim 5 programmable double on-site bus conversion method, it is characterised in that described Profibus-DP service subprogram includes:
Step S71, reads Profibus-DP data, it is judged that whether described 3rd switch is connected, the most then enter step S72, If it is not, then enter step S73;
The described Profibus-DP data read are converted into serial port protocol data, and are sent to serial communication mould by step S72 Block (4), enters step S76;
Step S73, it is judged that whether described 4th switch is connected, the most then enter step S74, if it is not, then enter step S75;
The described Profibus-DP data read are converted into network interface protocol data, and are sent to network interface communication mould by step S74 Block (5), enters step S76;
The described Profibus-DP data read are converted into NCUC protocol data, and it are logical to be sent to NCUC bus by step S75 Letter module (2), enters step S76;
Step S76, subprogram returns.
One the most according to claim 5 programmable double on-site bus conversion method, it is characterised in that described serial ports takes Business subprogram includes:
Step S81, reads serial data, it is judged that whether described first switch is connected, the most then enter step S82, if it is not, then Enter step S83;
Step S82, is converted into NCUC protocol data by the described serial data read, and is sent to NCUC bus communication module (2), step S84 is entered;
Step S83, is converted into Profibus-DP protocol data by the described serial data read, and is sent to Profibus-DP Bus communication module (3), enters step S84;
Step S84, subprogram returns.
One the most according to claim 5 programmable double on-site bus conversion method, it is characterised in that described network interface takes Business subprogram includes:
Step S91, reads network interface data, it is judged that whether described second switch is connected, the most then enter step S92, if it is not, then Enter step S93;
The described network interface data read are converted into NCUC protocol data, and are sent to NCUC bus communication module by step S92 (2), step S94 is entered;
The described network interface data read are converted into Profibus-DP protocol data, and are sent to Profibus-DP by step S93 Bus communication module (3), enters step S94;
Step S94, subprogram returns.
CN201610524243.4A 2016-07-06 2016-07-06 A kind of programmable double on-site bus translation interface and method Active CN106161168B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610524243.4A CN106161168B (en) 2016-07-06 2016-07-06 A kind of programmable double on-site bus translation interface and method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610524243.4A CN106161168B (en) 2016-07-06 2016-07-06 A kind of programmable double on-site bus translation interface and method

Publications (2)

Publication Number Publication Date
CN106161168A true CN106161168A (en) 2016-11-23
CN106161168B CN106161168B (en) 2019-10-08

Family

ID=58061692

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610524243.4A Active CN106161168B (en) 2016-07-06 2016-07-06 A kind of programmable double on-site bus translation interface and method

Country Status (1)

Country Link
CN (1) CN106161168B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107171920A (en) * 2017-05-03 2017-09-15 华中科技大学 A kind of bus gateway apparatus for being used to realize NCUC and POWERLINK interconnections
CN112436988A (en) * 2020-10-23 2021-03-02 武汉华中数控股份有限公司 Device for converting standard Ethernet to NCUC field bus protocol and implementation method
CN113232597A (en) * 2021-06-16 2021-08-10 上汽大众汽车有限公司 A ETC mobile unit that is used for on-vehicle interface of ECT equipment and has electron anti-disassembly function
CN114003536A (en) * 2021-10-19 2022-02-01 武汉华中数控股份有限公司 Device and system for converting NCUC field bus into Anchuan M3 bus protocol

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2004042674A1 (en) * 2002-11-04 2004-05-21 Endress + Hauser Gmbh + Co. Kg Field device for process automation for recording and/or influencing a process variable, and comprising at least two communications interfaces
CN101059691A (en) * 2007-05-24 2007-10-24 北京天航信民航通信网络发展有限公司 Automatic metering controller
CN101345629A (en) * 2008-08-21 2009-01-14 武汉科技大学 Double on-site bus interface converter
CN101789557A (en) * 2010-01-29 2010-07-28 上海微小卫星工程中心 Multifunctional interface conversion device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2004042674A1 (en) * 2002-11-04 2004-05-21 Endress + Hauser Gmbh + Co. Kg Field device for process automation for recording and/or influencing a process variable, and comprising at least two communications interfaces
CN101059691A (en) * 2007-05-24 2007-10-24 北京天航信民航通信网络发展有限公司 Automatic metering controller
CN101345629A (en) * 2008-08-21 2009-01-14 武汉科技大学 Double on-site bus interface converter
CN101789557A (en) * 2010-01-29 2010-07-28 上海微小卫星工程中心 Multifunctional interface conversion device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
刘斌: "NCUC_Bus现场总线与USB总线转换技术研究及应用", 《中国优秀硕士学位论文全文数据库》 *

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107171920A (en) * 2017-05-03 2017-09-15 华中科技大学 A kind of bus gateway apparatus for being used to realize NCUC and POWERLINK interconnections
CN112436988A (en) * 2020-10-23 2021-03-02 武汉华中数控股份有限公司 Device for converting standard Ethernet to NCUC field bus protocol and implementation method
CN113232597A (en) * 2021-06-16 2021-08-10 上汽大众汽车有限公司 A ETC mobile unit that is used for on-vehicle interface of ECT equipment and has electron anti-disassembly function
CN114003536A (en) * 2021-10-19 2022-02-01 武汉华中数控股份有限公司 Device and system for converting NCUC field bus into Anchuan M3 bus protocol

Also Published As

Publication number Publication date
CN106161168B (en) 2019-10-08

Similar Documents

Publication Publication Date Title
CN106161168A (en) A kind of programmable double on-site bus translation interface and method
CN102185753B (en) Device for realizing dual-backup switching of Ethernet link inside communication equipment
CN101963945B (en) Signal connecting apparatus and method
CN201145896Y (en) USB interface insulation converter
CN108011694A (en) A kind of efficient data exchange method based on FC
CN102255796A (en) System and method for transferring different types of streaming and packetized data across an Ethernet transmission line using a frame and packet structure demarcated with Ethernet coding violations
CN1905558B (en) Individualized ethernet exchange plate and data exchanging method
CN101616048A (en) The multiport Ethernet transceiver
CN100469046C (en) System, method and device for autonegotiation
CN100534040C (en) Ethernet optical terminal adapter and ethernet transmission method
CN113325768B (en) Communication control device and method of industrial control system and industrial control system
CN103516669A (en) Adaptive multi-protocol converter
CN112199316B (en) Configuration method and communication method of chain-type master-slave serial port communication device
CN102907061B (en) A kind of system and method for the treatment of data
CN103297163A (en) Method and device for simulating PCM communication through GPIO ports
CN103186126A (en) Interface device and method used for connecting distributed control system and intelligent device
CN103124233B (en) A kind of signal relay system and its implementation
CN201910048U (en) LVDS (Low Voltage Differential Signaling) node module
CN201569740U (en) Data transmission node of self-configuration universal towed line array
CN201054609Y (en) High-speed industrial real time communication bus system based on optical fiber
CN100468289C (en) Mobile storage method, system and equipment with wireless communication control function
CN201584993U (en) GFP type 4E1/Ethernet protocol converter
CN205754407U (en) A kind of switch with three kinds of Ethernet transmission ports
CN101644766A (en) Data transmission node for self-configured universal towed linear array
CN102368733B (en) Novel industrial router

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant