Point“Jinan CNC Mold Technology Research Institute” focus
Industry frontier, mechanical videos, CNC processing technology, 3D printing, industrial robots, productionprocesses, molds, machine tools, and other cutting-edge information are waiting for you here!
Today, I will share several common interfaces and communication protocols for Siemens PLC.
1
Difference Between RS232 and RS485 Interfaces
1. Physical Structure of the Interface
1. RS232 Interface: One of the computer communication interfaces, typically the RS-232 interface appears in the form of 9 pins (DB-9) or 25 pins (DB-25). Generally, personal computers have two sets of RS-232 interfaces, referred to as COM1 and COM2.
2. RS485
RS485 does not have a specific physical shape and the interface is adopted based on the actual engineering situation.
2. Electronic Characteristics of the Interface
1. RS232: The signal level of the transmission level signal interface is relatively high (signal “1” is “-3V to -15V”, signal “0” is “3 to 15V”), which can easily damage the chips in the interface circuit. Additionally, due to incompatibility with TTL levels (0~”<0.8v”, 1~”>2.0V”), a level conversion circuit is required to connect with TTL circuits. Moreover, it has poor anti-interference ability.
2. RS485: The differential signal logic “1” is represented by the voltage difference between the two wires as + (2—6) V; logic “0” is represented by the voltage difference as – (2—6) V. The signal level of the interface is lower than RS-232, making it less likely to damage the chips in the interface circuit, and this level is compatible with TTL levels, allowing easy connection with TTL circuits.
3. Communication Distance1. RS232: The transmission distance of RS232 is limited, with a maximum standard transmission distance of 15 meters, and it can only communicate point-to-point, with a maximum transmission speed of 20kB/s. 2. RS485: The maximum wireless transmission distance of RS485 is 1200 meters. The maximum transmission speed is 10Mbps, and at a transmission speed of 100Kb/S, the maximum communication distance can be achieved. Using impedance matching and low-loss dedicated cables can achieve 1800 meters! Beyond 1200 meters, repeaters can be added (up to 8), bringing the transmission distance close to 10Km.
4. Support for Multi-point CommunicationRS232: Only one transceiver is allowed to be connected on the bus, and it does not support multi-station transceiver capability, so it can only communicate point-to-point and does not support multi-point communication.
RS485: The RS485 interface allows up to 128 transceivers to be connected on the bus. It has multi-station communication capability, allowing users to easily establish a device network using a single RS485 interface.
5. Difference in Communication LinesRS232: Can use three-core twisted pair cables, three-core shielded cables, etc. RS485: Can use two-core twisted pair cables, two-core shielded cables, etc. In low-speed, short-distance, and interference-free situations, ordinary twisted pairs can be used; conversely, in high-speed, long-distance transmissions, dedicated RS485 cables (STP-120Ω for RS485 & CAN) with impedance matching (generally 120Ω) must be used, and in environments with severe interference, armored twisted shielded cables (ASTP-120Ω for RS485 & CAN) should be used.
Supplement: Since the transmission distance of RS232 is only 15 meters, what is its use?In fact, its application is very wide; it can connect various devices, such as monitoring, upgrading, or debugging other devices, etc. Its function is quite similar to USB. With the increasing prevalence of USB ports, more devices that convert USB to RS-232 or other interfaces will emerge. Through the USB interface, more RS-232 devices can be connected, not only achieving higher transmission speeds and true plug-and-play but also solving the problem of USB interfaces not being able to transmit over long distances (the USB communication distance is within 5 meters).
2
Common Communication Protocols
Before we start this issue, we should understand a previous question that I have always confused.
Difference Between RS485 and MODBUS:RS485 is a physical interface, simply put, it is hardware. MODBUS is an internationally standardized communication protocol used for data exchange between devices from different manufacturers (usually for industrial purposes); the so-called protocol can also be understood as the “language” mentioned by someone above, simply put, it is software.
Generally, two devices transmit data through the MODBUS protocol: initially, RS232 was used as the hardware interface (that is, the serial communication port on ordinary computers); there are also RS422 and the commonly used RS485. This interface has a long transmission distance and is used more in general industrial sites. The MODBUS protocol is divided into three modes: MODBUS RTU, MODBUS ASCII, and the later developed MODBUS TCP. The first two (MODBUS RTU, MODBUS ASCII) use serial communication (RS232, RS422, RS485) as their physical hardware interface. MODBUS TCP, on the other hand, is designed to keep pace with today’s world development trend, where everything can be connected via Ethernet or the Internet to transmit data. Thus, the MODBUS TCP mode emerged, and the hardware interface for this mode is the Ethernet port, which is the network port commonly used on our computers.
Then we can understand through an image the communication protocols supported by S7-200 PLC.
PPI Communication
It is a communication protocol developed by Siemens specifically for the S7-200 series PLC. It is built into the S7-200 CPU. The PPI protocol is physically based on the RS-485 port, and communication can be achieved through shielded twisted pairs. The PPI protocol is a master-slave protocol. The master device sends requests to the slave device, and the slave device responds; the slave cannot actively send information. The master communicates with the slave through a shared connection managed by the PPI protocol. The PPI protocol does not limit the number of masters communicating with any slave, but the number of masters in a network cannot exceed 32. The basic use of the PPI protocol is to allow Siemens Step7-Micro/Win programming software to upload and download programs and communicate with Siemens Human-Machine Interface and PC.MPI Communication
MPI (Multipoint Interface) is the interface for SIMATIC S7 multipoint communication, suitable for communication between a few stations, often used for short-distance communication between host computers and a small number of PLCs. By connecting the MPI programming port of the S7-300 or S7-400 CPU with the PPI communication port of the S7-200 CPU via Profibus cables and connectors, as well as connecting to the programming port (MPI/DP port) of the host computer’s network card through Profibus or MPI cables, it can be achieved. Of course, the network can also include only PLCs without PC.
The communication rate of MPI is 19.2k~12mbit/s, but the maximum speed when directly connecting to the S7-200 CPU communication port is usually 187.5kbit/s (limited by the maximum communication speed of the S7-200 CPU). There can be a maximum of 32 stations on an MPI network, and the longest communication distance for a segment is 50 meters (when the communication baud rate is 187.5kbit/s), and longer distances can be extended using RS-485 repeaters. MPI allows master-master communication and master-slave communication, and the number of connections for each S7-200 CPU communication port is 4.
The MPI protocol cannot communicate with an S7-200 CPU that acts as a PPI master; that is, when communicating with an S7-300 or S7-400, the S7-200 CPU must not act as a PPI master. Micro/Win cannot access an S7-200 CPU acting as a PPI master via the MPI protocol. The S7-200 CPU can only act as an MPI slave, meaning that S7-200 CPUs cannot communicate with each other via the MPI network, only through PPI.
Modbus Communication
Modbus was invented by Modicon (now a brand of Schneider Electric) in 1979 and is the world’s first real bus protocol used in industrial sites. To better popularize and promote Modbus in distributed applications based on Ethernet, Schneider Electric has transferred ownership of the Modbus protocol to IDA (Interface for Distributed Automation) and established the Modbus-IDA organization, laying the foundation for the future development of Modbus. In China, Modbus has become the national standard GB/T19582-2008. According to incomplete statistics, by 2007, the number of Modbus node installations had exceeded 10 million.
The Modbus protocol is a universal language applied to electronic controllers. Through this protocol, controllers can communicate with each other, and controllers can communicate with other devices over a network (such as Ethernet). It has become a general industrial standard. With it, control devices produced by different manufacturers can be connected to form an industrial network for centralized monitoring. This protocol defines the message structure that a controller can recognize, regardless of the network used for communication. It describes the process of a controller requesting access to other devices, how to respond to requests from other devices, and how to detect and log errors. It establishes a common format for the message domain layout and content. Modbus is a single-master master/slave communication mode. There can only be one master on a Modbus network, while the number of slaves can be several.
Modbus has the following features:
1. Standard and open, users can use the Modbus protocol freely and confidently without paying license fees or infringing on intellectual property rights. Currently, more than 400 manufacturers support Modbus, and more than 600 types of products support Modbus.
2. Modbus can support multiple electrical interfaces, such as RS-232, RS-485, and can also be transmitted over various media, such as twisted pairs, optical fibers, and wireless.
3. Modbus’s frame format is simple, compact, and easy to understand. It is easy for users to use and simple for manufacturers to develop.
Note: The S7-200 only supports the Modbus RTU protocol and does not support the Modbus ASCII protocol;
ProfiBus Communication
As one of the many fieldbus family members, ProfiBus is the most widely used fieldbus standard in the European industrial sector and is currently one of the internationally accepted fieldbus standards. ProfiBus belongs to the unit-level and field-level SIMATIC network, suitable for transmitting small to medium amounts of data. Its openness allows many manufacturers to develop their products that comply with the ProfiBus protocol, which can be connected to the same ProfiBus network.
ProfiBus is an electrical network, and the physical transmission medium can be shielded twisted pairs, optical fibers, or wireless transmission. It officially became an international standard for fieldbus in 1989. PROFIBUS is an international, open, device-independent fieldbus standard, with transmission speeds selectable in the range of 9.6kbaud to 12Mbaud. When the bus system starts, all devices connected to the bus should be set to the same speed. PROFIBUS is widely used in manufacturing automation, process industry automation, and automation in other fields such as buildings and transportation power. PROFIBUS is also a fieldbus technology used for workshop-level monitoring and data communication and control at the field device level. It can achieve decentralized digital control and field communication networks from the field device level to workshop-level monitoring, providing feasible solutions for comprehensive factory automation and intelligent field devices.
USS Communication
USS (Universal Serial Interface) is a communication protocol developed by Siemens specifically for drive devices, which has undergone continuous development and improvement over the years. Initially, USS was used for parameterization of drive devices, focusing more on parameter settings. It is widely used in connections between drive devices and operator panels, as well as debugging software (such as DriveES/STARTER).
Recently, due to its simple protocol and low hardware requirements, USS is increasingly used for communication with controllers (such as PLCs) to achieve general level communication control. (Note: USS provides a low-cost and relatively simple communication control method; due to its design, USS cannot be used in situations requiring high communication speeds and data transmission volumes. In these high-demand communication scenarios, a more real-time communication method, such as PROFIBUS-DP, should be selected. When designing the system, this limitation of USS must be considered.
For example, if USS communication control is used for dozens of frequency converters in applications requiring high-speed synchronization (such as paper production lines), the effect can be imagined.
All Siemens frequency converters come with an RS485 communication port, and the PLC, as the master, allows a maximum of 31 frequency converters as slaves in the communication link. Based on the address of each frequency converter or using broadcast methods, it can access the frequency converters that need to communicate. Only the master can issue communication request messages, and the address characters in the message specify the slave to which data is to be transmitted. The slave can only send data to the master after receiving the master’s request message; slaves cannot directly exchange data with each other.
Before using the USS protocol, the Siemens instruction library needs to be installed first. The USS protocol instructions are in the library folder of the STEP7-MICRO/WIN32 instruction tree, which provides 14 subprograms, 3 interrupt programs, and 8 instructions to support the USS protocol. When calling an instruction, one or several subprograms will be automatically added.
Basic Features of the USS Protocol:
-
Supports multi-point communication (therefore can be applied in networks such as RS 485)
-
Uses a single-master “master-slave” access mechanism
-
A maximum of 32 nodes can be on one network (maximum 31 slaves)
-
Simple and reliable message format, making data transmission flexible and efficient
-
Easy to implement and cost-effective
The working mechanism of USS is that communication is always initiated by the master. The USS master continuously polls each slave, and the slave decides whether and how to respond based on the received instructions. The slave will never actively send data.
Slaves should respond under the following conditions:
1. The received master message has no errors;
2. The slave is addressed in the received master message.
Vocational Training Base for College Graduates——Jinan CNC Mold Technology Research Institute has been primarily engaged inCAD/CAM Advanced Programming, UG Four/Five Axis Programming, CNC Machine Tool Maintenance, Injection Mold Design, Stamping Mold Design, Reverse Modeling, Industrial Robots, 3D Printing, etc.Pre-job training. One-time registration for lifelong learning. During the training, teachers conduct periodic tests to fully control students’ learning progress, small class teaching, one-on-one tutoring, combining theory and practice until mastery, and free job placement after completion. The research institute provides long-term technical support and employment services to students. All teachers and students of the Jinan CNC Mold Technology Research Institute welcome your visit and study. The institute is located at 20333 A4, Panwang Road, Shengjing Street, Zhangqiao District, Jinan City
Consultation Hotline: 0531-85708996