1、 Foreword

With the wide application of programmable logic controller (PLC) in the field of industrial control, PLC programming has become a professional skill that electrical engineering technicians must master. There are many brands of programmable controllers. PLCs from Europe, the United States, Japan, South Korea and Taiwan have rushed to the mainland. They not only provide users with a variety of choices, but also bring users a little trouble. Because the programming cables of different brands of PLC are not common to each other, it is often thousands of yuan to buy an original cable. For the technicians who take learning as the main purpose and often encounter different brands of PLC, if they can have a way to make a programming cable at a low cost, it will undoubtedly provide convenience for them. Although there are many brands of PLC, the programming interfaces of various brands of PLC are no more than several types. The pin definition of programming port is generally provided in the technical manual provided by PLC, which makes it possible to make self-made programming lines. Next, I will explain in detail how to DIY an applicable programming cable on several serial communication interface standards and physical structures of PLC programming port.

2、 Type of PLC programming port

One end of the programming cable is connected to the COM port of the PC and the other end is connected to the programming port of the PLC. The COM ports of the PC are RS232C interfaces and DB-9 pin plugs. The programming port of PLC can be generally divided into three types according to the interface standard, namely RS232, RS485 and RS422. According to the physical structure, it can be divided into five types, namely eight pin round port (din-8), nine pin D-shaped port (DB-9), twenty-five pin D-shaped port (db-25), RJ11 port and special interface. The first two types are most, and the arrangement of interface pins is shown in Figure 1.


In order to do a good job of programming cable, we should first understand these three serial communication interface standards. RS-232, RS-422 and RS-485 are three serial data interface standards. The interface standard only specifies the electrical characteristics of the interface, and does not involve connectors, cables or protocols. Therefore, the same interface standard can have different physical structures, such as DB-9, db-25, etc. RS-232 is the most widely used serial interface in PC and communication industry. RS-232C bus standard has 25 signal lines, including a main channel and an auxiliary channel. In most cases, only the main channel is used, and nine signal lines (nine pin D-port) are commonly used. The definitions of each pin are shown in Table 1. For general duplex communication, only a few signal lines are required, such as transmitting data line TXD, receiving data line RXD and logic ground line GND. RS232C can only communicate point-to-point, with short transmission distance and poor common mode suppression ability. RS-485 adopts balanced transmission and differential reception, so it has the ability to suppress common mode interference. It uses a pair of twisted pair wires, one of which is defined as a (TXD – / RXD -) and the other is defined as B (TXD + / RXD +), and no digital ground wire is required. When the speed is 100kbps and below, the communication distance is more than 1200 meters. RS-485 can be networked to form a distributed system, which allows up to 32 drivers and 32 receivers to be connected in parallel. RS-485 can only realize half duplex communication.

Table 1: RS-232 interface pin definition

25 pin 9 pin abbreviation description

2.3 TXD sending data

3.2 RXD receiving data

4.7 RTS request sending

5.8 CTS allows sending

6 DSR communication equipment ready

7.5 GND signal ground

8.1 CD carrier detection

20.4 DTR data terminal ready

22 9 RI ring indicator

RS-422 interface standard is mainly established to overcome the short communication distance and slow transmission rate of RS-232 interface standard. RS-422 standard is a balanced transmission standard. Two pairs of twisted pairs are used. Each signal is transmitted by two signal lines, that is, transmitting data TXD +, TXD -, receiving data RXD +, RXD -. The logic level is determined by the potential difference between the two transmission lines. Due to the use of two-wire transmission, the ability to resist common mode interference is greatly enhanced, Therefore, the maximum data rate can reach 10Mbps (when transmitting 15m). If the transmission rate is reduced to 90kbps, the maximum distance can reach 1200m, and full duplex communication can be realized.

3、 Manufacture of PLC programming cable

The function of each manufacturer’s programming cable is to convert the data in RS485 and RS422 format at the PLC end into the data in RS232C format at the PC end. If the PLC end is RS232, it can be directly connected according to the rules. Therefore, if you want to make your own PLC programming cable, you must convert the RS485 and RS422 at the PLC end into the RS232C that can be recognized by the PC, so that the PC can communicate with the PLC and complete the download, upload, monitoring and other work, which involves an interface standard conversion problem. There are several methods to realize interface conversion: one is to use a simple level conversion circuit, but one circuit can only target one PLC, and the function is incomplete, the performance is not very reliable, and may even damage the serial port of PC; The second is to use a special interface to convert IC, but the amateur implementation is more complex and not suitable for self-made. Here we use a finished communication interface converter, which can realize the conversion of RS232 / RS485 / RS422( http://www.diangon.com/ Copyright) because it is a special communication interface converter, it is very convenient to use, reliable performance and low price.

There are many such products in the market. Take the sc-485c interface converter of Sichuan Deyang four-star electronics as an example. The converter is used for the communication conversion from RS232 to RS485 / RS422. It is small and has the size of only two DB-9 plugs. It adopts serial port power stealing technology and does not need external power supply. The structure and pin definition of sc-485c are shown in Figure 2. The RS232 end is the hole seat of DB-9, which can be directly inserted into the COM port of PC. the RS485 / RS422 end is the needle seat of DB-9. Three pins and eight pins are used for RS485 and three pins, eight pins, one pin and seven pins are used for RS422. The programming cable is made by using the interface converter, as shown in Figure 3. The sc-485c interface converter is on the left, and the programming cables of din-8, RJ11, DB-9 and DB25 plugs are on the right from top to bottom. The plugs on one side of the cable close to the interface converter are DB-9 hole plugs, and the other end is pin plugs, respectively corresponding to PLC programming ports with different physical structures.


When wiring, select the corresponding pin according to whether the PLC terminal is RS485 or RS422, and connect according to the law of “sending to receiving, receiving to sending, positive to positive, negative to negative”. See Figure 4 for the wiring diagram of the interface between sc-485c interface converter and PLC RS485 and RS422, and the wiring diagram of the interface between PC and PLC RS232.

Figure IV


To make a programming cable, in addition to the interface conversion between RS232 / RS485 / RS422, it is also necessary to understand the definition of each pin of PLC programming port, because even if the same interface standard is adopted, the pin distribution of PLC from different manufacturers is different. Table 2 provides the pin definitions of several mainstream PLCs for self-made reference. For the PLC not listed, you can find the attached technical manual or a manual of general human-machine interface (HMI) on the Internet. The pin definitions of most PLCs in the market can be found in the connection description between HMI and PLC of various manufacturers.

Table 2 definition of PLC programming port pins

PLC model interface standard interface outline pin definition

S7-200 RS485 DB-9 3B/8A


Lgmasterk series RS232 DB-9 2rxd / 3txd / 5GND



AB SLC503/504 RS232 3TXD/2RXD/5GND/7RTS/8CTS




4、 Conclusion

An original cable can only be used on one PLC, and an interface converter with different connectors can be combined into a set of programming cables, which can be used on almost any brand of PLC. The interface converter and connector can be bought in the communication market, and the price is cheap. The total cost is only about one tenth of the price of the original cable, and the production is also very simple. The self-made programming cable can complete the functions of program upload, download and online monitoring between PC and PLC. It is no inferior to the original cable in function and reliability.

Schematic diagram of RS232 to RS485 self-made wire


Manufacture of serial communication cable manufacture of RS-232 communication cable

Whether it is a 9-hole plug or a 25 hole plug, the serial communication cable connection shall follow the following docking relationship:



According to the above docking relationship, the serial communication cable can be connected very conveniently. By the way, the meanings of the above pins are introduced:

The full English name of SG is signal ground / common return, which means signal ground;

TXD refers to transmitted data, indicating data transmission;

RXD refers to received data, indicating received data;

RTS refers to request to send, which means to send a request;

CTS refers to clear to send, indicating a clear request;

DTR refers to data terminal ready, indicating that the data terminal is ready;

DSR refers to data signal rate selector, indicating that the data is ready for setting.

When making a 9-core serial port connection, two 9-hole plugs and a 1.5m long flat cable with at least 7 cores are required. The pin connection is as follows.

9-hole plug – the pin connections of 9-hole plug are: 2-3, 3-2, 4-6, 5-5, 6-4, 7-8 and 8-7.

9-hole plug – 25 hole plug pin connection: 2-2, 3-3, 4-6, 5-7, 6-20, 7-5, 8-4.

25 hole plug – the pin connections of 25 hole plug are: 2-3, 3-2, 4-5, 5-4, 6-20, 7-7 and 20-6.

Delta DOP series touch screen and PLC communication connection of various brands

1. Ge vermax programming cable production (first serial port of power module):



2 (T) 2 (R)

3 (R) 3 (T)

5 (G) 5 (G)

2. Ge 90-30 series (cpu351 / 352 / 363 / 364) programming cable production (RS232 port 6-pin RJ11 type):



2 (T) 2 (R)

5 (R) 3 (T)

3 (G) 5 (G)

3. Ge 90-30, 90-70, VersaMax programming cable production (RS232 port 6-pin RJ11 type):



12 (T-) (R+) (T) 2 (R)

13 (T+) (R-) (R) 3 (T)

10 (R-) (T+) (G) 5 (G)

11 (T+) (T-)

9 (RT)

6 (RTS-)

15 (CTS-)

6 (RTS+)

15 (CTS+)

4. The programming cables (GE 90-30, 90-70 and VersaMax) produced by GE company are not long enough during commissioning and need to be extended. The production of extension cables is the same as 1

Note that GE 90-70 has two 15 sub female serial ports. The second serial port can be used for programming, that is, the programming cable produced by GE company is used.

Omron cpm1a programming cable production data

1、 (as shown in the figure)


2、 OMRON PLC programming cable


Manufacturing method of Siemens S7-200 and 300 programming cables



Manufacturing method of Siemens S7-200 and 300 programming cables

|2010-06-19 21:34:17 4th floor

S7-200: PPI communication mode

1: Programming the cable with Siemens PPI

2: The other end is directly connected to the plc-rs3-485 adapter through the ppi-rs3-485 adapter, and the other end is directly connected to the plc-rs7 adapter through the ppi-rs3-485 adapter. 1-1 2-3 / / sender 3-2 / / receiver 4-6 / / send an acknowledgement 5-5 / / a total of 6-4 / / receive an acknowledgement 7-8 / / sending is completed 8-7 / / receiving is completed 9-9 PROFIBUS:

1: Use special cables, generally a1-a1 and b1-b1

2: Make your own 3-3 8-8

Fabrication of communication cable between S7200 and tp170b

3--3; 8--8.

Schneider programming cable production.


Programming cable making of weinview touch screen: method for making programming cable of weinview / easyview touch screen

Make Mitsubishi FX series PLC programming cable

It is used for programming Mitsubishi fx1s, FX1N, FX2N, fx2nc and a series PLC.

Step 1: make an fx-422cabo.


Step 2: make a f2-232cab-1

Step 3: connect the 25 pin female connector with the male plug.

The figure above actually shows that the serial port of the computer directly corresponds to the DIN8 hole of the PLC;

Computer PLC

2 2

3 7

5 3

6 and 8 short circuit 6

Well, a Mitsubishi PLC programming cable SC-09 is finished.

Mitsubishi FX series programming cable Mitsubishi PLC programming cable production data


Manufacture of computer and PLC / cqm1h series programming cable xw2z-200s-cv

PLC-PC:2-2 3-3 4-8 5-7 9-5

Manufacturing method of LG PLC programming cable

It is made of RS232 serial port and shielded cable.

Male 2 (white) — > female 3 (white),

Male 3 (yellow) — > female 2 (yellow)

Male 5 (red) — female 5 (red),

The shielding layer and sheath are welded on the metal shell.

The above colors are customized. If the wire diameter is too small and the interface card is not firm, it can be fixed and thickened with electrical tape before installing the interface shell.

Fuji PLC programming cable production

The manufacturing method is as follows:

1. The manufacturing method of direct connection programming cable was originally based on the manufacturing method of Mitsubishi PLC programming cable. At the beginning, there was no method to make Fuji PLC programming cable on the Internet. I saw that Fuji PLC used RS422 communication in the touch screen programming manual, and downloaded the communication port diagram, as shown in the figure. It was prepared to be made with RS232 / 422 converter, but it was not bought locally. Remembering that Mitsubishi PLC is also RS422 communication, many Mitsubishi programming cable making drawings on the Internet, I downloaded a Mitsubishi wiring diagram and made a Fuji programming cable.

The programming cable made of resistance has a low online success probability of about 10% with v1.0 Chinese version of Fuji software. If the success probability of using notebook in the workshop is 0, go to Zhengzhou to buy RS232 / 422 module to make another programming cable. Who knows that the success probability of programming cable made with converter in the office is 0, let alone in the workshop. Always use the programming cable connected by resistance, remove the PLC to the office, input the program, and then install it to the workshop. Only later did a kind-hearted industrial control friend say that v1.0 Chinese software is online in Win98 system, and XP system must use the version after v2.0. Download and install v2.0 software, and the programming cables made by both methods can be used.


4 RTX+ -------------------------5 GND

6 TXD+ -------------------------5 GND

3 RXD – 2.2k resistance – 3 RXD

5 TXD – 2.2k resistance – 2 TXD

Connect the wire of 4 (RXD +). 6 (TXD +) pin of PLC with 5 pin of 9-core female head of computer (this pin is RS232 ground),

The 3-pin (RXD -) is connected with the 3-pin of 9-core through a resistance of 2.2k Ω,

Pin 5 (TXD -) is connected to pin 2 of 9 core through 2.2k Ω resistance

2. Connect through rs232-rs422 conversion head

Buy an rs232-422 conversion head in the computer market (about 25 yuan, safer than the resistance connection), and connect it with the 8-core crystal head according to the instructions of the conversion head and RTX +; RTX – RTX; TXD + connected to TXD +; Just connect TXD to TXD.

Later, some friends failed to get online. I concluded that the following reasons led to their failure:

1 if there is a USB / RS232 converter, note that the converter must be powered separately. If the converter can use + 5V power supply, it can directly use the + 5V power supply of PLC. If the converter is powered by + 9V, it may be necessary to add another DC power supply;

2. The software must use 2.0 English version, 1.0 Chinese version can be programmed below, 1.0 is available in Win98 system, and the online success rate in XP system is not high (it can succeed once occasionally).

3. Judge whether the wiring is correct, insert the crystal head into the PLC programming port (one port of PLC Nb2 is not the programming port, do not insert it wrong) and measure whether + 5V is 1 / 7 and 2 / 8 pins. Several friends made mistakes in the up and down procedures of the crystal head. Several friends have reversed the order of communication ports 1 ~ 8. After inserting into the PLC communication port, measure the + 5V polarity of pin 1 and pin 2 to judge whether they are connected incorrectly.

Fuji SPB PLC programming cable internal wiring diagram!

8-core crystal head at one end, RS232 9 holes at one end

RJ45 end 3-td +; 4-----TD- ; 5-----RD+ ; 6-----RD- ; 1,2,7,8---NC

SPB is in RS422 mode, so you need a RS232 to RS422 converter ~ ~ at one end, and then connect according to the pin distribution on the converter.

In addition, the lower version of software will cause communication failure. Please use the higher version of software.

Programming cable for f930got-bwd-c







Fabrication of communication cable between 4400 and OMRON CP1H


3 3

2 2

9 5

4, 5 short

Self made Panasonic PLC (FP0) programming cable diagram


Responsible editor: LQ

Leave a Reply

Your email address will not be published. Required fields are marked *