CN103853121B - A kind of controlled data stream multi-point data acquisition apparatus and method based on PLC - Google Patents
A kind of controlled data stream multi-point data acquisition apparatus and method based on PLC Download PDFInfo
- Publication number
- CN103853121B CN103853121B CN201210512299.XA CN201210512299A CN103853121B CN 103853121 B CN103853121 B CN 103853121B CN 201210512299 A CN201210512299 A CN 201210512299A CN 103853121 B CN103853121 B CN 103853121B
- Authority
- CN
- China
- Prior art keywords
- plc
- data
- industrial computer
- target
- communication
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Expired - Fee Related
Links
- 238000000034 method Methods 0.000 title claims abstract description 26
- 238000004891 communication Methods 0.000 claims abstract description 30
- 238000013480 data collection Methods 0.000 abstract description 7
- 230000004899 motility Effects 0.000 abstract 1
- 239000003054 catalyst Substances 0.000 description 2
- 230000006870 function Effects 0.000 description 2
- 230000001105 regulatory effect Effects 0.000 description 2
- 230000005540 biological transmission Effects 0.000 description 1
- 230000000903 blocking effect Effects 0.000 description 1
- 230000007812 deficiency Effects 0.000 description 1
- 238000003745 diagnosis Methods 0.000 description 1
- 238000010586 diagram Methods 0.000 description 1
- 239000000428 dust Substances 0.000 description 1
- 230000007774 longterm Effects 0.000 description 1
- 230000000630 rising effect Effects 0.000 description 1
- 230000035939 shock Effects 0.000 description 1
- 239000007787 solid Substances 0.000 description 1
Classifications
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02P—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
- Y02P90/00—Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
- Y02P90/02—Total factory control, e.g. smart factories, flexible manufacturing systems [FMS] or integrated manufacturing systems [IMS]
Landscapes
- Programmable Controllers (AREA)
Abstract
Description
技术领域technical field
本发明公开一种可用于工业场合多点采集数据的且要求数据流可控的数据采集方法和装置。The invention discloses a data collection method and device which can be used for multi-point data collection in industrial occasions and requires controllable data flow.
背景技术Background technique
PLC是工业领域数据采集常用到的设备,PLC具有可编程、稳定性好等特点。基于PLC的数据采集装置或者方法也屡见不鲜。但是这些方法或装置往往是数据流向固定,如流向控制室的主控上位机,在没有上位机的情况下,往往流向某台重要性高的PLC,再由这台上位机或者PLC统一处理数据。这种传统的方式数据流向不可控,缺乏灵活性,不能适应新的工业场合数据采集日益复杂的需求。PLC is a commonly used device for data acquisition in the industrial field. PLC has the characteristics of programmable and good stability. PLC-based data acquisition devices or methods are also common. However, these methods or devices often have a fixed data flow direction, such as the main control host computer in the control room. In the absence of the host computer, it often flows to a high-importance PLC, and then the host computer or PLC processes data in a unified manner. . This traditional way of data flow is uncontrollable, lacks flexibility, and cannot adapt to the increasingly complex needs of data collection in new industrial occasions.
发明内容Contents of the invention
针对现有技术中存在的上述不足之处,本发明要解决的技术问题是提供一种基于PLC的数据流向可控的可控数据流多点数据采集装置和方法。In view of the above-mentioned deficiencies in the prior art, the technical problem to be solved by the present invention is to provide a controllable data flow multi-point data acquisition device and method based on PLC with controllable data flow direction.
本发明为实现上述目的所采用的技术方案是:一种基于PLC的可控数据流多点数据采集装置,包括The technical solution adopted by the present invention to achieve the above object is: a PLC-based controllable data flow multi-point data acquisition device, including
一台工控机,通过交换机连接至少一台PLC,为每一台PLC编号,且编号唯一,作为区分不同PLC的标志;为每一台PLC开辟线程池,用于处理不同的PLC的数据通讯;控制工控机和PLC之间的数据流向;An industrial computer, connected to at least one PLC through a switch, number each PLC, and the number is unique, as a sign to distinguish different PLCs; open up a thread pool for each PLC to handle data communication between different PLCs; Control the data flow between industrial computer and PLC;
至少一台PLC,每台PLC都识别自己的编号和其他PLC的编号,在通讯时编号在PLC内部被解析为IP地址;每台PLC开通两个不同的端口,一个作为数据发送端口,一个作为数据接收端口。At least one PLC, each PLC recognizes its own number and the numbers of other PLCs, and the number is resolved into an IP address inside the PLC during communication; each PLC opens two different ports, one as a data sending port and one as an IP address. Data receiving port.
所述PLC之间没有主从的分别。There is no master-slave distinction between the PLCs.
所述工控机显示每一台PLC的通讯状态和是否出现故障以及故障类型。The industrial computer displays the communication status of each PLC and whether there is a fault and the type of fault.
所述工控机实时显示所有PLC的数据值。The industrial computer displays all PLC data values in real time.
一种基于PLC的可控数据流多点数据采集方法,包括以下步骤:A PLC-based controllable data flow multi-point data acquisition method, comprising the following steps:
在工控机内输入需要读取数据的数据来源PLC编号、数据起始区地址、偏移量和目标PLC编号;Enter the data source PLC number, data start area address, offset and target PLC number in the industrial computer;
工控机根据输入的信息向数据源PLC和目标PLC发送通讯命令;The industrial computer sends communication commands to the data source PLC and the target PLC according to the input information;
目标PLC通过tcp/ip协议的read方法读取数据源PLC的数据起始区至偏移量内的数据。The target PLC reads the data from the data start area to the offset of the data source PLC through the read method of the tcp/ip protocol.
所述工控机根据输入的信息向数据源PLC和目标PLC发送通讯命令,具体为:The industrial computer sends communication commands to the data source PLC and the target PLC according to the input information, specifically:
工控机将需要读取数据的PLC编号与该PLC的IP地址对应;The industrial computer corresponds the PLC number that needs to read data with the IP address of the PLC;
工控机通过以太网通讯的方法将目标PLC的编号传送给数据源PLC。The industrial computer transmits the serial number of the target PLC to the data source PLC through the method of Ethernet communication.
所述目标PLC通过tcp/ip协议的read方法读取数据源PLC的数据起始区至偏移量内的数据,具体为:The target PLC reads the data from the data start area of the data source PLC to the offset by the read method of the tcp/ip protocol, specifically:
数据源PLC通过解析以太网通讯方法数据包含义的方法获得欲读取数据起始地址区和偏移量;The data source PLC obtains the starting address area and offset of the data to be read by analyzing the data content of the Ethernet communication method;
工控机指定数据起始地址区至偏移量内的数据从数据源PLC流向目标PLC;The data within the specified data start address area to the offset of the industrial computer flows from the data source PLC to the target PLC;
工控机和目标PLC尝试建立连接;如果连接成功,则工控机向目标PLC发送数据流控制命令,如果连接不成功则重新尝试连接;The industrial computer and the target PLC try to establish a connection; if the connection is successful, the industrial computer sends a data flow control command to the target PLC, and if the connection is unsuccessful, retry the connection;
目标PLC通过tcp/ip协议的read方法读取数据源PLC的数据起始区至偏移量内的数据。The target PLC reads the data from the data start area to the offset of the data source PLC through the read method of the tcp/ip protocol.
本发明具有以下优点:The present invention has the following advantages:
1.数据流向可控,具有较高的灵活性,可满足数据采集点分布规律性较差的场合;1. The data flow is controllable and has high flexibility, which can meet the occasions where the distribution of data collection points is poor;
2.工控机可显示所有终端设备的实时数据,方便观测者随时掌握各点数据采集情况和数据值;2. The industrial computer can display the real-time data of all terminal equipment, which is convenient for the observer to grasp the data collection situation and data value of each point at any time;
3.可采集以太网类型数据、串口类型数据等,可连接各种类型的传感器,能够满足大多数数据采集要求。3. It can collect Ethernet type data, serial port type data, etc., can connect various types of sensors, and can meet most data collection requirements.
附图说明Description of drawings
图1是本发明装置电路原理图;Fig. 1 is a schematic diagram of the device circuit of the present invention;
图2是数据流控制方法。Figure 2 is a data flow control method.
具体实施方式detailed description
下面结合附图及实施例对本发明做进一步的详细说明。The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments.
如图1-2所示,本发明一种基于PLC的可控数据流多点数据采集装置,包括:一台工控机和若干台PLC,PLC挂接数字量输入模块、模拟量输入模块、计数器模块、脉冲发生器模块、RS232模块、RS485模块。为每一台PLC编号,且编号唯一,在工控机内为每一台PLC开辟线程池用于处理不同的PLC的数据通讯,将这些编号记录在工控机内作为区分不同PLC的标志。每台PLC都识别自己的编号和其他PLC的编号,在通讯时编号在PLC内部被解析为IP地址。每台PLC开通两个不同的端口,一个作为数据发送端口,一个作为数据接收端口。每台PLC地位相同,没有主从的分别,以便不同PLC之间的数据互传。工控机作为通讯的状态显示和控制设备,可以显示每一台PLC的通讯状态和是否出现故障以及故障类型等,还可以通过工控机控制数据流向,如A点的PLC需要读取B点数据时,就可以通过工控机进行控制,使A点数据传向B点,工控机还可以实时显示所有点的数据值。As shown in Figure 1-2, a PLC-based controllable data flow multi-point data acquisition device of the present invention includes: an industrial computer and several PLCs, and the PLC is connected to a digital input module, an analog input module, and a counter module, pulse generator module, RS232 module, RS485 module. Number each PLC, and the number is unique, open up a thread pool for each PLC in the industrial computer to handle the data communication of different PLCs, and record these numbers in the industrial computer as a sign to distinguish different PLCs. Each PLC recognizes its own number and the numbers of other PLCs, and the number is resolved into an IP address inside the PLC during communication. Each PLC opens two different ports, one as a data sending port and one as a data receiving port. Each PLC has the same status, there is no master-slave distinction, so that data can be exchanged between different PLCs. As a communication status display and control device, the industrial computer can display the communication status of each PLC, whether there is a fault and the type of fault, etc., and can also control the data flow through the industrial computer. For example, when the PLC at point A needs to read the data at point B , it can be controlled by the industrial computer, so that the data of point A is transmitted to point B, and the industrial computer can also display the data values of all points in real time.
直流稳压电源选用上海稳华电源设备有限公司的WYJ600直流稳压电源。The DC regulated power supply is WYJ600 DC regulated power supply from Shanghai Wenhua Power Equipment Co., Ltd.
工控机选用西门子SIMATIC IPC847C工控机,SIMATIC IPC847C是一款坚固和极具扩展性的工业PC,采用19英寸的设计(4HM)。它具有突出的长期可用性,因此可以提供高投资保护,尤其是可以确保在恶劣的工业环境(例如具有高粉尘浓度、高温和高撞击荷载的环境)中的可靠操作。The industrial computer chooses Siemens SIMATIC IPC847C industrial computer. SIMATIC IPC847C is a solid and extremely expandable industrial PC with a 19-inch design (4HM). Its outstanding long-term availability and thus high investment protection ensure reliable operation in harsh industrial environments, for example with high dust concentrations, high temperatures and high shock loads.
网线采用普通双头RJ45网线,网线长度小于100米。The network cable adopts ordinary double-headed RJ45 network cable, and the length of the network cable is less than 100 meters.
网络交换机选用思科Express500交换机,Cisco Catalyst Express500交换机提供双层网络管理,可管理快速以太网和千兆以太网,提供无阻塞的线速性能以及一个专为数据、无线和IP通信而优化的安全网络平台。Cisco Catalyst Express500还提供了多个以太网供电(PoE)选项,来帮助降低IP通信的成本和复杂度,并支持以太网的新用途。Cisco Express500 switches are selected as network switches. Cisco Catalyst Express500 switches provide double-layer network management, can manage Fast Ethernet and Gigabit Ethernet, provide non-blocking wire-speed performance and a secure network optimized for data, wireless and IP communications platform. The Cisco Catalyst Express500 also offers multiple Power over Ethernet (PoE) options to help reduce the cost and complexity of IP communications and support new uses of Ethernet.
PLC选用WAGO现场总线控制器,该现场总线控制器适合10/100Mbits/s的数据传输速率,符合IEC61131-3编程标准。该控制器提供512KB程序内存、256KB数据内存和24KB保持内存。32位CPU具有多任务处理功能及后备电池实时时钟。该控制器提供多种不同的应用协议,用于数据采集及控制(MODBUS,ETHERNET/IP)或用于系统管理及诊断(HTTP, BootP, DHCP,DNS,SNTP,FTP,SNMP及SMTP)。PLC现场总线控制器需要挂接数据功能模块,包括模拟量输入模块、数字量输入模块、RS232通讯模块、RS485模块。PLC selects WAGO field bus controller, which is suitable for data transmission rate of 10/100Mbits/s and complies with IEC61131-3 programming standard. The controller provides 512KB of program memory, 256KB of data memory, and 24KB of hold memory. 32-bit CPU with multi-tasking function and battery-backed real-time clock. The controller provides a variety of different application protocols for data acquisition and control (MODBUS, ETHERNET/IP) or for system management and diagnosis (HTTP, BootP, DHCP, DNS, SNTP, FTP, SNMP and SMTP). The PLC field bus controller needs to be connected with data function modules, including analog input modules, digital input modules, RS232 communication modules, and RS485 modules.
具体连接如下:The specific connection is as follows:
西门子工控机IPC847C和思科Express500交换机通过双头RJ45网线链接,交换机通过网线和远端的PLC相连,PLC控制器包括控制器750-881,模拟量输入模块750-476,数字量输入模块750-400,计数器模块750-638,脉冲发生器模块750-635,RS232通讯模块750-650,RS485通讯模块750-653,终端模块750-600,上述各模块一次连接。这些模块分别连接各类传感器,采集所需数据。数字量输入模块750-400可检测24VDC的上升沿电压,将其和温度报警器连接,温度报警器当温度达到预设温度时发出报警;模拟量输入模块750-476可采集模拟量输入信号,连接压力计,压力计将压力数值转换成0~10VDC电压输出;计数器模块750-638连接计数器,脉冲发生器模块750-635连接脉冲发生器,RS232通讯模块750-650连接RS232类型的串行通讯设备,RS485通讯模块750-653连接RS485类型的通讯设备。The Siemens industrial computer IPC847C and the Cisco Express500 switch are connected through a double-headed RJ45 network cable, and the switch is connected to a remote PLC through a network cable. The PLC controller includes a controller 750-881, an analog input module 750-476, and a digital input module 750-400 , Counter module 750-638, pulse generator module 750-635, RS232 communication module 750-650, RS485 communication module 750-653, terminal module 750-600, the above modules are connected at one time. These modules are connected to various sensors to collect the required data. The digital input module 750-400 can detect the rising edge voltage of 24VDC, connect it to the temperature alarm, and the temperature alarm will send out an alarm when the temperature reaches the preset temperature; the analog input module 750-476 can collect the analog input signal, Connect the pressure gauge, the pressure gauge converts the pressure value into 0~10VDC voltage output; the counter module 750-638 is connected to the counter, the pulse generator module 750-635 is connected to the pulse generator, and the RS232 communication module 750-650 is connected to the RS232 type serial communication Equipment, RS485 communication module 750-653 is connected to RS485 communication equipment.
控制数据流是通过工控机和PLC共同实现的。首先在工控机内输入需要读取数据的PLC编号、数据起始区地址、偏移量、目标PLC编号。输入这写信息后,工控机根据输入的信息向数据源PLC和目标PLC发送通讯命令,目标PLC通过tcp/ip协议的read方法读取据起始区至偏移量内的数据,完成数据流控制。数据流控制还可以通过定时器周期性的控制某台PLC的数据定期的传向另一台PLC。The control data flow is realized jointly by industrial computer and PLC. First, enter the PLC number, data start area address, offset, and target PLC number in the industrial computer. After inputting the write information, the industrial computer sends communication commands to the data source PLC and the target PLC according to the input information, and the target PLC reads the data from the starting area to the offset through the read method of the tcp/ip protocol to complete the data flow control. Data flow control can also periodically control the data of a certain PLC to be transmitted to another PLC periodically through the timer.
本发明的数据流控制方法:在工控机内将PLC编号与IP地址对应;指定数据源PLC编号;指定数据源PLC欲读取数据的起始地址和偏移量;指定数据流向目标PLC;工控机和目标PLC尝试建立连接;如果连接成功,则工控机向目标PLC发送数据流控制命令,如果连接不成功则重新尝试连接;目标PLC通过tcp/ip协议的read方法读取数据;重新等待数据流控制命令。The data flow control method of the present invention: correspond the PLC number to the IP address in the industrial computer; specify the data source PLC number; specify the starting address and offset of the data that the data source PLC wants to read; specify the data flow to the target PLC; industrial control The computer and the target PLC try to establish a connection; if the connection is successful, the industrial computer sends a data flow control command to the target PLC, and if the connection is unsuccessful, retry the connection; the target PLC reads the data through the read method of the tcp/ip protocol; waits for the data again flow control commands.
Claims (7)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201210512299.XA CN103853121B (en) | 2012-11-30 | 2012-11-30 | A kind of controlled data stream multi-point data acquisition apparatus and method based on PLC |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201210512299.XA CN103853121B (en) | 2012-11-30 | 2012-11-30 | A kind of controlled data stream multi-point data acquisition apparatus and method based on PLC |
Publications (2)
Publication Number | Publication Date |
---|---|
CN103853121A CN103853121A (en) | 2014-06-11 |
CN103853121B true CN103853121B (en) | 2016-08-17 |
Family
ID=50860914
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201210512299.XA Expired - Fee Related CN103853121B (en) | 2012-11-30 | 2012-11-30 | A kind of controlled data stream multi-point data acquisition apparatus and method based on PLC |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN103853121B (en) |
Families Citing this family (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20180062967A1 (en) * | 2016-08-24 | 2018-03-01 | Epro Gmbh | Apparatus and Method for Providing Power to Machine Measurement Devices via Data Communication Network |
CN110161950A (en) * | 2019-05-22 | 2019-08-23 | 北京信息科技大学 | A kind of highly reliable high-performance data acquisition system and method based on PLC |
CN113612838A (en) * | 2021-07-30 | 2021-11-05 | 三一汽车制造有限公司 | Mixing station control method and device, mixing station, electronic device and medium |
CN114397852A (en) * | 2022-01-18 | 2022-04-26 | 中天钢铁集团(南通)有限公司 | Method for detecting downtime of PLC host |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101414171A (en) * | 2007-10-19 | 2009-04-22 | 烟台杰瑞石油装备技术有限公司 | Oil field fracturing pumping remote automatic control system |
CN101452639A (en) * | 2007-11-30 | 2009-06-10 | 中国科学院沈阳自动化研究所 | Method and system for collecting and transmitting Ethernet data |
CN202331135U (en) * | 2011-01-05 | 2012-07-11 | 深圳市赛远自动化系统有限公司 | System for monitoring long-distance industrial network based on S-Link and VLAN (Virtual Local Area Network) technology |
CN202482049U (en) * | 2012-03-08 | 2012-10-10 | 罗时金 | Quantitative oil delivery system |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
AU2011214953B2 (en) * | 2010-02-15 | 2014-11-27 | Exeloo Limited | Remote monitoring and control system |
KR101214280B1 (en) * | 2010-12-27 | 2012-12-24 | 주식회사 포스코아이씨티 | Automatic System Comprising Apparatus for Communication Interlock |
-
2012
- 2012-11-30 CN CN201210512299.XA patent/CN103853121B/en not_active Expired - Fee Related
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101414171A (en) * | 2007-10-19 | 2009-04-22 | 烟台杰瑞石油装备技术有限公司 | Oil field fracturing pumping remote automatic control system |
CN101452639A (en) * | 2007-11-30 | 2009-06-10 | 中国科学院沈阳自动化研究所 | Method and system for collecting and transmitting Ethernet data |
CN202331135U (en) * | 2011-01-05 | 2012-07-11 | 深圳市赛远自动化系统有限公司 | System for monitoring long-distance industrial network based on S-Link and VLAN (Virtual Local Area Network) technology |
CN202482049U (en) * | 2012-03-08 | 2012-10-10 | 罗时金 | Quantitative oil delivery system |
Also Published As
Publication number | Publication date |
---|---|
CN103853121A (en) | 2014-06-11 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN103853121B (en) | A kind of controlled data stream multi-point data acquisition apparatus and method based on PLC | |
CN103439951A (en) | Information intelligent terminal system of EtherCAT field bus | |
CN109507917A (en) | Remote monitoring system | |
CN206991088U (en) | Remote I/O module and the control system using the remote I/O module | |
CN109637108A (en) | A kind of Lathe networking information acquisition system and method based on touch screen | |
CN110748332B (en) | Drilling parameter instrument based on PLC | |
CN207020660U (en) | A kind of system communication module | |
CN204360158U (en) | A kind of intelligent PDU system | |
CN202939476U (en) | PLC-based multi-point data acquisition device with controllable data flow direction | |
CN103713556A (en) | Intelligent information interaction terminal and communication method thereof | |
CN204679826U (en) | A kind of Field Monitoring System utilizing Ethernet to build hydropress information base | |
CN204089850U (en) | A kind of network-type PLC with multi-fieldbus | |
CN204155117U (en) | A kind of big-power transducer control system | |
CN107592286A (en) | A kind of intelligent communications terminal and its implementation for supporting multi-protocols | |
CN207490989U (en) | A kind of distributed data acquisition system for multirobot | |
CN204287957U (en) | A kind of scrap prodn. line PROFIBUS PA slave station diagnostic system | |
CN208903418U (en) | A kind of data penetration transmission device and data acquisition device | |
CN211081828U (en) | Drilling parameter instrument based on P L C | |
CN108055294A (en) | A kind of sensing heating complete set of equipments remotely intelligently monitoring and diagnostic system | |
CN202093347U (en) | Interface module for EtherCAT bus numerical control system | |
CN203705940U (en) | Environment monitoring apparatus with packaging box | |
CN203338621U (en) | A teaching experiment device for simulating industrial communication | |
CN202472384U (en) | Environmental data acquisition instrument based on small RTOS (Real Time Operating System) | |
CN114268642A (en) | Multi-protocol wireless data collection device | |
CN112578709A (en) | Multifunctional data acquisition and exchange system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant | ||
CF01 | Termination of patent right due to non-payment of annual fee | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20160817 Termination date: 20191130 |