Three axes: resources, logic, and environment
The connection between the industrial control integrated machine and sensors, controllers, etc. mainly relies on the serial port, which is mainly RS232 serial port and RS485 serial port.
The problem often encountered in the use of the integrated machine in the industrial environment is communication failure, especially RS485 failure.
Since RS485 is a bus mode, there are more connected devices and the failure rate is higher; while RS232 is a point-to-point mode, there are generally few failures, and even if there is a failure, it is easier to troubleshoot.
This article uses the three-axe thinking method of Lianzhitongda to analyze and handle common failures in the RS485 serial port communication of the industrial control integrated machine. Other serial port failures can be referenced.
Get more information about industrial integrated computers, relevant product knowledge, and experience sharing on troubleshooting.
Fault 1: Data loss in serial communication
Resources:
The materials used for RS485 communication must meet the specifications. The general recommendations are as follows:
The data in the above table can be translated into easy-to-understand words:
Serial communication requires twisted pair cables. The longer the line, the better the cable. For scenarios with interference, shielded twisted pair cables (SFTP) are required. For scenarios where rodent damage is possible, armored double shielded cables (ASTP, try to use this type of cable for particularly long lines).
The RS485 bus mode needs to be connected in a hand-in-hand manner, and the star connection method should never be used. The hand-in-hand method is as shown in the figure below:
Transmission distance
|
Cable specifications
|
Remark
|
<100 m
|
STP-120Ω-22AWG
|
In scenarios where rodent infestation is possible, it is recommended to use armored double shielded cable (ASTP)
|
100-500 meters
|
SFTP-120Ω-18AWG
|
500-1200 meters
|
ASTP-120Ω-18AWG
|
The data in the table above can be translated into easy-to-understand words:
Serial communication requires twisted pair cables. The longer the line, the better the cable. In scenarios with interference, shielded twisted pair cables (SFTP) are required. In scenarios where there is a possibility of damage to the line due to rodents, armored double shielded cables (ASTP) are required. This type of cable is also recommended for particularly long lines.
The RS485 bus requires hand-in-hand connection. Never use a star connection. The hand-in-hand connection is as shown below:
In serial communication, if the line is long, matching resistance needs to be considered (as shown above). The terminal resistance can generally be used on a single end (industrial control integrated machine end). The specific needs need to be determined according to the actual situation during on-site debugging.
Logic:
RS485 adopts a one-master-multiple-slave mode, that is, by default only the industrial control integrated machine is in the sending state, and the others are in the receiving state. Only when a certain terminal receives its own data will it send data. Therefore, the address of any terminal must be unique and cannot be repeated.
Environment:
Interference from the external environment is also a major factor affecting serial communication. Therefore, try to use standard cables as required above, especially when the communication distance is long, better cables need to be used.
Fault 2: Some terminals cannot communicate
Resources:
Communication cables must be connected in a hand-in-hand manner, and do not use a star structure connection;
When connecting signal lines, the connection must be firm and reliable, and be careful not to leave beards;
When debugging, debug one by one from near to far. When you find that communication abnormalities occur when debugging a certain terminal, check the cause of the terminal problem here. After eliminating the problem of the terminal itself, ensure that the cable connection is good;
As an engineer of Lianzhitongda with rich field experience, it is found that on the other hand, the overall interference may be caused by the common interference source of multiple devices. This is also the most difficult problem to deal with in project implementation. The terminal matching resistor is the key to eliminating interference. The role of the terminal resistor is to eliminate signal reflection and terminal interference signals.
Logic:
For RS485 communication, it is necessary to ensure the uniqueness of all terminal addresses. Address conflicts will cause communication abnormalities;
Some cannot communicate, indicating that the line connection logic is normal, but the line is interfered. Just perform debugging as described above.
Environment:
In order to reduce external interference, use shielded twisted pair cables, pipe protection, or armored cables as much as possible to avoid external interference as much as possible.
When using a single-layer shielded cable, the ground wire at the industrial control machine end is connected to the host ground wire, and the terminal side is not grounded;
When using a double-layer shielded cable (including armored cable), both ends of the inner ground wire are grounded, and only the outer layer is grounded at the industrial control machine end.
There are many types of shielded twisted pair cables. The following figure shows two of them for reference only.
Fault three: Complete failure to communicate
Resources:
First, check whether the RS485 interface of the industrial control machine and the terminal is normal. You can connect a laptop and test it with a serial port debugging tool;
Second, use a multimeter to measure the voltage difference between the RS485 data lines. The AC voltage difference is normal at around 2.5V. If it is lower than 2.0V, it means that the signal is weak or there is a disconnection.
Logic:
The basic conditions for successful RS485 communication are: normal equipment, one master and multiple slaves, one-to-one data line connection (A-A, B-B), the cable meets the standard, and the cable length is within the specified range.
You can debug each terminal from near to far. Once an abnormality is found, check the terminal.
Environment:
Environmental interference is a common cause of RS485 communication failures, so using better cables will save a lot of trouble. In addition, the cables need to be protected, such as: wearing pipes, using shielded cables and armored cables, etc.
This article is the third in the series of troubleshooting articles on industrial control all-in-one computers. We will continue to analyze various specific problems in the future. Lianzhitongda combines many years of experience in industrial products to share the analysis and processing ideas of specific problems with everyone. Follow us to learn about the relevant product knowledge of industrial control all-in-one computers and experience sharing of troubleshooting at any time.