Inquiry
Form loading...
Why does your PLC and your touch screen always fail to communicate?

News

Why does your PLC and your touch screen always fail to communicate?

2023-12-08
Common reasons for failure of communication between touch screen and PLC 1. Whether the correct communication protocol (Modbus, PROFIBUS, CANopen, EtherCAT) is selected. 2. Whether the communication line is made OK (RS232 RXD TXD GND RS485 A+B - CANopen CAN_L CAN_H CAN_GND EtherCAT network cable). 3. Whether the communication parameters are correct (station number, baud rate, check bit). Terminal resistance is required for CAN communication. 4. Whether there is interference According to the program, the communication between the touch screen and PLC fails The general method is to use heartbeat detection to define a bool. HMI sets the point at a fixed frequency. PLC resets the point after receiving the ON signal. If no ON signal is received at this point within a period of time, such as 5s, the communication is considered to be interrupted. The PLC transmits the memory clock byte to the screen. 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 byte are the same. If the two scanning cycles are the same, the communication interruption is clarified. For example, the process is as follows: 1. Establish DB1 data block in PLC, and set two switch values "PLC second switch" and "man-machine response switch" inside; 2. The two variables are connected in man-machine variables; 3. Add "reverse position" to the characteristic of human-machine "PLC second switch" variable -- event -- value change, so that the "human-machine response switch" variable changes with the change of "PLC second switch"; 4. Program in the PLC program block, make the "PLC second switch" rotate every 0.5 seconds, and then use the TON delay command to make the "human-machine response switch" output human-machine communication failure if there is no action within 1 second. Because the "human-machine response switch" will not change after the human-machine communication is abnormal. Four problems to be admitted that the communication between touch screen and PLC is not good 1. Whether the PLC parameters and those in the project are common 2. Whether the communication lines are wired according to the pins in the wiring diagram 3. Whether the time division of the COM port set in the project is correct on the screen 4. If the parameters and lines are OK, check whether it is a PLC program or a PLC address problem Specific method 1: parameters of touch screen. Check the parameter settings of the touch screen. Connect the PLC programming software with the PLC test to see how many PLC parameters are, and whether the parameters set in the project are the same as those tested. Here are several parameters that require special attention: 1. The setting of the communication port must be clear about whether the PLC connects to the COM1 or COM2 port of the touch screen; 2. Device type -- this is the most important. If the protocol is not selected correctly, let alone the others; 3. Connection mode - the connection between PLC and touch screen, whether it is RS485 or RS232C; 4. Interface parameters and PLC station number must be consistent with the settings in PLC. 2、 If the parameter recognition is set, then check the circuit. Use a multimeter to test the wiring according to the pin definition in the wiring diagram. Acknowledge whether the RS485 and RS232C wiring is correct, and the touch screen wiring is different from various PLC wiring methods. This can be checked by referring to the maintenance and control (PLC and touch screen communication cable connection assistance document), which is the basic method for normal troubleshooting of communication problems. Next, teach us how to avoid the problem of touch screen -- online imitation. When communication is not available, some customers will guess that it may be a problem with the touch screen or the interface. Online simulation is to bypass the touch screen and directly connect the PLC with the computer. Use our configuration software to connect the communication cable of PLC with the computer, and simulate online to see if the project can communicate. You can use a numerical input component or switch to operate it, and check whether the previous operation is still in use after the simulator is turned off and turned on again, and whether the NC prompt is given directly after the online simulation (NC and the previous operation are not written down, that is, they are not connected). Specific methods: 1. The PLC and the computer shall be connected through RS232. Some PLCs have RS232 interfaces, some do not, and none can be connected to the computer through the adapter. 2. Create a simple project. Put two components, one for display and one for input. Address Set the address inside the PLC. 3. The engineering parameter settings must be the same as those in the PLC. 4. Click the online imitation function. In this way, you can obviously check whether the PLC can communicate with the PC. If we can communicate, we can eliminate the problems in PLC and parameter setting.