A PLC network is composed of several levels of subnets, and the communication process between each subnet is determined by the communication protocol, with the communication method being the core of the protocol. Communication methods include access control and data transmission. Access control refers to how to obtain the right to use the shared communication medium, while data transmission refers to how a station transmits data after obtaining the right to use the communication medium.
1. Cyclic I/O Communication Method
Periodic I/O communication is commonly used in PLC remote I/O links. The remote I/O link operates in a master-slave configuration, with the PLC's remote I/O master unit being the master station and all other remote I/O units being slave stations. A "remote I/O buffer" is established in the master station, using a mailbox structure, divided into several sub-boxes corresponding one-to-one with each slave station. Each sub-box is further divided into two sections: one for transmitting and the other for receiving. The communication processor in the master station uses a periodic scanning method, exchanging data with each slave station sequentially. It sends data from the transmitting section of its corresponding sub-box to the slave station and reads data from the slave station, placing it into the receiving section of its corresponding sub-box. This cycle repeats continuously, periodically refreshing the "remote I/O buffer" in the master station.
In the master station, the PLC's CPU unit is responsible for scanning the user program. It processes the program in a cyclic scanning manner, with a concentrated period of I/O processing within each cycle. During this time, it reads and writes to local I/O units and remote I/O buffers. The PLC's CPU unit's periodic scanning of the user program and the PLC's communication processor's periodic scanning of each remote I/O unit are asynchronous. Although the PLC's CPU unit does not directly manipulate the remote I/O units, because the remote I/O buffers are periodically refreshed, the CPU unit's read and write operations on the remote I/O buffers are equivalent to direct access to the remote I/O units. This communication method is simple and convenient, but it occupies the PLC's I/O area, therefore it is only suitable for communication of small amounts of data.
2. Global I/O Communication Method
Global I/O communication is a serial shared memory communication method, which is mainly used for communication between PLCs with linked areas.
The communication principle of global I/O is shown in Figure 1. Each PLC in the PLC network allocates a section of its I/O area as a link area, and each link area uses a mailbox structure. Sending and receiving areas with the same number are the same size and occupy the same address range; one is the sending area, and the others are receiving areas. Communication is done via broadcast. PLC1 broadcasts the data from its #1 sending area on the PLC network. PLC2 and PLC3 receive and store the data in their respective #1 receiving areas. PLC2 broadcasts the data from its #2 sending area on the PLC network. PLC1 and PLC3 receive and store the data in their respective #2 receiving areas. PLC3 broadcasts the data from its #3 sending area on the PLC network. PLC1 and PLC2 receive and store the data in their respective #3 receiving areas. Clearly, through this broadcast communication process, the data in the link areas of PLC1, PLC2, and PLC3 is identical; this process is called equivalence. Equivalence communication ensures that the data in the link areas of each PLC in the PLC network remains consistent. It contains both data it sends out and data received from other PLCs. Since each PLC's link area is the same size and occupies the same address range, each PLC accessing its own link area is equivalent to accessing the link areas of other PLCs, which is equivalent to exchanging data with other PLCs. In this way, the link area becomes a true shared storage area, and the shared area becomes the intermediary for data exchange among PLCs.
Link areas can be refreshed asynchronously (equivalence) or synchronously. Asynchronous refresh is independent of the user program in the PLC; the communication processors of each PLC broadcast communication sequentially, repeating the process to keep all link areas equivalent. Synchronous refresh is initiated by a command sent to the link area in the user program; this method only refreshes when the data in the sending area of the link area changes.
In global I/O communication, the PLC directly uses read and write instructions to read and write to the linked area. This is simple, convenient, and fast. However, it should be noted that a write operation to a certain address on one PLC will only allow a read operation to the same address on other PLCs. Similar to periodic I/O, global I/O also occupies the PLC's I/O area, and therefore is only suitable for communication of small amounts of data.
3. Master-slave bus communication mode
The master-slave bus communication mode, also known as the 1:N communication mode, refers to a PLC subnet with N stations in a bus structure, of which only one is the master station and the others are slave stations.
1:N communication uses centralized access control technology to allocate bus usage rights, typically employing a polling table method. A polling table is a list of slave device numbers arranged in order. This table is configured in the master station, which queries the slave devices according to the order in the polling table to see if they want to use the bus, thereby allocating bus usage rights.
For stations with high real-time requirements, the slave device number can be made to appear more frequently in the polling table to grant the station higher communication priority. In some 1:N communication systems, the polling table method is combined with the interrupt method; urgent tasks can interrupt normal periodic polling to gain priority.
In 1:N communication mode, after a slave station gains access to the bus, there are two data transmission methods. One is to allow only master-slave communication and not slave-slave communication. If slave stations want to exchange data, they must go through the master station. The other is to allow both master-slave and slave-slave communication. After a slave station gains access to the bus, it first arranges master-slave communication and then arranges communication between itself and other slave stations.
4. Token bus communication method
Token bus communication is also known as N: N communication means that there are N stations on the PLC subnet of the bus structure. They are all equal and there is no distinction between master and slave stations. In other words, all N stations are master stations.
N:N communication employs token bus access control technology. A logical ring is formed on the physical bus, and a token moves sequentially in a specific direction within the ring. The station that acquires the token gains access to the bus. Token bus access control limits the token holding time for each station, ensuring that each station has a chance to gain bus access after one complete token cycle and providing priority service. Therefore, token bus access control offers good real-time performance.
The station that acquires the token has two data transmission methods: non-acknowledgment data transmission and acknowledgment data transmission. In non-acknowledgment data transmission, the station that acquires the token can immediately send data to the destination station; once the transmission is complete, the communication process is finished. However, in acknowledgment data transmission, the communication is not complete after the station acquires the token and sends the data to the destination station; the entire communication process only ends after the destination station acquires the token and sends an acknowledgment frame to the sending station. The latter has a significantly longer response time and lower real-time performance compared to the former.
5. Floating Master Station Communication Method
The floating master station communication mode, also known as the N:M communication mode, is suitable for PLC networks with a bus structure. It means that there are M stations on the bus, of which N (N < M) are master stations and the rest are slave stations.
The N:M communication method employs a combination of token bus and master-slave bus access control technology. First, N master stations are arranged in a logical ring. Tokens are used sequentially within the logical ring to allocate bus usage rights among the N master stations; this is the meaning of a floating master station. The master station that obtains bus usage rights then determines which stations to communicate with during its token holding period, according to a master-slave configuration. Typically, a polling table is configured in the master station, allowing it to poll other master and slave station numbers listed in the table. The master station that obtains the token can prioritize randomly requested communication tasks from users, allowing them to be executed before or after the polling process.
The master station that obtains the right to use the bus can communicate with the destination station using a variety of data transmission methods, among which the no-response, no-connection method is the fastest.
6. CSMA/CD communication method
CSMA/CD communication is a random communication method suitable for PLC networks with a bus structure. All stations on the bus have equal status and there is no master-slave distinction. It adopts the CSMA/CD access control method, which means "listen first and then speak, listen while speaking".
CSMA/CD access control cannot guarantee that every station on the PLC network will have access to the bus within a certain time period, therefore it is an access control method that cannot guarantee real-time performance. However, it adopts a random approach, is simple, and seizes opportunities whenever the bus is available, resulting in high utilization of communication resources. Therefore, CSMA/CD communication is suitable for upper-level production management subnets in PLC networks.
The CSMA/CD communication method offers various data transmission options, including connectionless, acknowledgment-based, non-acknowledgment-based, and broadcast communication, which can be selected based on the requirements for communication speed and reliability.
The above are the commonly used communication methods in PLC networks. In addition, a small number of PLC networks use other communication methods, such as token ring communication. Furthermore, in newly released PLC networks, multiple communication methods are often integrated and configured on a single subnet, which is also a future trend in technology development.