Often, technicians encounter the issue: why can’t my touch screen communicate with the PLC? For example, here are two common problems:
1. Weintek touch screen cannot communicate with Siemens PLC, always indicating no response from the PLC. How should it be set up?
Solution Approach:
Ensure you set the same baud rate, the same data bits, the same stop bits, and the station number must be different, meaning the PLC and touch screen addresses cannot be the same. Then confirm if the communication line is normal…
2. How to determine if there is a communication fault between the touch screen and PLC through the program?
Solution Approach:
The usual method is to use heartbeat detection, define a bool, and the HMI will set this point at a fixed frequency. After the PLC receives this point as an ON signal, it resets it. If within a certain time, say 5 seconds, the ON signal is not received, it is considered that communication has been interrupted.
The PLC sends the memory clock byte to the screen, and the screen uses a script to assign this byte’s value to another address within the PLC. Then the PLC checks if the returned byte is the same for two scan cycles. If they are the same, it indicates communication interruption.
For example, see the diagram, steps are as follows:
1. Create data block DB1 in PLC, set two digital switches “PLC Second Switch” and “HMI Response Switch”;
2. Connect these two variables in the HMI variables;
3. In the properties of the HMI “PLC Second Switch” variable—Event—Value Change, add “Invert”, so that the “HMI Response Switch” variable changes with “PLC Second Switch”;
4. Program in the PLC program block to reverse “PLC Second Switch” every 0.5 seconds, and use the TON delay instruction to output HMI communication failure if there is no action on the “HMI Response Switch” within 1 second, because after HMI communication abnormality, the “HMI Response Switch” will no longer change.
Actually, any touch screen on the market unable to communicate with the PLC is usually due to confirming four issues:
1. Are the PLC parameters consistent with the project?
2. Is the communication line wired according to the schematic?
3. Is the COM port set in the project correctly connected on the screen?
4. After confirming the parameters and lines are OK, check if it is a PLC program or PLC address issue.
Method:
First, check the parameters:
1. Use the PLC programming software to connect to the PLC and test what the PLC parameters are, ensuring they match the parameters set in the project.
2. Online simulation: Use our configuration software, connect the PLC’s communication cable to the computer, and simulate online to see if the project can communicate. You can use a numerical input component or switch to operate and check if the operations persist after turning off the simulator or if it directly indicates NC. (NC and previous operations not recorded mean there is no communication.)
Test Line:
Use a multimeter to test the wiring according to the schematic definition.
1. Touch Screen Parameters; check the parameter settings of the touch screen.
There are several parameters that need special attention:
1. Communication port settings—be sure to confirm whether the PLC connects to the touch screen via COM1 or COM2.
2. Device type—this is the most important; if the protocol is not selected correctly, there is no need to discuss further.
3. Connection method—confirm whether the PLC is connected to the touch screen via RS485 or RS232C.
4. Interface parameters and PLC station number—must match the settings in the PLC.
2. If the parameters are confirmed to be set correctly, then check the wiring issues.
Confirm whether the wiring for RS485 and RS232C is correct; the wiring methods for the touch screen with various PLCs differ. You can refer to the Weikong (PLC and Touch Screen Communication Wiring Help Document) for basic methods of troubleshooting communication issues.
Next, I will teach you how to bypass touch screen issues—online simulation. When communication fails, some customers may speculate that it could be a touch screen issue or an interface issue. Online simulation bypasses the touch screen and connects the PLC directly to the computer.
Specific Steps:
1. Connect the PLC to the computer via RS232. Some PLCs have RS232 interfaces, while others do not; if not, you can use an adapter to connect to the computer.
2. Create a simple project. Place two components, one for numerical display and one for numerical input. Set the address to match the address in the PLC.
3. Ensure the project parameter settings match those in the PLC.
4. Click the online simulation function.
By doing so, you can clearly see whether the PLC can communicate with the PC. If communication is successful, you can rule out issues on the PLC side and parameter settings.
Disclaimer: This article is reprinted from the internet, and the copyright belongs to the original author. If there are any copyright issues, please contact us for deletion. Thank you!