Connection method of weighing instrument and computer COM port

At present, the commonly used serial ports are 9-pin serial port (DB9) and 25-pin serial port (DB25). When the communication distance is short (<12m), you can directly connect the standard rs232 port (rs422, rs485) with a cable. Long distance, additional modem is required. The simplest and commonly used method is the three-wire connection method, that is, the three-pin connection of ground, receive data and send data. This article only covers the most basic connection method, and it is directly connected by rs232.

1.DB9 and DB25 common signal pin description

9-pin serial port (DB9) 25-pin serial port (DB25)

Pin No. Function description Abbreviation Pin No. Function description Abbreviation

1 Data carrier detection DCD 8 Data carrier detection DCD

2 Receive data RXD 3 Receive data RXD

3 Send data TXD 2 Send data TXD

4 Data Terminal Preparation DTR 20 Data Terminal Preparation DTR

5 Signal ground GND 7 Signal ground GND

6 Data Device Ready DSR 6 Data Ready DSR

7 Request to send RTS 4 Request to send RTS

8 Clear Send CTS 5 Clear Send CTS

9 Ring indication DELL 22 Ring indication DELL

2.RS232C serial communication wiring method (three-wire system)

First, the serial port can transmit data as long as it has the receive data pin and send pin: the receive pin and the send pin of the same serial port are directly connected by a wire, two serial ports are connected or one serial port is connected to multiple serial ports

The receiving pin and the sending pin of the same serial port are directly connected with a wire. For the 9-pin serial port and the 25-pin serial port, 2 and 3 are directly connected;

Two different serial ports (whether the two serial ports of the same computer or the serial ports of different computers)

9-pin 9-pin 25-pin 25-pin 9-pin 25

2 3 3 2 2 2

3 2 2 3 3 3

5 5 7 7 5 7

The above table is for a standard serial port of a microcomputer. There are many non-standard devices, such as receiving GPS data or electronic compass data. Just remember one principle: receive data pins (or lines) and send data pins (or lines). If they are connected, they cross, and they correspond to each other.

3. Points to note in serial debugging:

Different coding mechanisms cannot be mixed. For example, RS232C cannot be directly connected to RS422 interface. Special converters on the market are sold and must be connected through converters.

The welding of the line should be firm, otherwise the procedure is okay, but there is a mistake due to the wiring problem;

When serial port debugging, prepare a useful debugging tool, such as serial port debugging assistant, serial port wizard, etc.

It is strongly recommended not to plug and unplug the serial port while power is on. At least one end of the serial port is powered off during plugging or unplugging, otherwise the serial port is easily damaged.

label
Browse: Author: Source: Time:2019-12-22 15:55:28 Print