PLC programming to achieve analog keyboard input method - Database & Sql Blog Articles

Programmable Package SG-8018CA(SG7050C) 0.67M~170M
L0504-Murata muRata common mode inductor 90Ω 150mA

In modern automation equipment, touch screen and plc are generally used for joint control to facilitate setting of process parameters, display of system status, display of fault information, etc., but directly operating the touch screen can easily damage the touch screen and shorten its use. Lifespan, so some controls use the operation screen with touch buttons and even use the industrial computer plus configuration software for system parameter setting and display. But the price of the latter is much more expensive than the average touch screen. In view of this, I use the plc programming method and use some buttons for the function operation and digital setting of the touch screen, without directly operating the touch screen, which can reduce the damage of the touch screen.

1. The hardware structure of the control system is illustrated as follows:
I am using the Siemens S7-200PLC for control and external button operation on the TP170 touch screen. Four function keys (F1, F2, F3, F4) are required for switching the touch screen screen; ten numeric keys (0-9), two direction keys and exit key (ESC), delete key (DEL), The Enter key (ENTER) is used to set and modify the parameter numbers. But considering the saving of PLC input points, I use the matrix scanning method, the hardware connection is as follows:

Digital camera

With this scanning method, only 4 output points and 5 input points are needed to generate 4X5=20 button signals, which is more advantageous than using one input point to control one button signal, so that only PLC is needed. Some instructions achieve the ability to acquire 20 signals in a time-sharing manner.

2. The software implementation of the system:
Network1//NetworkTitle
/ / Power on initialization
LDSM0.1
MOVW0, MW10
Network2
/ / Each cycle MW10 plus 1
LDSM0.0
INCWMW10
AW>=MW10,8
MOVW0, MW10
Network3
/ / Output scan changes
LDSM0.0
LPS
AW=MW10,1
=Q0.0
LRD
AW=MW10,3
=Q0.1
LRD
AW=MW10,5
=Q0.2
LPP
AW=MW10,7
=Q0.3
Network4
//q0.0 scan line button has F1\F2\F3\F4\0 five
LDQ0.0
LPS
AI0.0
SM20.0,1
LRD
ANI0.0
RM20.0,1
LRD
AI0.1
SM20.1,1
LRD
ANI0.1
RM20.1,1
LRD
AI0.2
SM20.2, 1
LRD
ANI0.2
RM20.2,1
LRD
AI0.3
SM20.3, 1
LRD
ANI0.3
RM20.3,1
LRD
AI0.4
SM20.4,1
LPP
ANI0.4
RM20.4,1
Network5
//q0.1 scan line buttons have 1, 2, 3, 4, 5
LDQ0.1
LPS
AI0.0
SM20.5, 1
LRD
ANI0.0
RM20.5,1
LRD
AI0.1
SM20.6, 1
LRD
ANI0.1
RM20.6,1
LRD
AI0.2
SM20.7, 1
LRD
ANI0.2
RM20.7,1
LRD
AI0.3
SM21.0, 1
LRD
ANI0.3
RM21.0,1
LRD
AI0.4
SM21.1, 1
LPP
ANI0.4
RM21.1,1
Network6
//q0.2 scan line buttons have 6, 7, 8, 9, ESC five
LDQ0.2
LPS
AI0.0
SM21.2, 1
LRD
ANI0.0
RM21.2,1
LRD
AI0.1
SM21.3, 1
LRD
ANI0.1
RM21.3,1
LRD
AI0.2
SM21.4, 1
LRD
ANI0.2
RM21.4,1
LRD
AI0.3
SM21.5, 1
LRD
ANI0.3
RM21.5,1
LRD
AI0.4
SM21.6, 1
LPP
ANI0.4
RM21.6,1
Network7
//q0.3 scan line button has left, right, DEL, ENTER, spare five
LDQ0.3
LPS
AI0.0
SM21.7, 1
LRD
ANI0.0
RM21.7,1
LRD
AI0.1
SM22.0, 1
LRD
ANI0.1
RM22.0,1
LRD
AI0.2
SM22.1, 1
LRD
ANI0.2
RM22.1,1
LRD
AI0.3
SM22.2, 1
LRD
ANI0.3
RM22.2,1
LRD
AI0.4
SM22.3, 1
LPP
ANI0.4
RM22.3,1
Through the above procedure, the 20 button signals are respectively converted into M200.0-M22.3 20-bit memory signals, that is, the 20-bit memory signals correspond to the external 20 buttons. This program also handles the problem of key repeats.

3. The idea and characteristics of this control method:
With a small number of PLC input/output points and external buttons, the PLC's clever programming method is used to realize the external function operation and parameter data setting of the touch screen, which not only replaces the expensive industrial operation screen or industrial computer, but also protects the touch screen. Extends its service life.

Switching Power Supply

LED power supply, CCTV center power supply device, LCD display power supply.


We can meet your specific requirement of the products, like label design. The plug type is US/UK/AU/EU. The material of this product is PC+ABS. All condition of our product is 100% brand new. OEM and ODM are available in our company, and you deserve the best service. You can send more details of this product, so that we can offer best service to you!


Power Supply,5V Power Supply,12V Power Supply, 24V Power Supply

Shenzhen Waweis Technology Co., Ltd. , https://www.laptopsasdapter.com