迪文科技论坛

 找回密码
 立即注册
搜索
查看: 39351|回复: 0

【Share】PLC routine: DWIN panel and Xinje PLC hardware and software connec...

[复制链接]

542

主题

159

回帖

1万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
10515
发表于 2021-6-4 14:20:32 | 显示全部楼层 |阅读模式
This paper introduces the connection of software and hardware between DGUS Ⅱ touch panel and Xinje PLC through Modbus RTU protocol.
1. Effect display: demo video
DWIN product model: DMT10600T070_A5WTC
XC1-32 PLC: XC1-32 PLC
Resolution: 1024*600

The DGUS Ⅱ touch panel with the model of DMT10600T070_A5WTC was selected in the video. The product is a 7-inch high-resolution, industrial-grade intelligent HMI with rich interfaces, waterproof and UV proof, and can be used both indoors and outdoors. Outdoor use of anti-glare, high and low temperature shell deformation. The panel is capacitive touch panel, which can realize the functions of sliding page turning, gesture adjusting data, etc., with good touch effect and high sensitivity, bringing wonderful human-computer interaction experience.
The PLC model is XC1-32 PLC. This product has multiple communication ports and strong communication networking ability. Basic unit with 1-3 communication ports, support RS232, RS485, can connect a variety of external equipment, such as frequency converter, instrument, etc. Because it is equipped with multiple communication ports and supports a variety of communication protocols, such as Modbus protocol, free communication protocol, etc., different communication networks can be established. In Modbus network, PLC can act as master or slave; The Ethernet network can be formed through T-box module; You can also access the GPRS network through the G-Box.
2.Connect guide detailed explain
2.1 Hardware connection guide
As shown in the following figure, the touch panel communication interface uses RS485 of COM4, namely, pins A and B, and the power supply is 24VDC, namely, pins V and G.
2.1.1 Interface definition
(1)DMT10600T070-A5WTC interface definition
① This place can be opened for the SD card slot position. When the project is completed with 7.381 software configuration, the generated DWIN_SET folder is placed on the SD card (small TF card) and downloaded to the panel through the slot.
MODBUS basic configuration file:
Kernel file: DWINOS_T5_Modbus_V5
22 configuration file: 22_ModbusMaster (used when the panel is the host) ,22_ModbusSlave (used when the panel is the slave), can only put one.
Hardware parameter configuration file: T5UID3.CFG (Configuration for initial values, same as DGUS 1_Config)
② This is the communication interface, It is divided into serial port 2 and serial port 4. When connecting PLC, serial port 4 can be used.
Serial port selection: Serial port 2 is RS232, which is well defined by DWIN, which means that only 5A A5 frame header protocol can be used. If other protocols are used, other protocols need to be parsed into 5A A5 frame header panel to recognize instructions. Serial port 4 is a custom RS485 serial port, connected to PLC with serial port 4 can be.
Wiring: AB interface of the panel is connected to PLC AB interface, VCC power supply, GND ground wire can be connected, panel power supply 7-36V DC recommended 12V.
③ The extension of the serial port 3, need to write OS program customization.
④ It is the extension of serial port 5, serial port 6, serial port 7, serial port 8, also need to write OS program customization.
(2) PLC interface definition
The PLC communication interface of XJ uses the A/B two-point communication port on the terminal row (8) as shown in the figure below. A/B is connected with the touch panel A-A and B-B respectively, and the power supply is 220VAC.
When external input is read, point 0 input of X0 is used, as shown in the figure below:
2.1.2 Hardware wiring effect drawing
2.2 Software Configuration Guide2.2.1 XC1-32 PLC programming software configuration
(1) Create a new project and save it. File -- Create a new project, select PLC model XC1-32 and confirm.
(2) The project interface is as follows. Double-click the PLC hardware configuration to select the communication setting port:
(3) Click PLC serial port in PLC configuration, as shown in the figure below:
Select serial port 2, and the parameter configuration is shown in the figure above. After the parameter configuration is completed, click "Write to PLC". After successfully writing, please repower the PLC.
2.2.1.1 Modbus communication protocol
(1) The corresponding address of the communication protocol is shown in the following figure. We only use X,Y and D areas here, and refer to the above three addresses for other areas.
(2) The communication address function code is read only in X area, read read in Y area and read read in D area. The function codes used are 02H,01H,05H,03H and 06H respectively.
(3) Xinje XC1-32PLC Modbus communication data structure is as follows. For details, please refer to Chapter 7 of the manual "PLC Manual".

2.2.1.2 Write PLC verification program
We used X,Y and D above, and the function code was 01/02/03/06/15(0F). The reading and writing of the external output coil (Y0) and the reading and writing of the external input coil (X0) did not need PLC programming. The demonstration video was shown in the first section.
2.2.1.3 Real-time reading and writing of variables
This program reads two variables in total. When variable 1 is on the touch panel, the attribute is "read and write" and the PLC address is D100. When variable 1=100, Y1 will be lit up and other values Y1 will be off. Every 1S increase 1,PLC program is as follows:
2.2.2 Software configuration of touch panel
(1) Touch panel engineering documents
See the compressed file "Xinje PLC Project" - DGUS_II touch panel program - Xinkie PLC ".
(2)Touch panel OS program:
a. The main functions of touch panel OS program are reading and writing "output coil Y0", reading "output coil state (X0)", and reading and writing "D100/D101 keep register" state.
b. OS program link: see the compressed file "Xinje PLC Project" - DGUS_II touch panel program - Xinje PLC\OS_Xinje\OS_Xinje. ASM.

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

x
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|小黑屋|迪文科技论坛 ( 京ICP备05033781号-1 )

GMT+8, 2024-4-27 04:17 , Processed in 0.072462 second(s), 22 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表