CN101105692A - Programmable logic controller and its communication interface device and data transmitting method - Google Patents

Programmable logic controller and its communication interface device and data transmitting method Download PDF

Info

Publication number
CN101105692A
CN101105692A CNA2007100282741A CN200710028274A CN101105692A CN 101105692 A CN101105692 A CN 101105692A CN A2007100282741 A CNA2007100282741 A CN A2007100282741A CN 200710028274 A CN200710028274 A CN 200710028274A CN 101105692 A CN101105692 A CN 101105692A
Authority
CN
China
Prior art keywords
level conversion
data
communication
communication pattern
universal asynchronous
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
CNA2007100282741A
Other languages
Chinese (zh)
Other versions
CN100498611C (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.)
CO-TRUST TECHNOLOGIES Co Ltd
Original Assignee
CO-TRUST TECHNOLOGIES Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by CO-TRUST TECHNOLOGIES Co Ltd filed Critical CO-TRUST TECHNOLOGIES Co Ltd
Priority to CNB2007100282741A priority Critical patent/CN100498611C/en
Publication of CN101105692A publication Critical patent/CN101105692A/en
Application granted granted Critical
Publication of CN100498611C publication Critical patent/CN100498611C/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Communication Control (AREA)

Abstract

The invention provides a programmable logical controller communication interface device which comprises a general asynchronous transceiver, a physical interface sharing at least two communication modes, at least two level transfer units which are connected between the general asynchronous transceiver and the physical interface and are corresponding to different communication modes, a selection control unit which is used to acquire the communication mode between the programmable logical controller and an opposite end when receives and transmits data and implements level transfer of the general asynchronous transceiver by selecting the level transfer unit corresponding to the communication mode. With the programmable logical controller, the communication interface and the communication interface device in the invention, a plurality of communication modes are compatible based on the same physical interface; namely, communication is implemented through one of a plurality of communication modes (namely a plurality of serial connection protocol) and the opposite end connected with thereof.

Description

Programmable logic controller (PLC) and communication interface thereof and data transmission method for uplink
Technical field
The present invention relates to communication technical field, be specifically related to a kind of programmable logic controller (PLC) and communication interface thereof and a kind of data transmission method for uplink.
Background technology
Along with improving constantly of industrial automatization, PLC (Programmable Logic Controllers, programmable logic controller (PLC)) obtained utilization more and more widely, PLC is a kind of electronic system of the digital operation operation that designs for the commercial Application environment, it has adopted programmable memory to store dependent instructions such as the logical operation of need execution, sequential control, counting, timing, and controls various types of machinery production processes by the I/O interface of numeral or simulation.
Generally all be connected between the respective peripheral device (as industrial instrument, man-machine interface, intelligent object etc.) of PLC series of products of the prior art and corresponding field of industrial automatic control by the RS485 physical interface.Existing P LC generally only provides the RS485 physical interface, and system controlled by computer communication interface commonly used and the upper control of PLC, the communication interface of programmed computer are typical R S232 physical interface.
RS232 is the UART Universal Asynchronous Receiver Transmitter serial interface device that comes from the PC, is used for connecting as MODEM (modulator-demodular unit), mouse, corresponding peripherals based on the RS232 physical interface such as microcomputer commonly used.When the communication that connects based on the RS232 serial ports, there is a data lines to be used to send data respectively, another data lines is used to receive data, and in 9 pin D shape connectors based on the RS232 of DB9 series, 2 lines are used to receive data, and 3 lines are used to send data.
RS485 is based on the half-duplex operation mode of differential signal transmission, and when communication, data send on two lines simultaneously or receive.In 9 pin D shape connectors based on the RS485 of DB9 series, 3 pin and 8 pin are used for the transmission and the reception of differential signal simultaneously.
Because the interface of PLC generally is the RS485 communication interface in the prior art, the upper equipment that PC etc. are used for programming Control then generally only provides the RS232 communication interface, therefore, when PLC need be connected to PC etc. and is used for the upper equipment of programming Control, must be by special-purpose RS232 to the RS485 conversion cable, and can not carry out communication by RS232 connecting line commonly used, and reduced versatility and compatibility between the equipment, be unfavorable for improving the integration efficiency of industrial control system.
Summary of the invention
In view of this, embodiment of the invention technical matters to be solved is, a kind of programmable logic controller (PLC) and communication interface thereof and a kind of data transmission method for uplink are provided, be implemented under the prerequisite based on same physical interface, compatible plurality of communication schemes both communicated with the opposite end that is connected by a kind of in the plurality of communication schemes (also both multiple serial ports connection protocol).
For solving the problems of the technologies described above, a kind of programmable logic controller (PLC) communication interface of the embodiment of the invention is used for sending data and receiving data from described opposite end to the opposite end that is connected with programmable logic controller (PLC), and described device comprises:
UART Universal Asynchronous Receiver Transmitter;
The physical interface of the shared at least two kinds of communication patterns of energy;
Be connected at least two level conversion units that correspond respectively to different communication modes between described UART Universal Asynchronous Receiver Transmitter and the described physical interface, be used for when sending data, the data that come from described UART Universal Asynchronous Receiver Transmitter are carried out level conversion and the data after the level conversion are passed through described physical interface output;
Select control module, be used for when sending data, obtain the communication pattern between described programmable logic controller (PLC) and the described opposite end, and select and the corresponding level conversion unit of this communication pattern carries out level conversion to the data that come from described UART Universal Asynchronous Receiver Transmitter.
Preferably, described level conversion unit is further used for when receiving data the data of the received respective communication pattern of described physical interface being carried out level conversion, and with the data transmission after the level conversion to described UART Universal Asynchronous Receiver Transmitter.
Preferably, described selection control module comprises:
Acquiring unit is used for obtaining the communication pattern between described programmable logic controller (PLC) and the described opposite end when sending data;
Selected cell is used to select the level conversion unit corresponding with the described communication pattern that described acquiring unit is obtained carried out level conversion to the data that come from described UART Universal Asynchronous Receiver Transmitter.
Wherein:
When described programmable logic controller (PLC) that obtains when described acquiring unit and the communication pattern between the described opposite end were first communication pattern, described selected cell selected first level conversion unit corresponding with this first communication pattern that the data that come from described UART Universal Asynchronous Receiver Transmitter are carried out level conversion.
When described programmable logic controller (PLC) that obtains when described acquiring unit and the communication pattern between the described opposite end were the second communication pattern, described selected cell selected second level conversion unit corresponding with this second communication pattern that the data that come from described UART Universal Asynchronous Receiver Transmitter are carried out level conversion.
Preferably, described first communication pattern is the RS232 serial interface communication mode, and described first level conversion unit is the RS232 level conversion unit.
Preferably, described second communication pattern is the RS485 serial interface communication mode, and described second level conversion unit is the RS485 level conversion unit.
Preferably, described second communication pattern is the RS422 serial interface communication mode, and described second level conversion unit is the RS422 level conversion unit.
Preferably, when receiving data, described physical interface has the input that different input pins corresponds respectively to each level conversion unit.
A kind of programmable logic controller (PLC) communication interface of the embodiment of the invention is used for sending data and receiving data from described opposite end to the opposite end that is connected with programmable logic controller (PLC), and described device comprises:
UART Universal Asynchronous Receiver Transmitter;
The physical interface of the shared at least two kinds of communication patterns of energy;
Be connected at least two level conversion units that correspond respectively to different communication modes between described UART Universal Asynchronous Receiver Transmitter and the described physical interface, be used for when sending data, to from carry out level conversion with the data of described UART Universal Asynchronous Receiver Transmitter and with the data after the level conversion by described physical interface output.
Preferably, described level conversion unit is further used for when receiving data the data of the received respective communication pattern of described physical interface being carried out level conversion, and with the data transmission after the level conversion to described UART Universal Asynchronous Receiver Transmitter.
Preferably, described physical interface shared communication pattern comprise first communication pattern and second communication pattern, when the communication pattern of the received data of described physical interface was first communication pattern, first level conversion unit corresponding with described first communication pattern carried out level conversion and exports described UART Universal Asynchronous Receiver Transmitter to the received data of described physical interface;
When the communication pattern of the received data of described physical interface was the second communication pattern, second level conversion unit corresponding with described second communication pattern carried out level conversion and exports described UART Universal Asynchronous Receiver Transmitter to the received data of described physical interface.
Preferably, described first communication pattern is the RS232 serial interface communication mode, and described first level conversion unit is the RS232 level conversion unit;
Described second communication pattern is the RS485 serial interface communication mode, and described second level conversion unit is the RS485. level conversion unit.
Preferably, when receiving data, described physical interface has the input that different input pins corresponds respectively to each level conversion unit;
When sending data, described physical interface has the output that different output pins corresponds respectively to each level conversion unit.
A kind of programmable logic controller (PLC) of the embodiment of the invention comprises processor and communication interface, and wherein, described communication interface comprises:
UART Universal Asynchronous Receiver Transmitter;
The physical interface of the shared at least two kinds of communication patterns of energy;
Be connected at least two level conversion units that correspond respectively to different communication modes between described UART Universal Asynchronous Receiver Transmitter and the described physical interface, be used for when sending data, the data that come from described UART Universal Asynchronous Receiver Transmitter are carried out level conversion and the data after the level conversion are passed through described physical interface output;
Select control module, be used for when sending data, obtain the communication pattern between described programmable logic controller (PLC) and the described opposite end, and select and the corresponding level conversion unit of this communication pattern carries out level conversion to the data that come from described UART Universal Asynchronous Receiver Transmitter.
Preferably, described selection control module comprises:
Acquiring unit is used for obtaining the communication pattern between described programmable logic controller (PLC) and the described opposite end when sending data;
Selected cell is used to select the level conversion unit corresponding with the described communication pattern that described acquiring unit is obtained carried out level conversion to the data that come from described UART Universal Asynchronous Receiver Transmitter.
Preferably, described level conversion unit is further used for when receiving data the data of the received respective communication pattern of described physical interface being carried out level conversion, and with the data transmission after the level conversion to described UART Universal Asynchronous Receiver Transmitter.
A kind of programmable logic controller (PLC) of the embodiment of the invention comprises processor and communication interface, and wherein, described communication interface comprises:
UART Universal Asynchronous Receiver Transmitter;
The physical interface of the shared at least two kinds of communication patterns of energy;
Be connected at least two level conversion units that correspond respectively to different communication modes between described UART Universal Asynchronous Receiver Transmitter and the described physical interface, be used for when sending data, to from carry out level conversion with the data of described UART Universal Asynchronous Receiver Transmitter and with the data after the level conversion by described physical interface output.
Preferably, described level conversion unit is further used for when receiving data the data of the received respective communication pattern of described physical interface being carried out level conversion, and with the data transmission after the level conversion to described UART Universal Asynchronous Receiver Transmitter.
A kind of data transmission method for uplink of the embodiment of the invention is used for programmable logic controller (PLC) and receives data from the opposite end that is connected, and it is characterized in that, comprises step:
Obtain the communication pattern between described programmable logic controller (PLC) and the described opposite end;
Select the level conversion unit corresponding that the data that come from described UART Universal Asynchronous Receiver Transmitter are carried out level conversion with the described communication pattern that is obtained;
Export the data after the level conversion to UART Universal Asynchronous Receiver Transmitter.
Implement programmable logic controller (PLC) and the communication interface and the data transmission method for uplink of the embodiment of the invention, by between the physical interface of UART Universal Asynchronous Receiver Transmitter and the shared at least two kinds of communication patterns of energy, at least two level conversion units corresponding to different communication modes being set, realized under prerequisite based on same physical interface, compatible plurality of communication schemes also both communicated with the opposite end that is connected by a kind of in the plurality of communication schemes (also both multiple serial ports connection protocol).
Description of drawings
Fig. 1 is the structural representation of a kind of programmable logic controller (PLC) of the present invention;
Fig. 2 is the first example structure synoptic diagram of communication interface of the present invention;
Fig. 3 is the second example structure synoptic diagram of communication interface of the present invention;
Fig. 4 is the connection diagram of the physical interface and the opposite equip. physical interface of programmable logic controller (PLC) of the present invention;
Fig. 5 is a kind of circuit structure diagram of communication interface of the present invention.
Embodiment
In order to make technical scheme of the present invention and advantage clearer, the embodiment of the invention is further elaborated below in conjunction with the accompanying drawing embodiment that develops simultaneously.
As shown in Figure 1, be the structural representation of a kind of programmable logic controller (PLC) of the present invention.Described programmable logic controller (PLC) comprises processor 1 and communication interface 2, and described communication interface 2 is used for sending data and receiving data from described opposite end to the opposite end that is connected with programmable logic controller (PLC).By described communication interface 2, can be implemented under the prerequisite that does not increase physical interface, communicate with the opposite end that is connected by a kind of in the plurality of communication schemes (also both multiple serial ports connection protocol).Below described communication interface 2 is carried out corresponding description.
As shown in Figure 2, be the first example structure synoptic diagram of communication interface of the present invention.Described communication interface comprises the physical interface 23 and the selection control module 24 of UART Universal Asynchronous Receiver Transmitter 20, RS485 level conversion unit 21, RS232 level conversion unit 22, the shared at least two kinds of communication patterns of energy, wherein:
UART Universal Asynchronous Receiver Transmitter 20 links to each other with processor 1, is mainly used in the string and the conversion that realize data, with structure of the prior art and function class seemingly, do not repeat them here.
RS485 level conversion unit 21 is used for when sending data the Transistor-Transistor Logic level data-signal from described asynchronism transceiver 20 being carried out level conversion, generates the data-signal under the RS485 serial interface communication mode; When receiving data,, generate the Transistor-Transistor Logic level data-signal to carrying out data-switching from the data-signal under the RS485 serial interface communication mode of physical interface 23.
Herein, the function of described RS485 level conversion unit 21 is identical or similar with structure and prior art, as realizing the mutual conversion of Transistor-Transistor Logic level data and RS485 level data by the SN65LBC184 level shifting circuit.
RS232 level conversion unit 22 is used for when sending data the Transistor-Transistor Logic level data-signal from described asynchronism transceiver 20 being carried out level conversion, generates the data-signal under the RS232 serial interface communication mode; When receiving data,, generate the Transistor-Transistor Logic level data-signal to carrying out data-switching from the data-signal under the RS232 serial interface communication mode of physical interface 23.
Herein, the function of described RS232 level conversion unit 22 is identical or similar with structure and prior art, as realizing the mutual conversion of Transistor-Transistor Logic level data and RS232 level data by the MAX3232 level shifting circuit.
Physical interface 23 that can shared at least two kinds of communication patterns is used to realize and the communicating to connect of opposite equip..
Herein, in the prior art, 9 pin D shape connectors of the general DB9 of selection series connect physical interface as the serial ports of PLC device, under the RS485 communication pattern, in the prior art, with 3 pin and 8 pin as the difference bi-directional data pin that receives and send data simultaneously, under the RS232 communication pattern, 2 pin are used to receive data, and 3 pin are used to send data.9 pin D shape connectors of DB9 series connect for the RS485 serial ports that to be connected with the RS232 serial ports be general.
Select control module 24, be used for when sending data, obtain the communication pattern between described programmable logic controller (PLC) and the described opposite end, and select and the corresponding level conversion unit of this communication pattern carries out level conversion to the data that come from described UART Universal Asynchronous Receiver Transmitter 20.
During specific implementation, described selection control module 24 mainly comprises:
Acquiring unit 241 is used for obtaining the communication pattern between described programmable logic controller (PLC) and the described opposite end when sending data.
Selected cell 242 is used to select the level conversion unit corresponding with the described communication pattern that described acquiring unit 241 is obtained carried out level conversion to the data that come from described UART Universal Asynchronous Receiver Transmitter 20.
Herein, during concrete enforcement, acquiring unit 241 can obtain communication pattern between described programmable logic controller (PLC) and the described opposite end by the mode of level detection, when being RS232 level " 1 " as level when 2 pins that detect DB9 series D connector, communication pattern between then described programmable logic controller (PLC) and the described opposite end is the RS232 serial interface communication mode, otherwise the communication pattern between then described programmable logic controller (PLC) and the described opposite end is the RS485 serial interface communication mode.Certainly; more than concrete level detection mode; and the selection that detects contact only is a kind of concrete implementation, under thought of the present invention, and other identical or similar detection modes and detect contact and select all should belong in the protection domain of the presently claimed invention.
Below again by the process prescription that the present invention sent data and receive data to present embodiment how by the compatibility of same physical interface realization to plurality of communication schemes (is that example is described with two kinds).
When sending data, select control 241 by level detection, obtain the communication pattern between programmable logic controller (PLC) and the opposite end, both judged it is the RS485 serial interface communication mode, or the RS232 serial interface communication mode, specifically how to detect, in the existing corresponding description of preamble.When the communication pattern between programmable logic controller (PLC) that is obtained and opposite end is the RS485 serial interface communication mode, the data channel of blocking-up UART Universal Asynchronous Receiver Transmitter 20 to RS232 level conversion units 22, and select 21 pairs of level signals of RS485 level conversion unit to carry out level conversion from described UART Universal Asynchronous Receiver Transmitter 20, generate RS485 serial ports differential level signal; Correspondingly, when the communication pattern between programmable logic controller (PLC) that is obtained and opposite end is the RS232 serial interface communication mode, the data channel of blocking-up UART Universal Asynchronous Receiver Transmitter 20 to RS485 level conversion units 21, and select 22 pairs of level signals of RS232 level conversion unit to carry out level conversion from described UART Universal Asynchronous Receiver Transmitter 20, generate RS232 serial ports level signal.
When receiving data, under the RS232 communication pattern, described physical interface 23 receives the RS232 level data signal that comes from opposite equip. by 2 pin, and by line with data signal transmission to RS232 level conversion unit 22 carry out level conversion and will change after data export described UART Universal Asynchronous Receiver Transmitter 20 to, under the communication pattern that receives the RS232 data, 3 pin of RS485 physical interface that level conversion unit is connected to 23 and 8 pin do not have the signal input, so RS485 level conversion unit 21 does not have corresponding output yet, therefore can not cause interference to the signal that RS232 level conversion unit 22 exports described UART Universal Asynchronous Receiver Transmitter to; Correspondingly, under the RS485 communication pattern, described physical interface 23 receives the RS485 level data signal that comes from opposite equip. by 3 pin and 8 pin, and by line with data signal transmission to RS485 level conversion unit 21 carry out level conversion and will change after data export described UART Universal Asynchronous Receiver Transmitter 20 to, under the communication pattern that receives the RS485 data, 2 pin of RS232 physical interface that level conversion unit is connected to 23 do not have the signal input, so RS232 level conversion unit 22 does not have corresponding output yet, therefore can not cause interference to the signal that RS485 level conversion unit 21 exports described UART Universal Asynchronous Receiver Transmitter to.
The technical scheme that provides by present embodiment, can realize the DB9 series D connector that extensively applies in the PLC industrial control system based on existing, (3 pin and 8 pin are used for the transmission of RS485 data double-way it not being carried out any mode of connection, 2 pin are used for the RS232 Data Receiving, 3 pin are used for the RS232 data and receive and send) under the prerequisite that changes, by same physical interface (D connector), realization to the compatibility of RS485 and two kinds of serial interface communication mode of RS232 (in industrial control system with respective peripheral device (as industrial instrument, man-machine interface, intelligent object etc.) be connected by the RS485 communication pattern; Be connected by the RS23 communication pattern with upper equipment such as PCs).
As shown in Figure 3, be the second example structure synoptic diagram of communication interface of the present invention.Described communication interface comprises:
UART Universal Asynchronous Receiver Transmitter 30 links to each other with processor 1, is mainly used in the string and the conversion that realize data, with structure of the prior art and function class seemingly, do not repeat them here.
RS485 level conversion unit 31 is used for when sending data the Transistor-Transistor Logic level data-signal from described asynchronism transceiver 30 being carried out level conversion, generates the data-signal under the RS485 serial interface communication mode; When receiving data,, generate the Transistor-Transistor Logic level data-signal to carrying out data-switching from the data-signal under the RS485 serial interface communication mode of physical interface 33.
Herein, the function of described RS485 level conversion unit 31 is identical or similar with structure and prior art, as realizing the mutual conversion of Transistor-Transistor Logic level data and RS485 level data by the SN65LBC184 level shifting circuit.
RS232 level conversion unit 32 is used for when sending data the Transistor-Transistor Logic level data-signal from described asynchronism transceiver 30 being carried out level conversion, generates the data-signal under the RS232 serial interface communication mode; When receiving data,, generate the Transistor-Transistor Logic level data-signal to carrying out data-switching from the data-signal under the RS232 serial interface communication mode of physical interface 33.
Herein, the function of described RS232 level conversion unit 32 is identical or similar with structure and prior art, as realizing the mutual conversion of Transistor-Transistor Logic level data and RS232 level data by the MAX3232 level shifting circuit.
Physical interface 33 that can shared at least two kinds of communication patterns is used to realize and the communicating to connect of opposite equip..
The key distinction of first embodiment of present embodiment and described communication interface of the present invention is to have reduced the selection control module, when sending data, do not need to detect the communication pattern that obtains between programmable logic device and the opposite equip., in order to reach identical or similar effects, the pin distribution of the physical interface 33 described in this enforcement is different with the pin allocation scheme of described physical interface 33.With reference to figure 4, be the connection diagram of the physical interface and the opposite equip. physical interface of programmable logic controller (PLC) of the present invention.As can be seen from the figure, unlike the prior art, under the RS232 communication pattern, physical interface 33 of the present invention is connected in the data input pin 2 of opposite equip. physical interface as DOL Data Output Line with 9 pin, it is identical (both 3 pin and 8 pin were that RS485 gangs up the bidirectional data transfers pin under the letter pattern, and 2 pin are RS232 data input pin) that all the other pins distribute with first embodiment of described communication interface of the present invention.
Because under the RS232 communication pattern, data input pin also for a change so the reception data procedures of first embodiment of present embodiment and described communication interface of the present invention is similarly, no longer gives and giving unnecessary details.Below by the present embodiment data transmission procedure is described, so that the implementation process of this enforcement is clearer.
Send in the data procedures in this enforcement, do not need to detect the communication pattern between programmable logic device and the opposite equip..Described UART Universal Asynchronous Receiver Transmitter 30 exports the Transistor-Transistor Logic level data-signal to described RS485 level conversion unit 31 and described RS232 level conversion unit 32 simultaneously, 31 pairs of Transistor-Transistor Logic level data-signals from institute's UART Universal Asynchronous Receiver Transmitter 30 of described RS485 level conversion unit carry out level conversion and generate the RS485 level data signal, and transfer to 3 pin and 8 pin of described physical interface 33,32 pairs of Transistor-Transistor Logic level data-signals from institute's UART Universal Asynchronous Receiver Transmitter 30 of described RS232 level conversion unit carry out level conversion and generate the RS232 level data signal, and transfer to 9 pin of described physical interface 33.If the communication pattern between programmable logic device and the opposite equip. is the RS485 communication pattern, then the RS485 level data signal is transferred to opposite equip. by 3 pin and 8 pin, RS232 signal on 9 pin can not cause interference to it, otherwise, if the communication pattern between programmable logic device and the opposite equip. is the RS232 communication pattern, then by 9 pin the RS485 level data signal is transferred to opposite equip., the RS485 level data signal on 3 pin and 8 pin can not produce interference to it yet.
The technical scheme that provides by present embodiment, can realize the DB9 series D connector that extensively applies in the PLC industrial control system based on existing, under the prerequisite of the change of it being carried out some corresponding modes of connection, (substitute 2 pin as the data output connecting pin) with 9 pin, by same physical interface (D connector), realization to the compatibility of RS485 and two kinds of serial interface communication mode of RS232 (in industrial control system with respective peripheral device (as industrial instrument, man-machine interface, intelligent object etc.) be connected by the RS485 communication pattern; Be connected by the RS23 communication pattern with upper equipment such as PCs).
With reference to figure 5, be a kind of circuit structure diagram of communication interface of the present invention.
As shown in the figure, this circuit has mainly comprised RS485 level shifting circuit SN65LBC184, RS232 level shifting circuit MAX3232, DB9 series D connector, with the tri-state bus driver spare 74AHCT125 of the control module that elects, and devices such as some resistance, electric capacity accordingly.TXD is the serial output terminal of UART Universal Asynchronous Receiver Transmitter (not shown), and RXD is the serial input terminal of UART Universal Asynchronous Receiver Transmitter, and RTS can be by each module in the output enable signal initialize communication interface for enabling control end.Below in conjunction with data transmission and receiving course this circuit is elaborated:
When sending data, RTS output enable signal (low level is effective), just each circuit module of making (both having made each circuit module enter duty); The Transistor-Transistor Logic level data transmission that the TXD output terminal will come from the asynchronous receiving-transmitting unit (also can be passed through CPLD to tri-state bus driver spare 74AHCT125, FPGA, modes such as ASIC realize), the selection control module that tri-state bus driver spare 74AHCT125 and other peripheral components are formed together detects the level of D connector 2 pin, when detecting 2 pin and be RS232 level " 1 ", illustrate that the communication pattern between programmable logic controller (PLC) and the opposite equip. is the RS232 serial interface communication mode, so tri-state bus driver spare 74AHCT125 will be from the Transistor-Transistor Logic level data transmission of TXD to RS232 level shifting circuit MAX3232 by 5 pin shown in the figure, RS232 level shifting circuit MAX3232 carries out level conversion to these Transistor-Transistor Logic level data and the RS232 level data that generates after the level conversion is exported by 3 pin of D connector; Otherwise, illustrate that the communication pattern between programmable logic controller (PLC) and the opposite equip. is the RS485 communication pattern, so tri-state bus driver spare 74AHCT125 by 6 pin shown in the figure will from TXD the Transistor-Transistor Logic level data transmission to RS485 level shifting circuit SN65LBC184, RS485 level shifting circuit SN65LBC184 carries out level conversion to these Transistor-Transistor Logic level data and the RS485 differential level data that generate after the level conversion is exported by 3 pin and 8 pin of D connector.
Correspondingly, when receiving data, when the received data of described physical interface are RS485 serial ports level data, then by 3 pin and 8 pin with described data transmission to RS485 level shifting circuit SN65LBC184, RS485 level shifting circuit SN65LBC184 carries out level conversion to it and generates the Transistor-Transistor Logic level signal data, and the Transistor-Transistor Logic level signal data that generates transferred to tri-state bus driver spare 74AHCT125, tri-state bus driver spare 74AHCT125 transmits it to the RXD end of UART Universal Asynchronous Receiver Transmitter after receiving this effective Transistor-Transistor Logic level signal data; When the received data of described physical interface are RS232 serial ports level data, then by 2 pin with described data transmission to RS232 level shifting circuit MAX3232, RS232 level shifting circuit MAX3232 carries out level conversion to it and generates the Transistor-Transistor Logic level signal data, and the Transistor-Transistor Logic level signal data that generates transferred to tri-state bus driver spare 74AHCT125, tri-state bus driver spare 74AHCT125 transmits it to the RXD end of UART Universal Asynchronous Receiver Transmitter after receiving this effective Transistor-Transistor Logic level signal data.
The above only is a preferred implementation of the present invention; should be pointed out that for those skilled in the art, under the prerequisite that does not break away from the principle of the invention; can also make some improvements and modifications, these improvements and modifications also should be considered as protection scope of the present invention.

Claims (20)

1. a programmable logic controller (PLC) communication interface is used for sending data and receiving data from described opposite end to the opposite end that is connected with programmable logic controller (PLC), and described device comprises UART Universal Asynchronous Receiver Transmitter, it is characterized in that, also comprises:
The physical interface of the shared at least two kinds of communication patterns of energy;
Be connected at least two level conversion units that correspond respectively to different communication modes between described UART Universal Asynchronous Receiver Transmitter and the described physical interface, be used for when sending data, the data that come from described UART Universal Asynchronous Receiver Transmitter are carried out level conversion and the data after the level conversion are passed through described physical interface output;
Select control module, be used for when sending data, obtain the communication pattern between described programmable logic controller (PLC) and the described opposite end, and select and the corresponding level conversion unit of this communication pattern carries out level conversion to the data that come from described UART Universal Asynchronous Receiver Transmitter.
2. device as claimed in claim 1, it is characterized in that, described level conversion unit is further used for when receiving data the data of the received respective communication pattern of described physical interface being carried out level conversion, and with the data transmission after the level conversion to described UART Universal Asynchronous Receiver Transmitter.
3. device as claimed in claim 2 is characterized in that, described selection control module comprises:
Acquiring unit is used for obtaining the communication pattern between described programmable logic controller (PLC) and the described opposite end when sending data;
Selected cell is used to select the level conversion unit corresponding with the described communication pattern that described acquiring unit is obtained carried out level conversion to the data that come from described UART Universal Asynchronous Receiver Transmitter.
4. device as claimed in claim 3, it is characterized in that, when described programmable logic controller (PLC) that obtains when described acquiring unit and the communication pattern between the described opposite end were first communication pattern, described selected cell selected first level conversion unit corresponding with this first communication pattern that the data that come from described UART Universal Asynchronous Receiver Transmitter are carried out level conversion.
5. device as claimed in claim 4, it is characterized in that, when described programmable logic controller (PLC) that obtains when described acquiring unit and the communication pattern between the described opposite end were the second communication pattern, described selected cell selected second level conversion unit corresponding with this second communication pattern that the data that come from described UART Universal Asynchronous Receiver Transmitter are carried out level conversion.
6. device as claimed in claim 5 is characterized in that, described first communication pattern is the RS232 serial interface communication mode, and described first level conversion unit is the RS232 level conversion unit.
7. device as claimed in claim 6 is characterized in that, described second communication pattern is the RS485 serial interface communication mode, and described second level conversion unit is the RS485 level conversion unit.
8.,, it is characterized in that described second communication pattern is the RS422 serial interface communication mode as claim 6 a described device, described second level conversion unit is the RS422 level conversion unit.
9. as any described device of claim 2 to 8, it is characterized in that when receiving data, described physical interface has the input that different input pins corresponds respectively to each level conversion unit.
10. a programmable logic controller (PLC) communication interface is used for sending data and receiving data from described opposite end to the opposite end that is connected with programmable logic controller (PLC), and described device comprises UART Universal Asynchronous Receiver Transmitter, it is characterized in that, also comprises:
The physical interface of the shared at least two kinds of communication patterns of energy;
Be connected at least two level conversion units that correspond respectively to different communication modes between described UART Universal Asynchronous Receiver Transmitter and the described physical interface, be used for when sending data, to from carry out level conversion with the data of described UART Universal Asynchronous Receiver Transmitter and with the data after the level conversion by described physical interface output.
11. device as claimed in claim 10, it is characterized in that, described level conversion unit is further used for when receiving data the data of the received respective communication pattern of described physical interface being carried out level conversion, and with the data transmission after the level conversion to described UART Universal Asynchronous Receiver Transmitter.
12. device as claimed in claim 11, it is characterized in that, described physical interface shared communication pattern comprise first communication pattern and second communication pattern, when the communication pattern of the received data of described physical interface was first communication pattern, first level conversion unit corresponding with described first communication pattern carried out level conversion and exports described UART Universal Asynchronous Receiver Transmitter to the received data of described physical interface;
When the communication pattern of the received data of described physical interface was the second communication pattern, second level conversion unit corresponding with described second communication pattern carried out level conversion and exports described UART Universal Asynchronous Receiver Transmitter to the received data of described physical interface.
13. device as claimed in claim 12 is characterized in that, described first communication pattern is the RS232 serial interface communication mode, and described first level conversion unit is the RS232 level conversion unit;
Described second communication pattern is the RS485 serial interface communication mode, and described second level conversion unit is the RS485 level conversion unit.
14., it is characterized in that when receiving data, described physical interface has the input that different input pins corresponds respectively to each level conversion unit as any described device of claim 10 to 13;
When sending data, described physical interface has the output that different output pins corresponds respectively to each level conversion unit.
15. a programmable logic controller (PLC) comprises processor and communication interface, it is characterized in that, described communication interface comprises:
UART Universal Asynchronous Receiver Transmitter;
The physical interface of the shared at least two kinds of communication patterns of energy;
Be connected at least two level conversion units that correspond respectively to different communication modes between described UART Universal Asynchronous Receiver Transmitter and the described physical interface, be used for when sending data, the data that come from described UART Universal Asynchronous Receiver Transmitter are carried out level conversion and the data after the level conversion are passed through described physical interface output; Select control module, be used for when sending data, obtain the communication pattern between described programmable logic controller (PLC) and the described opposite end, and select and the corresponding level conversion unit of this communication pattern carries out level conversion to the data that come from described UART Universal Asynchronous Receiver Transmitter.
16. programmable logic controller (PLC) as claimed in claim 15, it is characterized in that, described level conversion unit is further used for when receiving data, data to the received respective communication pattern of described physical interface are carried out level conversion, and with the data transmission after the level conversion to described UART Universal Asynchronous Receiver Transmitter.
17. programmable logic controller (PLC) as claimed in claim 16 is characterized in that, described selection control module comprises:
Acquiring unit is used for obtaining the communication pattern between described programmable logic controller (PLC) and the described opposite end when sending data;
Selected cell is used to select the level conversion unit corresponding with the described communication pattern that described acquiring unit is obtained carried out level conversion to the data that come from described UART Universal Asynchronous Receiver Transmitter.
18. a programmable logic controller (PLC) comprises processor and communication interface, it is characterized in that, described communication interface comprises:
UART Universal Asynchronous Receiver Transmitter;
The physical interface of the shared at least two kinds of communication patterns of energy;
Be connected at least two level conversion units that correspond respectively to different communication modes between described UART Universal Asynchronous Receiver Transmitter and the described physical interface, be used for when sending data, to from carry out level conversion with the data of described UART Universal Asynchronous Receiver Transmitter and with the data after the level conversion by described physical interface output.
19. device as claimed in claim 18, it is characterized in that, described level conversion unit is further used for when receiving data the data of the received respective communication pattern of described physical interface being carried out level conversion, and with the data transmission after the level conversion to described UART Universal Asynchronous Receiver Transmitter.
20. a data transmission method for uplink is used for programmable logic controller (PLC) and sends data to the opposite end that is connected, and it is characterized in that, comprises step:
Obtain the communication pattern between described programmable logic controller (PLC) and the described opposite end;
Select the level conversion unit corresponding that the data that come from described UART Universal Asynchronous Receiver Transmitter are carried out level conversion with the described communication pattern that is obtained;
Export the data after the level conversion to UART Universal Asynchronous Receiver Transmitter.
CNB2007100282741A 2007-05-29 2007-05-29 Programmable logic controller and its communication interface device Expired - Fee Related CN100498611C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNB2007100282741A CN100498611C (en) 2007-05-29 2007-05-29 Programmable logic controller and its communication interface device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNB2007100282741A CN100498611C (en) 2007-05-29 2007-05-29 Programmable logic controller and its communication interface device

Publications (2)

Publication Number Publication Date
CN101105692A true CN101105692A (en) 2008-01-16
CN100498611C CN100498611C (en) 2009-06-10

Family

ID=38999613

Family Applications (1)

Application Number Title Priority Date Filing Date
CNB2007100282741A Expired - Fee Related CN100498611C (en) 2007-05-29 2007-05-29 Programmable logic controller and its communication interface device

Country Status (1)

Country Link
CN (1) CN100498611C (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102065570A (en) * 2009-11-17 2011-05-18 库帕技术公司 Industrial radio device with unified programming interface and methods
CN105007093A (en) * 2015-08-19 2015-10-28 长沙威胜信息技术有限公司 Interface device of wireless public network communication module
CN106354683A (en) * 2016-09-26 2017-01-25 旋智电子科技(上海)有限公司 Micro-control device and input/output system applied to same
CN106598905A (en) * 2017-01-10 2017-04-26 四川埃姆克伺服科技有限公司 Terminal resistance interface circuit for servo controller
CN107241144A (en) * 2017-08-10 2017-10-10 青岛海信宽带多媒体技术有限公司 A kind of optical module receiving circuit and optical module
CN108647180A (en) * 2018-05-28 2018-10-12 北京比特大陆科技有限公司 A kind of arithmetic system and corresponding electronic equipment
CN109885514A (en) * 2019-01-30 2019-06-14 博众精工科技股份有限公司 A kind of RS232 communication communicates self-identifying multiplex interface with RS485

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102065570A (en) * 2009-11-17 2011-05-18 库帕技术公司 Industrial radio device with unified programming interface and methods
CN105007093A (en) * 2015-08-19 2015-10-28 长沙威胜信息技术有限公司 Interface device of wireless public network communication module
CN106354683A (en) * 2016-09-26 2017-01-25 旋智电子科技(上海)有限公司 Micro-control device and input/output system applied to same
CN106354683B (en) * 2016-09-26 2022-01-18 旋智电子科技(上海)有限公司 Micro-control device and input/output system applied to micro-control device
CN106598905A (en) * 2017-01-10 2017-04-26 四川埃姆克伺服科技有限公司 Terminal resistance interface circuit for servo controller
CN107241144A (en) * 2017-08-10 2017-10-10 青岛海信宽带多媒体技术有限公司 A kind of optical module receiving circuit and optical module
CN108647180A (en) * 2018-05-28 2018-10-12 北京比特大陆科技有限公司 A kind of arithmetic system and corresponding electronic equipment
CN108647180B (en) * 2018-05-28 2024-02-06 北京比特大陆科技有限公司 Operation system and corresponding electronic equipment
CN109885514A (en) * 2019-01-30 2019-06-14 博众精工科技股份有限公司 A kind of RS232 communication communicates self-identifying multiplex interface with RS485

Also Published As

Publication number Publication date
CN100498611C (en) 2009-06-10

Similar Documents

Publication Publication Date Title
CN100498611C (en) Programmable logic controller and its communication interface device
US10853305B2 (en) Method of communication for master device and slave device on synchronous data bus wherein master and slave devices are coupled in parallel
CN104079677A (en) Automatic allocation method of RS485 communication port address
CN202372976U (en) Switching circuit of time-share multiplexing serial port
CN206575438U (en) A kind of vehicle-mounted ethernet test modular converter and test system based on BroadR Reach
CN1333560C (en) High-performance optical fibre CAN communication system for strong electromagnetism interference environment
CN111538689B (en) Multi-channel PCIE (peripheral component interface express) adapter card with two heterogeneous ends
CN103186126B (en) Realize interface arrangement and method that dcs is interconnected with smart machine
CN105162671A (en) Welding table control system of arbitrary host and control method thereof
CN107168045A (en) A kind of communication redundancy control system based on EtherCAT
CN114401501A (en) Time service device and time service method for vehicle-mounted unit of V2X, vehicle V2X device and vehicle
CN203397201U (en) CPLD or FPGA based high-speed synchronous serial communication circuit
CN105045740A (en) Conversion method and circuit for communication interfaces
CN107608469A (en) A kind of LVDS high-speed communications backboard
CN201820120U (en) Self-adapting multibus execution mechanism controller
CN2876850Y (en) Series parallel integrated bus system
CN205091733U (en) Communication interface conversion device
CN102609388B (en) Slave node circuit, communication method and communication device
CN210518417U (en) Address allocation system
CN103176435A (en) Device and method of interface for achieving connection of distributed control system and measuring device
CN207637147U (en) It is a kind of based on one Uart mouthfuls of multichannel RS485 interface communication circuitries
CN107809264B (en) RS485 changes eight way RS 232's wireless communication converter
CN205563551U (en) A auto -change over device able to programme for RS232 and RS485
CN205017346U (en) Welding stage control system of arbitrary host computer
CN202404431U (en) Input interface device realizing interconnection between distributed control system and measurement equipment

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
C56 Change in the name or address of the patentee
CP02 Change in the address of a patent holder

Address after: 518052 Guangdong city of Shenzhen province Nanshan District Xili town tea light road on the south side of Shenzhen integrated circuit design and application of Industrial Park 209

Patentee after: CO-TRUST Technologies Co., Ltd.

Address before: 518052 room 1008, Nanshan Software Park, Shennan Road, Shenzhen, Nanshan District, Guangdong

Patentee before: CO-TRUST Technologies Co., Ltd.

CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20090610

Termination date: 20180529

CF01 Termination of patent right due to non-payment of annual fee