CN106161168B - 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 PDFInfo
- Publication number
- CN106161168B CN106161168B CN201610524243.4A CN201610524243A CN106161168B CN 106161168 B CN106161168 B CN 106161168B CN 201610524243 A CN201610524243 A CN 201610524243A CN 106161168 B CN106161168 B CN 106161168B
- Authority
- CN
- China
- Prior art keywords
- communication
- ncuc
- profibus
- 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.)
- Active
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L12/00—Data switching networks
- H04L12/28—Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
- H04L12/40—Bus networks
- H04L12/40006—Architecture of a communication node
- H04L12/40032—Details regarding a bus interface enhancer
-
- G—PHYSICS
- G05—CONTROLLING; REGULATING
- G05B—CONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
- G05B19/00—Programme-control systems
- G05B19/02—Programme-control systems electric
- G05B19/04—Programme control other than numerical control, i.e. in sequence controllers or logic controllers
- G05B19/042—Programme control other than numerical control, i.e. in sequence controllers or logic controllers using digital processors
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L12/00—Data switching networks
- H04L12/28—Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
- H04L12/40—Bus networks
- H04L12/40169—Flexible bus arrangements
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L12/00—Data switching networks
- H04L12/28—Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
- H04L12/40—Bus networks
- H04L2012/40208—Bus networks characterized by the use of a particular bus standard
- H04L2012/40221—Profibus
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L12/00—Data switching networks
- H04L12/28—Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
- H04L12/40—Bus networks
- H04L2012/40208—Bus networks characterized by the use of a particular bus standard
- H04L2012/40254—Actuator 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 methods, support the interface arrangement of two kinds of fieldbus of NCUC and Profibus-DP conversion, the interface switching device can make the serial communication equipment of access or network interface communication equipment carry out reliable communication with the equipment for supporting NCUC or Profibus-DP fieldbus respectively simultaneously, realize heterogeneous network internetworking.Present invention employs STM32F103RET6 microcontrollers, are 32 high-performance microcontrollers, using dedicated Profibus-DP protocol chip, realize user data to the communication of Profibus-DP bus, processing speed is faster.Realize serial equipment, the function that network port device is linked into NCUC fieldbus, Profibus-DP fieldbus is communicated.Have the characteristics that processing speed is fast, strong flexibility, reliable communications, industry spot NCUC, Profibus-DP slave station design complexities can be reduced, reduce user using NCUC, Profibus-DP technical threshold and development cost, be conducive to that product is integrated and product rapid development.
Description
Technical field
The invention belongs to field bus technique fields, and in particular to a kind of programmable double on-site bus translation interface and side
Method.
Background technique
The generation of fieldbus plays very important effect to industrial expansion, has very to the growth of national economy
Important influence.Currently, there is more than 40 kinds of fieldbus with their own characteristics in the world, these fieldbus realize live automation
Multipoint digital communication between equipment, also achieves equipment and extraneous information exchange.Market at home, Profibus-DP,
NCUC is two kinds of more representational bus protocols.Study field bus technique, development support multiple fieldbus is converted
Interface equipment has a very important significance.
Currently, the design based on fieldbus translation interface, mainly include the following types: serial equipment is to single fieldbus
Conversion;Network port device is converted to single fieldbus;Conversion etc. between Different field bus.It is assumed that equipment A and equipment B distinguishes
Using two kinds of Different field bussing techniques.Equipment A will be in communication with each other with equipment B, then one is needed between equipment A, B
Bus conversion device;Another equipment C will be communicated with above equipment A, B, then equipment C just has to realize that both are existing
Field bus technology, and equipment C (universal most of) comes with serial ports or network interface communication interface under normal circumstances, equipment C is wanted
Realization, which communicates to re-start with equipment A, B, to be designed and developed, and allows for the application of equipment C in this way with limitation, and without
Ji.Therefore, exploitation has multibus conversion and can support the interface of the conversion of general-purpose interface such as serial ports and network interface communication equipment
Device just seems very necessary.
Summary of the invention:
In order to overcome the defect of above-mentioned background technique, the present invention provide a kind of programmable double on-site bus translation interface and
Method, realizes heterogeneous network internetworking, and processing speed is fast, strong flexibility, reliable communications.
In order to solve the above-mentioned technical problem the technical scheme adopted by the invention is as follows:
A kind of programmable double on-site bus translation interface, comprising: 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 select switch module;
Controller includes the first communication control module, for controlling between NCUC bus communication module and serial communication modular
Two-way communication;Second communication control module, it is two-way between NCUC bus communication module and network interface communication module for controlling
Communication;Third communication control module, it is two-way between Profibus-DP bus communication module and serial communication modular for controlling
Communication;Fourth communication control module, it is two-way between Profibus-DP bus communication module and network interface communication module for controlling
Communication;Fifth communication control module, for controlling between NCUC bus communication module and Profibus-DP bus communication module
Two-way communication;
Equipment selection switch module includes being used, respectively, to initiate the first communication control module, the second communication control module, the
Three communication control modules, the first switch of fourth communication control module and fifth communication control module, second switch, third are opened
It closes, the 4th switch and the 5th switchs.
Preferably, NCUC bus communication module includes sequentially connected fpga chip, Ethernet chip, first network transformation
Device and connector, fpga chip are also connected with controller, and connector is for connecting NCUC bus network;
Profibus-DP bus communication module includes that sequentially connected SPC3 controller, isolation circuit and the first data connect
Mouth connector, SPC3 controller are also connected with controller, and the first data interface connector is for connecting Profibus-DP bus network
Network;
Serial communication modular includes electrical level transferring chip interconnected and the second data interface connector, level conversion core
Piece is also connected with controller, and the second data interface connector is for connecting serial ports field device or instrument;
Network interface communication module includes Ethernet transceiving chip and the second network transformer interconnected, and Ethernet receives and dispatches core
Piece is also attached to controller, and the second network transformer is for connecting network interface field device or instrument.
Preferably, the first data interface connector and the second data interface connector are 9 needle D type data interface connectors,
Electrical level transferring chip is MAX3232 electrical level transferring chip.
The present invention also provides a kind of methods for carrying out programmable double on-site bus conversion using above-mentioned interface:
Equipment selects switch module to obtain the key selection signal that user inputs:
If first switch is selected, start the first communication control module control NCUC bus communication module and serial communication
Two-way communication between module;
If second switch is selected, starts the second communication control module control NCUC bus communication module and communicated with network interface
Two-way communication between module;
If third switch selected, start the third communication control module control Profibus-DP bus communication module with
Two-way communication between serial communication modular;
If the 4th switch selected, start fourth communication control module control Profibus-DP bus communication module with
Two-way communication between network interface communication module;
If the 5th switch selected, start fifth communication control module control NCUC bus communication module with
Two-way communication between Profibus-DP bus communication module.
Preferably, the two-way between the first communication control module control NCUC bus communication module and serial communication modular
The method of letter are as follows:
Step S11, whether inquiry NCUC bus communication module receives data, if so, S12 is entered step, 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, if so, S14 is entered step, if it is not, then returning 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 are as follows:
Step S21, whether inquiry NCUC bus communication module receives data, if so, S22 is entered step, 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, if so, S24 is entered step, if it is not, then returning 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 are as follows:
Step S31, whether inquiry Profibus-DP bus communication module receives data, if so, S32 is entered step,
If it is not, then entering step S33;
Step S32 runs Profibus-DP service subprogram, enters step S33;
Step S33, whether inquiry serial communication modular receives data, if so, S34 is entered step, if it is not, then returning 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 are as follows:
Step S41, whether inquiry Profibus-DP bus communication module receives data, if so, S42 is entered step,
If it is not, then entering step S43;
Step S42 runs Profibus-DP service subprogram, enters step S43;
Step S43, whether inquiry network interface communication module receives data, if so, S44 is entered step, if it is not, then returning to
Step S41;
Step S44 runs network interface service subprogram, returns to step S41;
Fifth communication control module controls double between NCUC bus communication module and Profibus-DP bus communication module
To the method for communication are as follows:
Step S51, whether inquiry NCUC bus communication module receives data, if so, S52 is entered step, 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, if so, S54 is entered step,
If it is not, then returning to step S51;
Step S54 runs Profibus-DP service subprogram, returns to step S51.
Preferably, NCUC service subprogram includes:
Step S61 reads NCUC data, judges whether first switch is connected, if so, S62 is entered step, if it is not, then
Enter step S63;
Step S62 by the NCUC data conversion of reading at serial ports protocol data, and is sent to serial communication modular, enters
Step S66;
Step S63, judges whether second switch is connected, if so, S64 is entered step, if it is not, then entering step S65;
Step S64 by the NCUC data conversion of reading at network interface protocol data, and is sent to network interface communication module, enters
Step S66;
Step S65 by the NCUC data conversion of reading at Profibus-DP protocol data, and is sent to Profibus-DP
Bus communication module, enters step S66;
Step S66, subprogram return.
Preferably, Profibus-DP service subprogram includes:
Step S71 reads Profibus-DP data, judges whether third switch is connected, if so, S72 is entered step,
If it is not, then entering step S73;
Step S72 by the Profibus-DP data conversion of reading at serial ports protocol data, and is sent to serial communication mould
Block enters step S76;
Step S73, judges whether the 4th switch is connected, if so, S74 is entered step, if it is not, then entering step S75;
Step S74 by the Profibus-DP data conversion of reading at network interface protocol data, and is sent to network interface communication mould
Block enters step S76;
Step S75, by the Profibus-DP data conversion of reading at NCUC protocol data, and it is logical to be sent to NCUC bus
Believe module, enters step S76;
Step S76, subprogram return.
Preferably, serial port service subprogram includes:
Step S81 reads serial data, judges whether first switch is connected, if so, S82 is entered step, if it is not, then
Enter step S83;
The serial data of reading is converted into NCUC protocol data by step S82, and is sent to NCUC bus communication module,
Enter step S84;
The serial data of reading is converted into Profibus-DP protocol data, and is sent to Profibus-DP by step S83
Bus communication module, enters step S84;
Step S84, subprogram return.
Preferably, network interface service subprogram includes:
Step S91 reads network interface data, judges whether second switch is connected, if so, S92 is entered step, if it is not, then
Enter step S93;
The network interface data of reading is converted into NCUC protocol data by step S92, and is sent to NCUC bus communication module,
Enter step S94;
The network interface data of reading is converted into Profibus-DP protocol data, and is sent to Profibus-DP by step S93
Bus communication module, enters step S94;
Step S94, subprogram return.
The beneficial effects of the present invention are: the present invention two kinds of fieldbus conversions of support NCUC and Profibus-DP connect
Mouthful device, at the same the interface switching device can make access serial communication equipment or network interface communication equipment respectively with support NCUC or
The equipment of Profibus-DP fieldbus carries out reliable communication, realizes heterogeneous network internetworking.Present invention employs
STM32F103RET6 microcontroller is 32 high-performance microcontrollers, real using dedicated Profibus-DP protocol chip
Current user data is to the communication of Profibus-DP bus, and processing speed is faster.The present invention using 32 high-performance microcontrollers and
Using the NCUC fieldbus communications module realized based on FPGA, the communication of user data to NCUC bus is realized.Realize string
The function that jaws equipment, network port device are linked into NCUC fieldbus, Profibus-DP fieldbus is communicated, at the same it is also real
The function that NCUC fieldbus and Profibus-DP fieldbus are in communication with each other is showed.With processing speed fast, strong flexibility,
The features such as reliable communications, it is possible to reduce industry spot NCUC, Profibus-DP slave station design complexities reduce user's use
NCUC, Profibus-DP technical threshold and development cost, are conducive to that product is integrated and product rapid development.
Detailed description of the invention
Fig. 1 is the general structure schematic diagram of interface described in the embodiment of the present invention one;
Fig. 2 is one NCUC bus communication inside modules structure of the embodiment of the present invention and illustrates with controller connection structure
Figure;
Fig. 3 is the internal module structural schematic diagram of one fpga chip of the embodiment of the present invention;
Fig. 4 is one Profibus-DP bus communication inside modules structure of the embodiment of the present invention and connect knot with controller
Structure schematic diagram;
Fig. 5 be one serial communication inside modules structure of the embodiment of the present invention and with controller attachment structure schematic diagram;
Fig. 6 be one network interface communication module internal structure of the embodiment of the present invention and with controller attachment structure schematic diagram;
Fig. 7 is one equipment of embodiment of the present invention selection switch module and controller attachment structure schematic diagram;
Fig. 8 is the two-way communication stream between two NCUC bus communication module of the embodiment of the present invention and serial communication modular
Cheng Tu;
Fig. 9 is the two-way communication stream between two NCUC bus communication module of the embodiment of the present invention and network interface communication module
Cheng Tu;
Figure 10 is the two-way communication side of two Profibus-DP bus communication module and serial communication modular of the embodiment of the present invention
Method flow chart;
Figure 11 is the two-way communication side of two Profibus-DP bus communication module and network interface communication module of the embodiment of the present invention
Method flow chart;
Figure 12 is the two-way of two NCUC bus communication modules and Profibus-DP bus communication module of the embodiment of the present invention
Believe method flow diagram;
Figure 13 is two NCUC service subprogram flow chart of the embodiment of the present invention;
Figure 14 is two Profibus-DP service subprogram flow chart of the embodiment of the present invention;
Figure 15 is two serial port service subroutine flow chart of the embodiment of the present invention;
Figure 16 is two network interface service subprogram flow chart of the embodiment of the present invention.
In figure, 1- controller, 2-NCUC bus communication module, 2.1-FPGA chip, 2.2- Ethernet chip, 2.3-
One network transformer, 2.4- connector, 3-Profibus-DP bus communication module, 3.1-SPC3 controller, 3.2- isolation electricity
Road, the first data interface connector of 3.3-, 4- serial communication modular, 4.1- electrical level transferring chip, the second data-interface of 4.2- connect
Connect device, 5- network interface communication module, 5.1- Ethernet transceiving chip, the second network transformer of 5.2-, 6- equipment selection switching molding
Block.
Specific embodiment
The present invention is described further with reference to the accompanying drawings and examples.
Embodiment one
As shown in Figure 1, a kind of programmable double on-site bus translation interface, comprising: controller 1, and it is connected to control
The NCUC bus communication module 2 of device 1, Profibus-DP bus communication module 3, serial communication modular 4,5 and of network interface communication module
Equipment selects switch module 6;Controller 1 in the present embodiment is STM32F103RET6 microcontroller 1.
Controller 1 includes the first communication control module, for controlling NCUC bus communication module 2 and serial communication modular 4
Between two-way communication;Second communication control module, for controlling between NCUC bus communication module 2 and network interface communication module 5
Two-way communication;Third communication control module, for control Profibus-DP bus communication module 3 and serial communication modular 4 it
Between two-way communication;Fourth communication control module, for controlling Profibus-DP bus communication module 3 and network interface communication module 5
Between two-way communication;Fifth communication control module, it is logical for controlling NCUC bus communication module 2 and Profibus-DP bus
Believe the two-way communication between module 3;
Equipment selection switch module 6 includes being used, respectively, to initiate the first communication control module, the second communication control module, the
Three communication control modules, the first switch of fourth communication control module and fifth communication control module, second switch, third are opened
It closes, the 4th switch and the 5th switchs.
PA0 pin, PA1 pin, PA2 pin, PA3 pin and the PA8 pin difference of STM32F103RET6 microcontroller 1
It is logical for the first communication control module, the second communication control module, third communication control module, fourth communication control module and the 5th
Believe the triggering pin of control module.
As shown in fig. 7, the switch first switch Key1 of equipment selection switch module 6, second switch Key2, third switch
Key3, the 4th switch Key4 and the 5th switch Key5 draw with PA0 pin, the PA1 of STM32F103RET6 microcontroller 1 respectively
Foot, PA2 pin, PA3 pin and PA8 pin are sequentially connected.
As shown in Fig. 2, NCUC bus communication module 2 include sequentially connected fpga chip 2.1, Ethernet chip 2.2,
First network transformer 2.3 and connector 2.4, fpga chip 2.1 are also connected with controller 1, and connector 2.4 is for connecting NCUC
Bus network,
Fpga chip 2.1 selects CycloneII Series FPGA chip 2.1, model EP2C8T144C8, Ethernet chip
2.2 select Industrial Ethernet chip 2.2KSZ8721BLI, the model HX1188NL of first network transformer 2.3, connector
2.4 model 3E106.
As shown in figure 3, inside the fpga chip 2.1 of model EP2C8T144C8 realize include SPI communication interface, SPI with
NCUC communication conversion, NCUC communication interface part, SPI communication interface realize SPI protocol communication, and NCUC communication interface is realized
NCUC protocol communication;SPI communicates conversion with NCUC and realizes that the conversion between two agreements connects.As for NCUC protocol contents
It is packaged and parsing is then completed in STM32.
I/O pin CS/40, SCK/41, SI/42, SO/43 of fpga chip 2.1EP2C8T144C8 with
Corresponding pin PA4, PA5, the PA 6 of STM32F103RET6 microcontroller 1, PA7 connection, fpga chip
I/O pin R1V/44, R1_1/45, R1_0/47 and bus data receiving side Industrial Ethernet chip of 2.1EP2C8T144C8
Corresponding pin RXDV, RXD1, RXD0 connection of 2.2KSZ8721BLI, the I/O pin of fpga chip 2.1EP2C8T144C8
T2E/57, T2_1/58, T2_0/59 pin corresponding with bus data sending side Industrial Ethernet chip 2.2KSZ8721BLI
TXEN, TXD1, TXD0 connection, I/O pin PRST/142, PCLK/143 and number of buses of FPGA chip 2.1EP2C8T144C8
According to reception, corresponding pin RST, REFCLK connection of sending side Industrial Ethernet chip 2.2KSZ8721BLI, bus data
Pin TX+, TX-, RX+, RX- and bus data receiving side network of receiving side Industrial Ethernet chip 2.2KSZ8721BLI becomes
Pin TD+, TD-, RD+, RD- of depressor HX1188NL is connected, bus data sending side Industrial Ethernet chip
Pin TX+, TX-, RX+, RX- of 2.2KSZ8721BLI and the pin TD of bus data transmission side network transformer HX1188NL
+, TD-, RD+, RD- connection, pin TX+, TX-, RX+, RX- and bus of bus data receiving side network transformer HX1188NL
Pin TX+, TX-, RX+, RX- of data receiver side 3E106 connector 2.4 are connected, bus data transmission side network transformer
Pin TX+, TX-, RX+, RX- of HX1188NL and pin TX+, TX-, RX of bus data sending side 3E106 connector 2.4
+, RX- connection.
As shown in figure 4, Profibus-DP bus communication module 3 includes sequentially connected SPC3 controller 3.1, isolation electricity
Road 3.2 and the first data interface connector 3.3, SPC3 controller 3.1 are 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 9 needle D type data interface connectors (can abbreviation DB9),
Pin DB [0...7], AB [0...7], the INT0 of SPC3 controller 3.1 are opposite with STM32F103RET6 microcontroller 1 respectively
Pin PB [0 ... 7], the PC [0 ... 7], PC8 connection answered, pin RD, WR, ALE of SPC3 controller 3.1 with
STM32F103RET6 microcontroller 1 corresponding pin PC12, PC13, PC9 connection, the pin RXD of SPC3 controller 3.1,
Pin TXD, RXD, RTS of TXD, RTS and isolation circuit 3.2ADM2486 chip connection;Isolation circuit 3.2ADM2486 chip
Pin A, B, DE connect with the pin 8,3,4 of the first data interface connector 3.3DB9 plug.
As shown in figure 5, serial communication modular 4 includes that electrical level transferring chip 4.1 interconnected and the second data-interface connect
Device 4.2 is connect, electrical level transferring chip 4.1 is also connected with controller 1, and the second data interface connector 4.2 is set for connecting serial ports scene
Standby or instrument;
In the present embodiment, the electrical level transferring chip 4.1 of serial communication modular 4 selects MAX3232 chip, and the second data connect
Mouth connector 4.2 also selects 9 needle D type data interface connectors 2.4 (abbreviation DB9).
Pin R1OUT, T1OUT and STM32F103RET6 microcontroller 1 of electrical level transferring chip 4.1MAX3232
PA10, PA9 are correspondingly connected with;Pin R1IN, T1OUT and the second data interface connector of electrical level transferring chip 4.1MAX3232
The pin 3,2 of 4.2DB9 plug connects.
As shown in fig. 6, network interface communication module 5 includes Ethernet transceiving chip 5.1 interconnected and the second network transformation
Device 5.2, Ethernet transceiving chip 5.1 are also attached to controller 1, and the second network transformer 5.2 is for connecting network interface field device
Or instrument.
In the present embodiment, the model ENC28J60 of Ethernet transceiving chip 5.1, the model of the second network transformer 5.2
For HR911105A composition.Pin SO, SI, SCK, CS of Ethernet transceiving chip 5.1ENC28J60 chip with
STM32F103RET6 microcontroller 1 corresponding PB14, PB15, PB13, PB12 connection;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+ connection.
The working principle of interface described in the present embodiment is: NCUC bus communication module 2 realizes NCUC bus protocol, and (this is logical
Believe that the FPGA in module realizes that NCUC bus functionality, SPI communication function, STM32F103RET6 microcontroller pass through SPI and NCUC
Bus carries out data interaction), Profibus-DP bus communication module 3 realizes Profibus-DP bus protocol, serial communication mould
Block 4 handles serial port protocol, and STM32F103RET6 microcontroller 1 and network interface communication module 5 handle network protocol.Meanwhile
Software realization serial ports, network interface in STM32F103RET6 microcontroller 1 and the association between NUUC bus, Profibus-DP bus
View conversion.Equipment selects five first switch Key1, second switch Key2, third switch Key3, the 4th switch of switch module 6
Key4, the 5th switch Key5 control the switching of five kinds of communication patterns.When selecting first switch Key1, NCUC network and bottom string
Jaws equipment two-way communication;When selecting second switch Key2, NCUC network and the two-way communication of bottom network port device;Selection third is opened
When closing Key3, Profibus-DP network and the two-way communication of bottom serial equipment;When selecting the 4th switch Key4, Profibus-
DP network and the two-way communication of bottom network port device;When selecting the 5th switch Key5, NCUC network and Profibus-DP network are double
To communication.
Embodiment two
The method that the present embodiment carries out programmable double on-site bus conversion using the interface as described in embodiment one:
System parameter is arranged in step S1, initializes to each communication module;
Step S2, equipment select switch module 6 to obtain the key selection signal that user inputs;
Step S3, judges whether user selects any of five switches of equipment selection switch module 6, if so,
S4 is entered step, if it is not, then returning to step S2;
Step S4 judges that the switch of user's selection is first switch Key1, second switch Key2, third switch Key3, the
Four switch Key4 or the 5th switch Key5;
If first switch Key1 is selected, start the first communication control module control NCUC bus communication module 2 and string
Two-way communication between port communications module 4;
If second switch Key2 is selected, start the second communication control module control NCUC bus communication module 2 and net
Two-way communication between port communications module 5;
If third switch Key3 is selected, start third communication control module control Profibus-DP bus communication mould
Two-way communication between block 3 and serial communication modular 4;
If the 4th switch Key4 is selected, start fourth communication control module control Profibus-DP bus communication mould
Two-way communication between block 3 and network interface communication module 5;
If the 5th switch Key5 is selected, start fifth communication control module control NCUC bus communication module 2 with
Two-way communication between Profibus-DP bus communication module 3;
Equipment one of only allows to carry out during the work time the selection of mode button and is only five kinds of modes.
When first switch Key1 is selected, the first communication control module controls NCUC bus communication module 2 and serial ports is logical
Two-way communication between letter module 4 is activated, as shown in figure 8, its communication means are as follows:
Step S11, whether inquiry NCUC bus communication module 2 receives data, if so, S12 is entered step, 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, if so, S14 is entered step, if it is not, then returning
To step S11;
Step S14 runs serial port service subprogram, returns to step S11;
When second switch Key2 is selected, the second communication control module controls NCUC bus communication module 2 and network interface is logical
Two-way communication between letter module 5 is activated, as shown in figure 9, communication means are as follows:
Step S21, whether inquiry NCUC bus communication module 2 receives data, if so, S22 is entered step, 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, if so, S24 is entered step, if it is not, then returning
To step S21;
Step S24 runs network interface service subprogram, returns to step S21;
When third switch Key3 is selected, third communication control module controls Profibus-DP bus communication module 3
Two-way communication between serial communication modular 4 is activated, as shown in Figure 10, the method for communication are as follows:
Step S31, whether inquiry Profibus-DP bus communication module 3 receives data, if so, entering step
S32, if it is not, then entering step S33;
Step S32 runs Profibus-DP service subprogram, enters step S33;
Step S33, whether inquiry serial communication modular 4 receives data, if so, S34 is entered step, if it is not, then returning
To step S31;
Step S34 runs serial port service subprogram, returns to step S31;
When the 4th switch Key4 is selected, fourth communication control module controls Profibus-DP bus communication module 3
Two-way communication between network interface communication module 5 is activated, as shown in Figure 11, the method for communication are as follows:
Step S41, whether inquiry Profibus-DP bus communication module 3 receives data, if so, entering step
S42, if it is not, then entering step S43;
Step S42 runs Profibus-DP service subprogram, enters step S43;
Step S43, whether inquiry network interface communication module 5 receives data, if so, S44 is entered step, if it is not, then returning
To step S41;
Step S44 runs network interface service subprogram, returns to step S41;
When the 5th switch Key5 is selected, fifth communication control module control NCUC bus communication module 2 with
Two-way communication between Profibus-DP bus communication module 3 is activated, as shown in figure 12, the method for communication are as follows:
Step S51, whether inquiry NCUC bus communication module 2 receives data, if so, S52 is entered step, 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, if so, entering step
S54, if it is not, then returning 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, judges whether first switch is connected, if so, S62 is entered step, if it is not, then
Enter step S63;
Step S62 by the NCUC data conversion of reading at serial ports protocol data, and is sent to serial communication modular 4, enters
Step S66;
Step S63, judges whether second switch is connected, if so, S64 is entered step, if it is not, then entering step S65;
Step S64 by the NCUC data conversion of reading at network interface protocol data, and is sent to network interface communication module 5, enters
Step S66;
Step S65 by the NCUC data conversion of reading at Profibus-DP protocol data, and is sent to Profibus-DP
Bus communication module 3, enters step S66;
Step S66, subprogram return.
As shown in figure 14, Profibus-DP service subprogram includes:
Step S71 reads Profibus-DP data, judges whether third switch is connected, if so, S72 is entered step,
If it is not, then entering step S73;
Step S72 by the Profibus-DP data conversion of reading at serial ports protocol data, and is sent to serial communication mould
Block 4, enters step S76;
Step S73, judges whether the 4th switch is connected, if so, S74 is entered step, if it is not, then entering step S75;
Step S74 by the Profibus-DP data conversion of reading at network interface protocol data, and is sent to network interface communication mould
Block 5, enters step S76;
Step S75, by the Profibus-DP data conversion of reading at NCUC protocol data, and it is logical to be sent to NCUC bus
Believe module 2, enters step S76;
Step S76, subprogram return.
As shown in figure 15, serial port service subprogram includes:
Step S81 reads serial data, judges whether first switch is connected, if so, S82 is entered step, if it is not, then
Enter step S83;
The serial data of reading is converted into NCUC protocol data by step S82, and is sent to NCUC bus communication module
2, enter step S84;
The serial data of reading is converted into Profibus-DP protocol data, and is sent to Profibus-DP by step S83
Bus communication module 3, enters step S84;
Step S84, subprogram return.
As shown in figure 16, network interface service subprogram includes:
Step S91 reads network interface data, judges whether second switch is connected, if so, S92 is entered step, if it is not, then
Enter step S93;
The network interface data of reading is converted into NCUC protocol data by step S92, and is sent to NCUC bus communication module
2, enter step S94;
The network interface data of reading is converted into Profibus-DP protocol data, and is sent to Profibus-DP by step S93
Bus communication module 3, enters step S94;
Step S94, subprogram return.
It should be understood that for those of ordinary skills, it can be modified or changed according to the above description,
And all these modifications and variations should all belong to the protection domain of appended claims of the present invention.
Claims (8)
1. a kind of programmable double on-site bus translation interface characterized by comprising controller (1), and be connected to described
The 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 selection switch module (6);
The controller (1) includes the first communication control module, for controlling the NCUC bus communication module (2) and the string
Two-way communication between port communications module (4);Second communication control module, for controlling the NCUC bus communication module (2)
With the two-way communication between the network interface communication module (5);Third communication control module, for controlling the Profibus-DP
Two-way communication between bus communication module (3) and the serial communication modular (4);Fourth communication control module, for controlling
Two-way communication between the Profibus-DP bus communication module (3) and the network interface communication module (5);Fifth communication control
Molding block, for controlling between the NCUC bus communication module (2) and the Profibus-DP bus communication module (3)
Two-way communication;
Equipment selection switch module (6) include be used, respectively, to initiate the first communication control module, the second communication control module,
Third communication control module, the first switch of fourth communication control module and fifth communication control module, second switch, third are opened
It closes, the 4th switch and the 5th switchs;
The NCUC bus communication module (2) includes sequentially connected fpga chip (2.1), Ethernet chip (2.2), the first net
Network transformer (2.3) and connector (2.4), the fpga chip (2.1) are also connected with the controller (1), the connector
(2.4) for connecting NCUC bus network;
The Profibus-DP bus communication module (3) includes sequentially connected SPC3 controller (3.1), isolation circuit (3.2)
With the first data interface connector (3.3), the SPC3 controller (3.1) is also connected with the controller (1), first data
Interface connector (3.3) is for connecting Profibus-DP bus network;
The serial communication modular (4) includes electrical level transferring chip interconnected (4.1) and the second data interface connector
(4.2), the electrical level transferring chip (4.1) is also connected with the controller (1), and the second data interface connector (4.2) is for connecting
Connect serial ports field device or instrument;
The network interface communication module (5) includes Ethernet transceiving chip (5.1) interconnected and the second network transformer
(5.2), the Ethernet transceiving chip (5.1) is also attached to the controller (1), and second network transformer (5.2) is used
In connection network interface field device or instrument;
The model EP2C8T144C8 of the fpga chip (2.1) realizes SPI and NCUC inside the fpga chip (2.1)
Conversion, SPI communication interface, NCUC communication interface part are communicated, SPI communication interface realizes SPI protocol communication, NCUC communication interface
Realize NCUC protocol communication;SPI communicates conversion with NCUC and realizes that the conversion between two agreements connects;In the controller (1)
The interior packing and parsing for completing NCUC protocol contents.
2. a kind of programmable double on-site bus translation interface according to claim 1, it is characterised in that: first number
It is 9 needle D type data interface connectors, the level according to interface connector (3.3) and second data interface connector (4.2)
Conversion chip (4.1) is MAX3232 electrical level transferring chip.
3. a kind of method for carrying out programmable double on-site bus conversion using interface as claimed in claim 1 or 2, feature exist
In:
Equipment selection switch module (6) obtains the key selection signal of user's input,
If first switch is selected, start the first communication control module control the NCUC bus communication module (2) with it is described
Two-way communication between serial communication modular (4);
If second switch is selected, start the second communication control module control the NCUC bus communication module (2) with it is described
Two-way communication between network interface communication module (5);
If third switch is selected, starts third communication control module and control the Profibus-DP bus communication module (3)
With the two-way communication between the serial communication modular (4);
If the 4th switch is selected, starts fourth communication control module and control the Profibus-DP bus communication module (3)
With the two-way communication between the network interface communication module (5);
If the 5th switch is selected, start fifth communication control module control the NCUC bus communication module (2) with it is described
Two-way communication between Profibus-DP bus communication module (3).
4. a kind of programmable double on-site bus conversion method according to claim 3, it is characterised in that:
First communication control module controls between the NCUC bus communication module (2) and the serial communication modular (4)
Two-way communication method are as follows:
Step S11, inquires whether the NCUC bus communication module (2) receives data, if so, S12 is entered step, if
It is no, then enter step S13;
Step S12 runs NCUC service subprogram, enters step S13;
Step S13, inquires whether the serial communication modular (4) receives data, if so, S14 is entered step, 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 between the NCUC bus communication module (2) and the network interface communication module (5)
Two-way communication method are as follows:
Step S21, inquires whether the NCUC bus communication module (2) receives data, if so, S22 is entered step, if
It is no, then enter step S23;
Step S22 runs NCUC service subprogram, enters step S23;
Step S23, inquires whether the network interface communication module (5) receives data, if so, S24 is entered step, if it is not, then
Return to step S21;
Step S24 runs network interface service subprogram, returns to step S21;
The third communication control module controls the Profibus-DP bus communication module (3) and the serial communication modular
(4) method of the two-way communication between are as follows:
Step S31, inquires whether the Profibus-DP bus communication module (3) receives data, if so, entering step
S32, if it is not, then entering step S33;
Step S32 runs Profibus-DP service subprogram, enters step S33;
Step S33, inquires whether the serial communication modular (4) receives data, if so, S34 is entered step, if it is not, then
Return to step S31;
Step S34 runs serial port service subprogram, returns to step S31;
The fourth communication control module controls the Profibus-DP bus communication module (3) and the network interface communication module
(5) method of the two-way communication between are as follows:
Step S41, inquires whether the Profibus-DP bus communication module (3) receives data, if so, entering step
S42, if it is not, then entering step S43;
Step S42 runs Profibus-DP service subprogram, enters step S43;
Step S43, inquires whether the network interface communication module (5) receives data, if so, S44 is entered step, if it is not, then
Return to step S41;
Step S44 runs network interface service subprogram, returns to step S41;
The fifth communication control module controls the NCUC bus communication module (2) and the Profibus-DP bus communication
The method of two-way communication between module (3) are as follows:
Step S51, inquires whether the NCUC bus communication module (2) receives data, if so, S52 is entered step, if
It is no, then enter step S53;
Step S52 runs NCUC service subprogram, enters step S53;
Step S53, inquires whether the Profibus-DP bus communication module (3) receives data, if so, entering step
S54, if it is not, then returning to step S51;
Step S54 runs Profibus-DP service subprogram, returns to step S51.
5. a kind of programmable double on-site bus conversion method according to claim 4, which is characterized in that the NCUC clothes
Business subprogram include:
Step S61 reads NCUC data, judges whether the first switch is connected, if so, S62 is entered step, if it is not, then
Enter step S63;
Step S62 by the NCUC data conversion of reading at serial ports protocol data, and is sent to serial communication modular (4), into
Enter step S66;
Step S63, judges whether the second switch is connected, if so, S64 is entered step, if it is not, then entering step S65;
Step S64 by the NCUC data conversion of reading at network interface protocol data, and is sent to network interface communication module (5), into
Enter step S66;
Step S65 by the NCUC data conversion of reading at Profibus-DP protocol data, and is sent to Profibus-DP
Bus communication module (3), enters step S66;
Step S66, subprogram return.
6. a kind of programmable double on-site bus conversion method according to claim 4, which is characterized in that described
Profibus-DP service subprogram includes:
Step S71 reads Profibus-DP data, judges whether the third switch is connected, if so, S72 is entered step,
If it is not, then entering step S73;
Step S72 by the Profibus-DP data conversion of reading at serial ports protocol data, and is sent to serial communication mould
Block (4), enters step S76;
Step S73, judges whether the 4th switch is connected, if so, S74 is entered step, if it is not, then entering step S75;
Step S74 by the Profibus-DP data conversion of reading at network interface protocol data, and is sent to network interface communication mould
Block (5), enters step S76;
Step S75, by the Profibus-DP data conversion of reading at NCUC protocol data, and it is logical to be sent to NCUC bus
Believe module (2), enters step S76;
Step S76, subprogram return.
7. a kind of programmable double on-site bus conversion method according to claim 4, which is characterized in that the serial ports clothes
Business subprogram include:
Step S81 reads serial data, judges whether the first switch is connected, if so, S82 is entered step, if it is not, then
Enter step S83;
The serial data of reading is converted into NCUC protocol data, and is sent to NCUC bus communication module by step S82
(2), S84 is entered step;
The serial data of reading is converted into Profibus-DP protocol data, and is sent to Profibus-DP by step S83
Bus communication module (3), enters step S84;
Step S84, subprogram return.
8. a kind of programmable double on-site bus conversion method according to claim 4, which is characterized in that the network interface clothes
Business subprogram include:
Step S91 reads network interface data, judges whether the second switch is connected, if so, S92 is entered step, if it is not, then
Enter step S93;
The network interface data of reading is converted into NCUC protocol data, and is sent to NCUC bus communication module by step S92
(2), S94 is entered step;
The network interface data of reading is converted into Profibus-DP protocol data, and is sent to Profibus-DP by step S93
Bus communication module (3), enters step S94;
Step S94, subprogram return.
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 CN106161168A (en) | 2016-11-23 |
CN106161168B true 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) |
Families Citing this family (4)
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 |
CN112436988B (en) * | 2020-10-23 | 2022-06-10 | 武汉华中数控股份有限公司 | 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 (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
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 |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
DE10251502A1 (en) * | 2002-11-04 | 2004-06-09 | Endress + Hauser Gmbh + Co. Kg | Field device for process automation for recording and / or influencing a process variable with at least two communication interfaces |
-
2016
- 2016-07-06 CN CN201610524243.4A patent/CN106161168B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
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)
Title |
---|
NCUC_Bus现场总线与USB总线转换技术研究及应用;刘斌;《中国优秀硕士学位论文全文数据库》;20130715;正文第8-10页 * |
Also Published As
Publication number | Publication date |
---|---|
CN106161168A (en) | 2016-11-23 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106161168B (en) | A kind of programmable double on-site bus translation interface and method | |
CN201145896Y (en) | USB interface insulation converter | |
CN102185753A (en) | Device for realizing dual-backup switching of Ethernet link inside communication equipment | |
CN108011694A (en) | A kind of efficient data exchange method based on FC | |
CN107831702B (en) | A kind of synchronous serial signal acquisition and control device based on gigabit Ethernet | |
CN1905558B (en) | Individualized ethernet exchange plate and data exchanging method | |
CN101951333A (en) | Digital home intelligent terminal control system | |
CN106170011B (en) | The system and method for multi-mode E1 interface business processing | |
CN102739290A (en) | Interactive terminal with power line carrier communication access function | |
CN110098541A (en) | The USB Hub and implementation method for having interface blind plugging function | |
CN201057654Y (en) | Universal gateway device with Bluetooth control function | |
CN201569740U (en) | Data transmission node of self-configuration universal towed line array | |
CN103268300B (en) | A kind of serial interface circuit of serial communication management server | |
CN214376432U (en) | Terminal RS485 and RS232 switching circuit are fused to platform district intelligence | |
CN205754407U (en) | A kind of switch with three kinds of Ethernet transmission ports | |
CN205049966U (en) | Intelligence touch screen scene panel based on bus link power supply technique | |
CN209375659U (en) | Optical module and optical communication equipment | |
CN203608219U (en) | Intelligent homeplug | |
CN106506304B (en) | Expansible communication system and method | |
CN207691822U (en) | Bi-directional digital communication system based on 4-20mA electric current loops | |
CN207560034U (en) | A kind of intelligent gateway applied to internal home network security system | |
CN208505481U (en) | A kind of infrared human body inductive pick-up | |
CN204465576U (en) | The on-the-spot integrated network system of YHOT | |
CN207117680U (en) | A kind of Internet of Things intercommunion platform | |
CN217607827U (en) | Intelligent gateway device for power distribution room |
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 |