Engineers often encounter such problems: why can't my touch screen communicate with PLC? For example, the following two concrete problems.
1. The touch screen can't communicate with Siemens PLC. It always prompts that PLC doesn't respond. How to set it?
You can set the same baud rate, the same number of bits, the same stop bit, and the station number cannot be the same, that is, the PLC and touch screen addresses cannot be the same, and then determine whether the communication line is normal.
2. How to judge the communication failure between touch screen and PLC through the program?
The usual method is to use heartbeat detection, define a bool, set the point at a fixed frequency by HMI, and reset the point after PLC receives the ON signal. If the signal with this point ON is not received within a period of time, such as 5S, it is considered that the communication is interrupted.
The PLC transmits the memory clock byte to the screen, and the screen uses the script to assign the value of this byte to the address in another PLC, and then the PLC judges whether the two scanning cycles of the returned bytes are the same. If so, it indicates that the communication is interrupted.
For example, please see the figure. The steps are as follows:
1. Establish DB1 data block in PLC, which is equipped with two switching values "PLC second switch" and "man-machine response switch";
2. The two variables are connected in the man-machine variable;
3. Add "reverse position" in the attribute - event - value change of man-machine "PLC second switch" variable to make the "man-machine response switch" variable change with the change of "PLC second switch";
4. Program in the PLC program block to make the "PLC second switch" reverse every 0.5 seconds, and then use the TON delay command to make the "man-machine response switch" output man-machine communication failure without action within 1 second because the "man-machine response switch" will no longer change after the man-machine communication is abnormal.
In fact, the communication failure between the touch screen and PLC in the market is nothing more than need to confirm four problems:
1. Whether the PLC parameters are consistent with those in the project
2. Whether the communication line is wired according to the pin of the wiring diagram
3. Is the COM port set in the project connected correctly on the screen
5. If the parameters and lines are OK, check whether there is a problem with the PLC program or the PLC address.
Judge the parameters first:
1. Connect PLC with PLC programming software to test to see what the PLC parameters are and whether the parameters set in the project are consistent with those tested.
2. Online simulation: use the configuration software to connect the communication cable of PLC with the computer, and conduct an online simulation to see whether the project is in communication. You can use a numerical input component or switch to operate it to see whether the previous operation is still after turning off the simulator and then turning on the online simulation and whether it directly prompts NC. (NC and previous operations do not proceed, that is, they are not connected)
Use a multimeter to test the wiring according to the pin definition of the wiring diagram.
1: Touch screen parameters. Check the parameter settings of the touch screen.
There are several parameters that need special attention.
● The setting of the communication port - be sure to confirm whether the PLC is connected to the COM1 port or the COM2 port of the touch screen.
● Equipment type - this is the most important. If the protocol is not selected correctly, there is no need to say anything else.
● Connection mode - the connection between PLC and touch screen. Confirm whether it is RS485 or RS232C.
● Interface parameters and PLC station number - must be consistent with the settings in PLC.
2: If the parameters are set correctly, then check the line.
Confirm whether the wiring of RS485 and RS232C is correct, and the wiring method of the touch screen is different from that of various PLC. This is the basic method for normal troubleshooting of communication problems.
When there is a communication failure, some customers will guess that it may be a problem from the touch screen or the interface. Then online simulation is to bypass the touch screen and connect directly with the computer with PLC.
1: PLC and industrial computers shall be connected through RS232. Some PLCs have RS232 interfaces, for those that do not have RS232 interfaces can be connected to the computer through the adapter.
2: Create a new simple project. Put two components, one value display, and one value input. And set the address in PLC.
3: The engineering parameter setting must be the same as that in PLC.
4: Click the online simulation function.
In this way, you can obviously check whether the PLC can communicate with the PC. If you can communicate, you can eliminate the problems of PLC and parameter setting.
Industrial Mini PC Fanless i3 i5 i7 Industrial Box PC VIEW MORE
Industrial Android Industrial PC with Touch Screen 10.4 Inch VIEW MORE
Android All in One Panel PC Easy Capacitive Touch 12 Inch VIEW MORE
11.6 inch Industrial Touch Screen Computer Monitor Suit for Raspberry Pi CE Approved 11.6 inch VIEW MORE
Industrial Touchscreen Panel PC All in One Windows 19 Inch VIEW MORE
Windows Industrial All in One Panel PC With Touch Screen VIEW MORE
Industrial Monitor Capacitive Multi Touch Screen 10.1 Inch VIEW MORE
Industrial Capacitive Touch Screen Display Flat Panel 10.4 Inch VIEW MORE
Industrial Touch Screen Panel PC Capacitive Or Resistive Touch Screen VIEW MORE
Industrial Tablet All in One PC with Windows 11.6 Inch VIEW MORE
Industrial Touch Screen Monitor High Brightness Waterproof 21.5 inch VIEW MORE
Industrial Display Flat panel TFT LCD Monitor 19.1 inch VIEW MORE