Civil Engineering Online Forum \ electrical engineering \ Other electrical design software \ Advanced electrician: basic knowledge of PLC serial communication and interface is required!

Advanced electrician: basic knowledge of PLC serial communication and interface is required!

Electrical operators will be exposed to many communication protocols and communication interfaces when using PLC PLC serial communication and basic communication interface Do you understand?



                    
What is serial communication?          

     

Serial port is a very general device communication protocol on the computer (not to be confused with universal serial bus or USB). Most computers include two serial ports based on RS232.

The serial port is also a common communication protocol for instruments and meters; Many GPIB compatible devices also have RS - 232 ports. At the same time, the serial communication protocol can also be used to obtain the data of remote collection devices.


                    
Use of serial communication        

     

Serial communication is completed with three wires: (1) ground wire, (2) transmission, and (3) reception. Because serial communication is asynchronous, the port can send data on one line and receive data on another. Other lines are used for handshaking, but are not necessary.

The most important parameters of serial communication are baud rate, data bit, stop bit and parity check. For two ports to pass, these parameters must match:

a. Baud rate: This is a parameter to measure communication speed. It represents the number of bits transmitted per second. For example, 300 baud means 300 bits are sent every second. When we mention the clock cycle, we mean the baud rate. For example, if the protocol needs 4800 baud rate, then the clock is 4800Hz.


This means that the sampling rate of serial communication on the data line is 4800Hz. Usually the baud rate of the telephone line is 1440028800 and 36600. The baud rate can be much greater than these values, but the baud rate is inversely proportional to the distance. High baud rates are often used for communication between instruments placed close together.

b. Data bits: This is a parameter that measures the actual data bits in communication. When the computer sends a packet, the actual data will not be 8 bits, and the standard values are 5, 7, and 8 bits. How you set it depends on the message you want to send.

For example, the standard ASCII code is 0~127 (7 bits). The extended ASCII code is 0~255 (8 bits). If the data uses simple text (standard ASCII code), each packet uses 7 bits of data. Each packet refers to a byte, including start/stop bit, data bit and parity bit. Since the actual data bits depend on the selection of the communication protocol, the term "packet" refers to any communication situation.


c. Stop bit: Used to represent the last bit of a single package. Typical values are 1, 1.5, and 2 bits. Since the data is timed on the transmission line, and each device has its own clock, it is likely that there is a small non synchronization between the two devices in the communication.

Therefore, the stop bit not only indicates the end of transmission, but also provides the opportunity for the computer to correct clock synchronization. The more bits applicable to stop bits, the greater the tolerance of different clock synchronization, but the slower the data transmission rate.


d. Parity bit: A simple error detection method in serial communication. There are four error detection methods: even, odd, high and low. Of course, it is OK to have no check bit. For even and odd parity, the serial port will set the parity bit (the bit after the data bit), and a value will be used to ensure that the transmitted data has even or odd logical high bits.


For example, if the data is 011, for even parity check, the check bit is 0, ensuring that the number of digits with high logic is even. If the parity check is odd, the check bit is 1, so there are 3 logical high bits. The high and low bit are not really checked data, and the logic high or logic low check is simply set. This enables the receiving device to know the status of a bit, and has the opportunity to determine whether there is noise interfering with communication or the data transmitted and received are not synchronized.


                    
Common PLC basic interface        

     

a. What is RS-232?

RS-232 (ANSI/EIA-232 standard) is a serial connection standard on IBM-PC and its compatible computers. It can be used for many purposes, such as connecting a mouse, a printer, or a modem, and can also be connected to industrial instruments. For the improvement of drive and connection, the transmission length or speed of RS-232 often exceeds the standard value in practical applications.

RS-232 is only limited to point-to-point communication between PC serial port and equipment. The maximum distance of RS - 232 serial communication is 50 feet.


b. What is RS-422?

RS - 422 (EIA RS-422-A Standard) is the serial port connection standard of Apple's Macintosh computers.

RS-422 uses differential signal, and RS-232 uses unbalanced reference ground signal. Differential transmission uses two lines to send and receive signals. Compared with RS-232, it can better resist noise and has a longer transmission distance. In industrial environment, better noise resistance and longer transmission distance are a great advantage.


c. What is RS-485?

RS - 485 (EIA-485 standard) is an improvement of RS - 422, because it increases the number of devices from 10 to 32, and defines the electrical characteristics under the maximum number of devices to ensure adequate signal voltage.


With the ability of multiple devices, you can use a single RS-422 port to establish a device network. Excellent anti noise and multi device capability. When establishing a distributed device network connected to PC, other data collection controllers, HMI or other operations in industrial applications, RS-485 will be selected for serial connection.

RS-485 is a superset of RS-422, so all RS-422 devices can be controlled by RS-485. RS-485 can use more than 4000 feet of wire for serial communication.




Disclaimer: This article is transferred from the network, and the copyright belongs to the original author. If there is any copyright problem, please contact to delete it. Thank you!



Other electrical design software

Back to section

180800 items · 135 subscribers

Guess you like it

Read the next article

Siemens S7-1200 PLC control motor random start

1、 Action description: 1 There are five motors at present, and their random interval starting is required for motor 1~5 numbering; 2.5 Motors For 5 selector switches, the order of selection determines the order of motor startup; For example, if switch 2 is selected first, motor 2 will start first, and so on; Unselected motor will not start;

Successful reply

Experience value+ ten