CN103399519B - Be applicable to the collecting method of S7 series of PLC - Google Patents

Be applicable to the collecting method of S7 series of PLC Download PDF

Info

Publication number
CN103399519B
CN103399519B CN201310308235.2A CN201310308235A CN103399519B CN 103399519 B CN103399519 B CN 103399519B CN 201310308235 A CN201310308235 A CN 201310308235A CN 103399519 B CN103399519 B CN 103399519B
Authority
CN
China
Prior art keywords
block
threshold value
plc
data
distribution function
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.)
Active
Application number
CN201310308235.2A
Other languages
Chinese (zh)
Other versions
CN103399519A (en
Inventor
赵德方
王仁忠
郑俊
李迪
陈晓璘
彭鹏
徐健华
徐靖
张苏明
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Nonferrous Metals Processing Technology Co Ltd
Original Assignee
Suzhou Nonferrous Metal Research Institute Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Suzhou Nonferrous Metal Research Institute Co Ltd filed Critical Suzhou Nonferrous Metal Research Institute Co Ltd
Priority to CN201310308235.2A priority Critical patent/CN103399519B/en
Publication of CN103399519A publication Critical patent/CN103399519A/en
Application granted granted Critical
Publication of CN103399519B publication Critical patent/CN103399519B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Programmable Controllers (AREA)

Abstract

The present invention relates to the collecting method being applicable to S7 series of PLC, according to the threshold value distribution function adding up tectonic block size and read cycle, according to threshold value distribution function, dynamic division is carried out to collection capacity distribution, reduce the time existing for user configured natural block and Space Coupling degree.For improving the communication efficiency using LIBNODAVE communication interface S7 series of PLC to be carried out to data acquisition.Based on threshold statistical distribution function, realize dynamic data piecemeal, and in conjunction with multithreading; Under equal hardware configuration prerequisite, significantly can improve the picking rate of data, shorten the sampling period, improve data sampling closeness, thus improve LIBNODAVE data acquisition modes can range of application.

Description

Be applicable to the collecting method of S7 series of PLC
Technical field
The present invention relates to the method for a kind of data acquisition of S7 series of PLC in industrial process control system.
Background technology
In the Application and Development of industrial system, system usually obtains from PLC device and provides necessary basic data, and data acquisition module is one of the most important and basic module.Siemens S7 series, as main flow PLC, has market very widely at home.LIBNODAVE can carry out with siemens PLC/300/400 series of PLC the free function library that communicates, be a kind of free and powerful implementation of increasing income, be a kind of feasible, design proposal that low cost, expansibility are strong, occupy an important position in for the type device data acquisition process.
Certain deficiency that LIBNODAVE also exists, it reads data volume (block size) and spent time nonlinear relationship, owing to being be based upon on TCP communications protocol, inner realization encapsulates too much details, especially when the variable natural data block (when being in threshold value critical point as sparse distribution, monoblock) lack of standardization of the communication configuration on PLC, conventional natural block order reading efficiency reduces, and the sampling period of data, hundred milliseconds of ranks, causes the market demand that collects range limited.Under the prerequisite of peer communications data volume, how to optimize block structure, effectively reduction collection period and become the problem that will solve in collecting method.
Summary of the invention
The object of this invention is to provide a kind of optimized data collection algorithm being applicable to S7 series of PLC, the non-linear uncontrollability that the lack of standard eliminated or reduce nature block brings, from in block, interblock two aspects significantly improve acquisition speed, reduce the sampling period, improve data sampling closeness.
Object of the present invention is achieved through the following technical solutions:
Be applicable to the collecting method of S7 series of PLC, according to the threshold value distribution function adding up tectonic block size and read cycle, according to threshold value distribution function, dynamic division is carried out to collection capacity distribution, reduce the time existing for user configured natural block and Space Coupling degree;
First, added up by test data, construct the structure threshold value distribution function existed between the communication block size l of communications protocol bag LIBNODAVE and cycle T, find that it exists trapezoidal profile rule:
T ( l ) = T * ( l / L + 1 ) = 10 + &dtri; t ( 0 < l < L ) 20 + &dtri; t ( L < l < 2 * L ) ( l / L + 1 ) * T + &dtri; t ( ( n - 1 ) * L < l < n * L )
L=450B (bit)
T=10ms (millisecond)
L is data block length
Then, based on concrete collection capacity distribution situation, according to threshold value distribution function dynamic creation piecemeal, gather according to piecemeal in gatherer process, according to threshold value critical point, an excessive natural block comminute is become multiple pieces, adopt multithreading to read optimization block respectively.
Further, the above-mentioned collecting method being applicable to S7 series of PLC, adopts multithreading to create a collecting thread for each acquisition units block.
Further, the above-mentioned collecting method being applicable to S7 series of PLC, each data block creates separately a worker thread, and each thread maintains the link of a PLC, sets up multi-wad join.
The substantive distinguishing features that technical solution of the present invention is outstanding and significant progress are mainly reflected in:
For the threshold value ladder regularity of distribution existed between the communication block size l of communications protocol bag LIBNODAVE and cycle T, adopt the segmentation in conjunction with threshold value distribution function dynamic creation image data block, read in conjunction with multithreading is parallel, eliminate or reduce the time existing for natural block and the spatial order degree of coupling of user's setting, improve the data acquisition efficiency adopting LIBNODAVE to carry out by a relatively large margin, shorten collection period, reduce the gap with hardware interface acquisition means further, make the range of application of acquisition system more wide, or even in the contour frequency acquisition application of error diagnosis in industrial rolling process, to improving, acquisition system efficiency is significant.
Accompanying drawing explanation
Below in conjunction with accompanying drawing, technical solution of the present invention is described further:
Fig. 1: the dynamic division collecting flowchart schematic diagram adopting threshold statistical.
Embodiment
Adopt open communication interface LIBNODAVE, the threshold value distribution function adopting Corpus--based Method to generate, the optimized algorithm adopting deblocking, in conjunction with multithreading, eliminate or reduce the spatio-temporal degree of coupling of nature block, reduce nonlinear uncontrollability; By a relatively large margin improve data acquisition efficiency; For reducing the sampling period, improving data sampling closeness, expand data acquisition further and have important practical significance in the application in the fields such as malfunction elimination diagnosis.
Unit due to data acquisition is data block, according to threshold value distribution function dynamic creation piecemeal, concentrates the data of scattered distribution according to threshold value critical point, improves collecting efficiency in block.According to threshold value critical point, an excessive natural block comminute is become multiple pieces, avoid because the return period that monolithic leap critical point brings significantly increases, multithreading is adopted to read optimization block respectively, eliminate its temporal order coupling, eliminate or reduce and avoid the unreasonable distribution of threshold value critical point place, effectively improve the efficiency that interblock gathers.
For SIEMENS PLC S7-400, as shown in Figure 1, LIBNODAVE Version2 is adopted, collection interface function daveReadManyBytes; Construct the threshold value distribution function existed between the communication block size l of communications protocol interface LIBNODAVE and cycle T;
T ( l ) = T * ( l / L + 1 ) = 10 + &dtri; t ( 0 < l < L ) 20 + &dtri; t ( L < l < 2 * L ) ( l / L + 1 ) * T + &dtri; t ( ( n - 1 ) * L < l < n * L )
L=450B (bit)
T=10ms (millisecond)
L is data block length
This threshold value distribution function is the foundation of dynamic division.
(1) by user configured PLC collection capacity nature block distribution synthesis optimizing, as there is discrete date distribution in one section of DB block;
Block number Block bias internal Data type
DB322 DBD0 Int
DB322 DBD4 Int
DB322 DBD12 Float
DB322 DBD16 Float
DB322 DBD24 Int
DB322 DBD28 Int
DB322 DBD36 Float
DB322 DBD48 Int
DB322 DBD52 Int
DB322 DBD396 Int
According to threshold value distribution function, this natural block owing to being formed at PLC end must be collected, and order reads in a conventional manner else if, and its collection period is more than 60ms, and it is then 10ms that optimum synthesis reads in a data block.
(2) because the unit of data acquisition is data block, if distributed according to natural data block such as DB322, even if these variablees are full Coutinuous store in block, as 800B.
Block number Block bias internal Data type
DB322 DBD0 Int
DB322 DBD4 Int
…….. …….. ……..
DB322 DBD396 Int
DB322 DBD400 Float
DB322 DBD404 Int
…….. …….. ……..
DB322 DBD796 Int
According to the threshold value regularity of distribution, its return period is the shortest is 20ms.If according to threshold value distribution function dynamic creation piecemeal, a natural block comminute is become two blocks, multithreading is adopted to read respectively, eliminate its temporal order coupling, the read cycle of each piece is about below 12ms, within therefore its collection period is controlled in 15ms, gathers in gatherer process according to this piecemeal, eliminate or reduce and avoid the unreasonable distribution of threshold value critical point place, effectively improve the efficiency gathered in block.
Comprehensive above algorithm, adopt the segmentation in conjunction with threshold value distribution function dynamic creation image data block, data nature block is divided or synthesize optimization block, this block distributes and meets the threshold value ladder regularity of distribution existed between the communication block size l of LIBNODAVE and cycle T, read in conjunction with multithreading is parallel, eliminate or reduce the time existing for natural block and the spatial order degree of coupling of user's setting, improve data acquisition efficiency by a relatively large margin, shorten collection period.
Adopt multithreading, for each acquisition units block creates a collecting thread, eliminate or reduce the time coupling between data, thus improving interblock collecting efficiency, more remarkable for the situation improved efficiency that there is multiple stage data source simultaneously in addition.According to the dynamic piecemeal result of threshold function table, improve the data read-write efficiency in block, for improving the acquisition efficiency between data block further, for each data block creates separately a worker thread, degree time correlation brought sequentially is read in elimination, each thread maintains the link of a PLC, ensure the independence between data block, test proves, sets up multi-wad join, for the situation that polylith exists, the reading speed of multithreading is obviously better than the efficiency of single-threaded order block reading.
Below be only embody rule example of the present invention, protection scope of the present invention is not constituted any limitation.The technical scheme that all employing equivalents or equivalence are replaced and formed, all drops within rights protection scope of the present invention.

Claims (3)

1. be applicable to the collecting method of S7 series of PLC, it is characterized in that: come the size of tectonic block and the threshold value distribution function of read cycle according to statistics, according to threshold value distribution function, dynamic division is carried out to collection capacity distribution, reduce the time existing for user configured natural block and Space Coupling degree;
First, added up by test data, construct the threshold value distribution function existed between the communication block size l of communications protocol bag LIBNODAVE and cycle T, find that it exists trapezoidal profile rule:
T ( l ) = T * ( l / L + 1 ) = 10 + &dtri; t ( 0 < l < L ) 20 + &dtri; t ( L < l < 2 * L ) ( l / L + 1 ) * T + &dtri; t ( ( n - 1 ) * L < l < n * L )
L=450B (bit)
T=10ms (millisecond)
&dtri; t = &PlusMinus; 1 ms (millisecond)
L is data block length
Then, based on concrete collection capacity distribution situation, according to threshold value distribution function dynamic creation piecemeal, gather according to piecemeal in gatherer process, according to threshold value critical point, an excessive natural block comminute is become multiple pieces, adopt multithreading to read optimization block respectively.
2. the collecting method being applicable to S7 series of PLC according to claim 1, is characterized in that: adopt multithreading to create a collecting thread for each acquisition units block.
3. the collecting method being applicable to S7 series of PLC according to claim 1, is characterized in that: each data block creates separately a worker thread, and each thread maintains the link of a PLC, sets up multi-wad join.
CN201310308235.2A 2013-07-22 2013-07-22 Be applicable to the collecting method of S7 series of PLC Active CN103399519B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310308235.2A CN103399519B (en) 2013-07-22 2013-07-22 Be applicable to the collecting method of S7 series of PLC

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310308235.2A CN103399519B (en) 2013-07-22 2013-07-22 Be applicable to the collecting method of S7 series of PLC

Publications (2)

Publication Number Publication Date
CN103399519A CN103399519A (en) 2013-11-20
CN103399519B true CN103399519B (en) 2015-08-26

Family

ID=49563162

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310308235.2A Active CN103399519B (en) 2013-07-22 2013-07-22 Be applicable to the collecting method of S7 series of PLC

Country Status (1)

Country Link
CN (1) CN103399519B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113014595B (en) * 2021-03-15 2022-07-01 青岛弯弓信息技术有限公司 Data encapsulation integration method and system

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2228698A1 (en) * 2005-03-14 2010-09-15 Omron Co., Ltd. Programmable controller system
CN102929189A (en) * 2012-10-16 2013-02-13 西安迅腾科技有限责任公司 Household gas using quality real-time data acquisition prompting method

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2228698A1 (en) * 2005-03-14 2010-09-15 Omron Co., Ltd. Programmable controller system
CN102929189A (en) * 2012-10-16 2013-02-13 西安迅腾科技有限责任公司 Household gas using quality real-time data acquisition prompting method

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
油喷雾阀监测装置的开发与设计;吴道虎,李兴华;《电子设计应用》;20030331(第3期);34-37 *
造纸企业自动数据采集系统的设计与实现;龙飞;《中国优秀硕士学位论文全文数据库》;20081231;I138-79 *

Also Published As

Publication number Publication date
CN103399519A (en) 2013-11-20

Similar Documents

Publication Publication Date Title
CN103399519B (en) Be applicable to the collecting method of S7 series of PLC
CN102457250B (en) Collected data filter processing method and device
CN105718748A (en) Online monitoring data processing method
CN103678688A (en) Method for rapidly storing and retrieving messages in whole process of electric power automation communication
CN103902712A (en) Industrial real-time data collecting system
CN103412867B (en) A kind of filtering method of filter based on 3 σ rules
CN102279582B (en) Multi-unit combined controller
CN108632942A (en) A kind of relay cooperation method based on information energy simultaneous transmission
CN116500296B (en) Intelligent enhanced flow measurement method and system for ecological base flow monitoring and application of intelligent enhanced flow measurement method and system
CN104143160A (en) Method for evaluating power grid dispatching capacity on basis of computer implementation
CN104933529A (en) Analysis system and analysis method of influence on single-box energy consumption of cigarettes by discarded tobacco shreds
CN109147962A (en) A kind of geologic prospect remote medical consultation with specialists and supervisory systems based on Internet of Things
CN204579481U (en) A kind of monitoring system of oestrusing based on the change of milk cow activity
CN209401156U (en) The communication system of state&#39;s net ammeter is adapted to based on the NB-IOT communication technology
CN111740753B (en) Network communication signal acquisition system
CN102594405B (en) Power line carrier communication circuit with self-calibration function
CN204679799U (en) A kind of landscape sprinkling systems mobile terminal controller
CN104856695A (en) Blood oxygen data acquisition system based on NFC
CN210166928U (en) Full-function wireless data acquisition unit supporting multiple protocols
CN103279119B (en) Grid frequency setting bielliptic(al) approximating method and application thereof
CN204596116U (en) Power transmission line sag data transmission device
CN204088543U (en) A kind of S-band micro-band inverse filtering power splitter
CN202149801U (en) Curve recorder
CN204595902U (en) Based on the transacter of all-purpose card
CN205920511U (en) Radio frequency identification attendance management equipment

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
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20171011

Address after: 471000 Henan Province, Luoyang city high tech Development Zone middle Ling Road

Patentee after: China Nonferrous Metals Processing Technology Co., Ltd.

Address before: Suzhou City, Jiangsu Province, Shen Hu Road Park 215021 No. 200

Patentee before: Suzhou Non-ferrous Metal academy Co., Ltd.