In practical control projects centered around PLCs, we often rely on touch screens or upper computers. This is because we use PLCs for control, primarily to process some analog signals, which are the values we need to monitor, such as pressure, temperature, flow, etc. These detected values are used to control devices like electric valves, fans, and pumps based on certain conditions. However, we cannot see these values directly from the PLC; to view them, we need to use a touch screen or an industrial computer (which is essentially a computer).
First, it should be noted that this article only describes the general working principle and process of touch screens, not a step-by-step guide on how to use them. I believe it is more important to understand the principles and workflows before using and operating a touch screen.
As shown in Figure 1 below, once we connect the touch screen to the PLC, we can see the data we want on the touch screen. In addition to data, we can also control various controlled objects on-site through the touch screen. For example, if we configure a switch on the touch screen, clicking this switch will start a motor on the site.
So what is the principle of communication between the touch screen and the PLC? Look at Figure 2 below, which shows the front and back of a real touch screen. The front is obviously the display side.
Let’s focus on the back, which has three interfaces:
1. Power Interface: This supplies power to the touch screen, with most voltages being DC24V. The parameter label on the touch screen will indicate this.
2. Configuration Download Interface: This is where we use the configuration software provided by the touch screen manufacturer to design the desired screen and functions on a computer and then download them to the touch screen through this interface. Each touch screen manufacturer has its own software, which is not interchangeable, but it doesn’t matter; the principles are the same. As long as you learn one, you can familiarize yourself with the interface of others.
3. Communication Interface: This interface is used for communication with the PLC. The forms of the interface mainly include RS232, RS485, and Ethernet (if you are unclear about what 232 and 485 are, you can check my previous articles that specifically introduce them). It is important to note that the form of this interface must match the form of the PLC’s interface. The touch screen brand in Figure 2 is Kunlun Tongtai, and its interface is RS485, so when connecting to the PLC, the PLC’s interface must also be RS485.
After looking at the exterior of the touch screen, let’s examine its interior. See Figure 3 below, which is a schematic diagram of the internal structure of the touch screen that I created myself. It may not be entirely comprehensive or rigorous, but the important parts are already drawn out, and as long as you can understand it, that’s fine.
The internal structure of the touch screen can be roughly divided into: communication interface unit, driver unit, memory variable unit, and display unit. Except for the display unit, the other three units are not visible inside the touch screen.
1. Communication Interface Unit: This unit is mainly responsible for sending the data packets packed by the driver unit to the communication interface on the back of the touch screen, which then sends them to the PLC. We do not need to intervene in this process; the touch screen will complete it automatically. What we need to do is select a driver from the driver unit, which essentially means telling the touch screen which driver data packet to send.
2. Driver Unit: This unit stores many communication files for connecting with the PLC, with one file corresponding to one communication protocol (if you are not familiar with communication protocols, please refer to my previous articles). We call these files drivers. This means that one driver corresponds to one communication protocol. For example, if the Siemens S7-200 PLC uses the PPI communication protocol, then the touch screen manufacturer will write a communication file that can communicate with the Siemens S7-200 PLC using the PPI protocol and place it in the driver unit.
For instance, when our touch screen wants to connect with the Siemens 200 PLC, we select the PPI driver in the touch screen. If we want to connect with the Siemens 300 PLC, we can select the MPI driver (MPI is the communication protocol for Siemens 300 PLC). These driver files are pre-written by the touch screen manufacturer; we can only select them but cannot modify them. The more drivers there are in the touch screen, the wider the range of PLC brands or communication protocols we can choose from. Currently, mature touch screen manufacturers have built-in drivers that can basically cover commonly used PLCs and communication protocols on the market.
So when we have a touch screen and want to choose a PLC for communication, we must check whether there is a driver in your touch screen that can communicate with this PLC.
3. Memory Variable Unit: This unit is also built-in by the touch screen manufacturer. It is essentially a storage area where various types of data can be stored. The data types can generally be divided into numerical, switch, character, and special types.
For example, if we want to display the water temperature of a boiler on the touch screen, we would create a variable in the memory variable unit of the touch screen, naming it “Boiler Water Temperature” (the name can be arbitrary), and select the data type as numerical. The touch screen will automatically allocate a small area in the memory unit for the variable “Boiler Water Temperature”. When the touch screen communicates with the PLC, it will store the water temperature data read from the PLC in this small area, which is the variable “Boiler Water Temperature”. When we need to display multiple data points, we just need to create multiple variables. You may still find this a bit confusing, but don’t worry; I will explain it clearly in conjunction with Figure 4 below.
4. Display Unit: This unit is easy to understand; anything we can see on the touch screen display is part of the display unit. Taking the “Boiler Water Temperature” as an example, if we want to display the temperature of the boiler’s water, we just need to place a display component (this component is available on every touch screen; you can simply drag it onto the screen) in the display unit and connect this component to the newly created variable “Boiler Water Temperature”.
Now that we have explained each unit, the most difficult to understand are the driver unit and the memory variable unit. You may still not fully comprehend, but I will explain it systematically according to Figure 4 below, and you will understand.
Figure 4 shows the functionality we want to achieve: connecting the touch screen with the Siemens S7-200 PLC. 1. The touch screen can display a pressure value from the PLC. 2. Through a switch component on the touch screen, we can control a binary signal in the PLC.
In the first step, we first select the driver in the touch screen. Since we are connecting with the Siemens S7-200 PLC, we need to select the “Siemens S7-200 PPI Communication Driver” from the driver unit. Once the driver is selected, the touch screen will automatically connect the selected driver with the communication interface unit and the memory variable unit. Now let’s look at the internal structure of this driver (the orange part in Figure 4), which contains many addresses such as V0.0, VB10, VW10, etc. These addresses correspond one-to-one with the addresses in the PLC, and the data and states inside are the same as those in the PLC. For example, if the data in PLC’s VD10 is 123.5, then the data in the touch screen driver’s VD10 will also be 123.5. So now the touch screen has the data, but this data still cannot be displayed because it hasn’t been transferred to the display unit yet. What should we do?
In the second step, we create a variable in the memory variable unit called “Tank Pressure”. We connect this variable to the VD10 in the driver unit, so now the “Tank Pressure” variable contains the data 123.5. However, the data still cannot be displayed because it hasn’t been transferred to the display unit yet.
In the final step, we place a display component with display functionality in the display unit and connect this display component to the “Tank Pressure” variable in the memory variable unit. This way, we can see the data 123.5. It seems quite complex, but essentially we just need to create a new variable to connect these units; everything else is completed automatically by the touch screen.
Once you understand the workflow for displaying numerical values on the touch screen, controlling binary signals becomes simple. You just need to place a switch component in the display unit, create a variable, and connect this variable with the driver unit and the display unit. As for how the touch screen transmits this data to the PLC, you don’t need to worry; the communication interface unit will handle it for you.
Figure 5 shows the overall connection schematic. This is the most basic combination method. Through this PLC + touch screen combination, we achieve true human-machine dialogue. We can clearly see the internal data of the PLC, and by adding a few switch components on the touch screen, we can reduce the actual use of physical switches, thereby minimizing the impact of poor contact of actual switch contacts on the control system and improving the stability of the system.