In the above communication mode, since only two wires are used for data transmission, the hardware handshake signal cannot be used as a detection method. Therefore, when a bit error occurs in the communication between the PC and the PLC, it will not be possible to determine whether a bit error occurs through hardware, or when the operating speeds of the PC and the PLC are different, a conflict will occur. These communication errors will cause the PLC control program to not work properly, so software handshake must be used to ensure the reliability of communication.
Since the communication is coordinated between the PC and PLC, the communication programs in the PC and PLC must also be coordinated with each other, that is, when one party sends data, the other party must be in the state of receiving data. Figures 7-18 and 7-19 show the communication program flows of the PC and PLC respectively.
Figure 7-18 PC communication program flow chart
Figure 7-19 S7-PLC communication program flow chart
The working process of the communication program: Before sending each byte, the PC first sends a handshake signal. After receiving the handshake signal, the PLC transmits it back to the PC. The PC starts to send a byte of data only after receiving the handshake signal sent back by the PLC. After receiving this byte of data, the PLC also transmits it back to the PC. The PC compares the original data with the data sent back by the PLC. If the two are different, it means that a bit error occurred in the communication, and the PC resends the byte of data; if the two are the same, it means that the data received by the PLC is correct, and the PC sends the next handshake signal. After receiving this handshake signal, the PLC stores the previously received data in the specified storage area. This working process is repeated until all data transmission is completed.
After adopting software handshake, no matter how far the speed of PC and PLC differs, the sender will never be ahead of the receiver. The disadvantage of software handshake is that it greatly reduces the communication speed, because each byte must be transmitted back and forth twice on the transmission line, and the handshake signal must also be transmitted. However, considering the reliability and time requirements of control, sacrificing a little speed is worthwhile and feasible.
The communication program of PLC is only a small part of the whole control program of PLC. The communication program can be compiled into the interrupt program of PLC. When PLC receives the data sent by PC, it processes the received data in the interrupt program. The communication program of PC can adopt VB, VC and other languages, or directly adopt Siemens special configuration software, such as STEP7 and WinCC.
Previous article:Operating Characteristics of Switched Reluctance Motor
Next article:Reasons and treatment methods for DC motor speed lower than rated value
Recommended ReadingLatest update time:2024-11-15 09:54
- Popular Resources
- Popular amplifiers
- Detailed explanation of intelligent car body perception system
- How to solve the problem that the servo drive is not enabled
- Why does the servo drive not power on?
- What point should I connect to when the servo is turned on?
- How to turn on the internal enable of Panasonic servo drive?
- What is the rigidity setting of Panasonic servo drive?
- How to change the inertia ratio of Panasonic servo drive
- What is the inertia ratio of the servo motor?
- Is it better for the motor to have a large or small moment of inertia?
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- Detailed explanation of intelligent car body perception system
- How to solve the problem that the servo drive is not enabled
- Why does the servo drive not power on?
- What point should I connect to when the servo is turned on?
- How to turn on the internal enable of Panasonic servo drive?
- What is the rigidity setting of Panasonic servo drive?
- How to change the inertia ratio of Panasonic servo drive
- What is the inertia ratio of the servo motor?
- Is it better for the motor to have a large or small moment of inertia?
- What is the difference between low inertia and high inertia of servo motors?
- [nRF52840 DK Review] +52840 NFC (Part 2)
- What domestic chips are needed to DIY a fast-charging chromium iron or an electric chromium iron that works as a laptop power supply?
- Bluetooth module communicates with mobile phone
- The compilation of the program sent by serial communication always fails
- Does the clearance below the crystal oscillator refer to the layer where the chip is located or all layers?
- [Automatic clock-in walking timing system based on face recognition] Maixbit K210 initialization loading SD card unstable problem
- How to control three colorful LED light strips with the same signal using three remote controllers
- Electromagnetic compatibility circuit board design: based on Altium Designer platform
- Make driving fun! Designing interactive and non-distracting infotainment systems
- How to select external clock for TI DSP?