摘要在工业控制系统中,为了避免通信各方争用通信线路,PC与PLC之间的通信一般采用主从方式,通常采用计算机(PC)作为上位机负责完成数据分析、处理和存储、设备状态显示和打印输出等功能以实现对分布在工业现场的被控制系统进行集中的实时监测与控制;PLC作为下位机使用,承担执行上位机的输出指令、现场数据采集和设备运转状态识别等任务。本文研究了在自由端口模式下PC与S7-200型PLC之间的通信。介绍了实现通信过程的硬件部分,通信端口,通信方式,西门子S7-200CPU226等。并且着重介绍了如何实现数据通信。介绍了S7-200的通信协议,本设计用到的是自由口通信协议。重点阐述了下位机的通信系统设计和实现。并且给出了通信系统的软件实现流程图。62083
毕业论文关键词:上位机PC;下位机;通信;S7-200PLC
Design of small industrial communication system based on PLC
Abstract In the industrial control system, in order to avoid the communication parties compete by communication lines, the communication between PC and PLC by master-slave mode, usually by computer (PC) as PC is responsible for the completion of the data analysis, processing and storage, equipment status display and print output function to realize the centralized real-time monitoring and control of distribution in the field of industrial control systems; using PLC as hypogynous machine. It undertakes PC command output, field data collection and operation of the equipment status recognition task. In this paper, we study the communication between PC and PLC S7-200 in the free port mode. Introduced the realization of the communication process of the hardware part, communication port, communication mode, SIEMENS S7-200CPU226, etc.. And emphatically introduces how to realize the data communication. This paper introduces the communication protocol of S7-200, which is used in the design of free port communication protocol. The design and implementation of the communication system of the lower computer is described. And the flow chart of software realization of communication system is given.
Key words: main-machine; submitted-machine; communication;
目录
第1章 绪论 5
1.1课题背景 5
第2章 硬件部分.5
2. 1上位机与下位机的硬件连接方式5
2.2硬件介绍.6
2.2.1 PC/PPI线介绍 6
2.2.2 RS-232通信接口介绍 8
2.2.3 RS-485通信接口介绍 8
2.2.4 单工,半双工和全双工通信方式介绍 8
2.2.4.1单工.8
2.2.4.2半双工.8
2.2.4.3 全双工 8
2.2.5 西门子CPU226概述9
第3章 数据传输9
3.1 S7-200PLC的通信协议 10
3.1.1 PPI协议.10
3.1.2 MPI协议10
3.1.3自由口通信协议10
3.1.4 PROFIBUS协议11
3.1.5 TCP/IP协议12
3.2比特率介绍12
3.3 波特率和数据位长的设置. 12
3.4 PC与PLC的电缆和电缆连接的切换时间12
3.5 PLC的异步通信和同步通信12
3.5.1 同步通信. 12
3.5.2 异步通信. 13
3.5.3串行异步通信时的数据格式 14
第4章 软件部分13
4.1 STEP 7-Micro/WIN 32设定通讯 13
4.2 指令介绍 .16
4.2.1 XMT和RCV指令 16
4.2.2 ATCH指令和DTCH指令17
4.3端口的初始化与控制字节20
4.3.1校验方式:(差错控制) .21
4.4特殊存储器字节SMB86~SMB94.23
4.4.1数据传输格式25
4.5自由口的通信要点26
4.6 程序设计 26 PLC的工业小型通信系统的设计+程序+梯形图:http://www.youerw.com/zidonghua/lunwen_68158.html