Many technicians have the following problems. In fact, aside from the communication methods defined by manufacturers, the most common reasons for communication failure in projects can be summarized as follows:
-
Have you selected the correct communication protocol (Modbus, RS232 free protocol, CANopen, EtherCAT)?
-
Is the communication cable properly made ( RS232 RXD TXD GND RS485 A+ B- CANopen can_L can_H can_GND EtherCAT Ethernet cable)?
-
Are the communication parameters correct (station number, baud rate, parity)? CAN communication requires terminal resistors.
-
Is there any interference?
Technicians often ask in groups about the issue: why can’t my touch screen communicate with the PLC? For example, the following two issues:
1. The Weintek touch screen and Siemens PLC cannot communicate, always prompting that the PLC is unresponsive. How should it be set?
Solution approach:
Ensure that the baud rate, data bits, and stop bits are the same, and the station numbers must not be identical. In other words, the PLC and touch screen addresses cannot be the same. Then confirm whether the communication cable is normal…
2. How to determine if there is a fault in communication between the touch screen and PLC through programming?
Solution approach:
The usual method is to use heartbeat detection. Define a boolean variable, and the HMI sets this point at a fixed frequency. After the PLC receives this point as an ON signal, it resets it. If the ON signal is not received within a certain time, say 5 seconds, it is considered that communication is interrupted.
The PLC transmits the memory clock byte to the screen, and the screen uses a script to assign the value of this byte to another address within the PLC. Then the PLC checks whether the returned byte is the same over two scan cycles. If they are the same, it indicates a communication interruption.
For example, please see the image, the steps are as follows:
1. Create a DB1 data block in the PLC, containing two binary switches: “PLC second switch” and “HMI response switch”;
2. Connect these two variables in the HMI variables;
3. In the properties of the HMI variable “PLC second switch” —- events —- value change, add “toggle position” so that the “HMI response switch” variable changes with the “PLC second switch”;
4. In the PLC program block, program the “PLC second switch” to toggle every 0.5 seconds, then use the TON delay instruction to output “HMI communication failure” if the “HMI response switch” does not act within 1 second, because after the HMI communication exception, the “HMI response switch” will no longer change.
In fact, any touch screen that cannot communicate with the PLC boils down to confirming four issues:
1. Are the PLC parameters consistent with those in the project?
2. Is the communication cable connected according to the wiring diagram?
3. Is the COM port set in the project correctly connected on the screen?
4. If the parameters and cables are confirmed to be OK, check if it is a PLC program or 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, checking if 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 numeric input component or switch to operate and see if the operations persist after turning off the simulator and then restarting the online simulation. If NC is directly prompted (NC means the previous operation did not register), it indicates that communication is not established.
Testing the cable:
Use a multimeter to test the wiring according to the wiring diagram.
1. Touch screen parameters. Check the touch screen parameter settings.
There are several parameters that need special attention:
1: Communication port settings – be sure to confirm whether the PLC is connected to COM1 or COM2 of the touch screen.
2: Device type – this is the most important; if the protocol is not selected correctly, there is no need to discuss the rest.
3: Connection method – confirm whether the connection between the PLC and touch screen is RS485 or RS232C.
4: Interface parameters and PLC station number – must be consistent with the settings in the PLC.
2. If the parameters are confirmed to be set correctly, the next step is to check the wiring issues.
Confirm whether the RS485 and RS232C wiring is correct. The wiring methods for the touch screen and various PLCs are different. This can be referenced in the Weikong (PLC and touch screen communication cable connection help document) to view this as a basic method for troubleshooting communication issues.
Next, I will teach you how to bypass the touch screen issue – online simulation. When communication fails, some customers may suspect that it is the touch screen issue or the interface problem. Online simulation bypasses the touch screen and connects the PLC directly to the computer.
Specific steps:
1. The PLC must be connected to the computer via RS232. Some PLCs have RS232 interfaces, while others do not. If not, they can be connected to the computer via an adapter.
2. Create a simple project. Place two components: one numeric display and one numeric input. Set the addresses to the addresses in the PLC.
3. The project parameter settings must match those in the PLC.
4. Click the online simulation function.
By doing this, you can clearly see whether the PLC can communicate with the PC. If communication is possible, then the issues can be ruled out as being from the PLC side or parameter settings.
Recommended reading:
Wuhan, Keep Going! [Stay at Home, Learn PLC Together]
No Time to Learn PLC? Chuangkong Will Help You!
(Content sourced from the internet, copyright belongs to the original author)
Disclaimer: If there are copyright issues, please contact for deletion! No individual or organization bears related legal responsibilities.