There are often masters who have encountered such a problem: How can my touch screen and PLC communicate? For example, the two problems encountered below:
1, Weiluntong touch screen and Siemens PLC communication is not on, always prompted PLC does not respond, how to set it?
Solutions:
You set the same baud rate, the same number of bits, the same stop bit, the station number can not be the same, that is, the plc and the touch screen address can not be the same, and then determine whether the communication line is normal...
2. How to judge the failure of the touch screen and PLC communication through the program?
Solutions:
The usual method is to use heartbeat detection to define a bool. The HMI fixed frequency sets the point. The PLC resets the point after it receives the ON signal. If the signal that the point is ON is not received within a certain period of time, for example, within 5 seconds, it is considered to be interrupted.
The PLC passes 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. Then the plc determines whether the returned byte has the same scan cycle. If the same indicates the communication interruption. .
For example, please see the picture, the steps are as follows:
1. Establish DB1 data block in PLC, which is equipped with two switch "PLC seconds switch" and "human machine response switch";
2. Connect these two variables in the human machine variable;
3. In the attribute of the "PLC second switch" variable----Event----add the "reverse bit" in the value change, let the "human-machine response switch" variable change with the "PLC second switch" ;
4. Program in the PLC program block, let the "PLC second switch" reverse every 0.5 seconds, and then use the TON delay command to let the "human-machine response switch" output no man-machine communication failure within 1 second, because man-machine communication After the abnormality, the "Human Machine Response Switch" will no longer change.
Good way, take it away, thank you~
In fact, any touch screen and PLC communication on the market is no different than confirming four problems:
1. Is the plc parameter consistent with the project?
2. Is the communication line connected to the pin according to the wiring diagram?
3. Is the com port set in the project correct when it is connected to the screen?
4, the parameters and line confirmation OK, in the case, to see if it is the plc program or plc address problem.
method:
First judge the parameters:
1. Connect the PLC test with the PLC programming software to see what the parameters of the PLC are. The parameters set in the project are consistent with those tested.
2, online simulation: use our configuration software, use the PLC's own communication cable and computer connection, online simulation to see if the project is on communication. You can use a numerical input component or switch to operate it. See if the operation before the simulation is turned off after the simulator is turned off, and whether the NC is directly prompted. (NC and previous operations did not write down, it is not available)
Test line:
Use a multimeter to define the test wiring according to the pins of the wiring diagram.
One: the parameters of the touch screen. Take a look at the parameter settings of the touch screen.
There are several parameters that require special attention:
1: Communication port setting---Be sure to confirm whether COM1 port or COM2 port of PLC connected touch screen
2: Device type---This is the most important. If the agreement is not selected, the other need not be said.
3: Connection method---PLC and touch screen connection, confirm good things RS485, or RS232C
4: Interface parameters and PLC station number --- must be consistent with the settings in the PLC.
Second: If the parameter confirmation is set, then check the line problem.
Confirm RS485, RS232C is correct, the touch screen is different from the various PLC wiring. This can be viewed with reference to the dimensional control (plc and touch screen communication line connection help documentation), which is the basic method for troubleshooting communication problems.
Next, teach you how to circumvent the touch screen problem - online simulation. When the communication is not on, some customers will guess that it may be a touch screen problem or an interface problem. Online simulation is to bypass the touch screen and connect directly to the computer with the PLC.
Specific practices:
1: PLC and computer should be connected through RS232. Some PLCs have RS232 interfaces, some do not, and no one can be connected to the computer through the adapter.
2: Create a simple project. Put two components, one value display, one value input. The address sets the address in the PLC.
3: The engineering parameter settings must be the same as the settings in the PLC.
4: Click on the online simulation function
In this way, it is obvious that the PLC can communicate with the PC. If you can communicate, you can eliminate PLC problems, and parameter settings.
plastic keychains wholesale,plastic keychain craft,plastic keychain diy,plastic keychain tags,custom plastic keychains
Shenzhen Konchang Electronic Technology Co.,Ltd , https://www.konchang.com