CN114895881B - Method and system for exchanging interface parameter data of PLC instrument and upper computer - Google Patents

Method and system for exchanging interface parameter data of PLC instrument and upper computer Download PDF

Info

Publication number
CN114895881B
CN114895881B CN202210404943.5A CN202210404943A CN114895881B CN 114895881 B CN114895881 B CN 114895881B CN 202210404943 A CN202210404943 A CN 202210404943A CN 114895881 B CN114895881 B CN 114895881B
Authority
CN
China
Prior art keywords
data
plc
instrument
independent
upper computer
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
CN202210404943.5A
Other languages
Chinese (zh)
Other versions
CN114895881A (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.)
Wuhan Tianyuan Environmental Protection Co ltd
Original Assignee
Wuhan Tianyuan Environmental Protection 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 Wuhan Tianyuan Environmental Protection Co ltd filed Critical Wuhan Tianyuan Environmental Protection Co ltd
Priority to CN202210404943.5A priority Critical patent/CN114895881B/en
Publication of CN114895881A publication Critical patent/CN114895881A/en
Application granted granted Critical
Publication of CN114895881B publication Critical patent/CN114895881B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/31Programming languages or programming paradigms
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/906Clustering; Classification
    • YGENERAL 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
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/02Total factory control, e.g. smart factories, flexible manufacturing systems [FMS] or integrated manufacturing systems [IMS]

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Computing Systems (AREA)
  • Programmable Controllers (AREA)

Abstract

A method and a system for exchanging interface parameter data of a PLC instrument and an upper computer are provided, wherein the method comprises the following steps: step 1, dividing data types contained in a PLC instrument into independent data and public data, wherein the independent data are data of the PLC instrument, namely variable data, which are changed in real time, and the public data are the same data, namely fixed data, of the same type of the PLC instrument; step 2, the upper computer acquires common data of the same type of PLC meters and independent data of each PLC meter; and step 3, writing a pointer addressing program, and writing or reading the independent data based on the pointer addressing program. The method for exchanging the interface parameter data of the PLC instrument and the upper computer provided by the invention can greatly reduce the data exchange quantity of the PLC instrument and the upper computer on the premise of not influencing the functions of the upper computer.

Description

Method and system for exchanging interface parameter data of PLC instrument and upper computer
Technical Field
The invention relates to the field of data processing, in particular to a method and a system for exchanging interface parameter data of a PLC instrument and an upper computer.
Background
The large and medium-sized project features that the number of PLC meters is large, the data exchange amount between the PLC meters and the upper computer is huge, the number of points in the upper computer can often reach tens of thousands, the price of the upper computer software authorized by the legal system is higher as the number of points is more, the number of points in the upper computer is more, the data input workload of the upper computer is huge, and errors are easy to occur.
Disclosure of Invention
In view of the technical defects and technical drawbacks existing in the prior art, the embodiment of the invention provides a method and a system for exchanging interface parameter data between a PLC instrument and an upper computer, which overcome or at least partially solve the above problems, and the specific scheme is as follows:
As a first aspect of the present invention, there is provided a method for exchanging interface parameter data between a PLC instrument and an upper computer, the method comprising:
Step1, dividing data types contained in a PLC instrument into independent data and public data, wherein the independent data are data of the PLC instrument, namely variable data, which are changed in real time, and the public data are the same data, namely fixed data, of the same type of the PLC instrument;
step 2, the upper computer acquires common data of the same type of PLC meters and independent data of each PLC meter;
And step 3, writing a pointer addressing program, and writing or reading the independent data based on the pointer addressing program.
Further, writing the pointer addressing program specifically includes:
And programming a PLC instrument number corresponding to each PLC instrument and a calculated value for determining the starting address of a data area of independent data, and programming an interface parameter area of the upper computer.
Further, based on the pointer addressing procedure, the reading the independent data specifically includes:
and acquiring independent data with corresponding length from the initial address of the corresponding data area according to the PLC instrument number and the calculated value of each PLC instrument, and writing the independent data into the interface parameter area.
Further, writing the independent data based on the pointer addressing program specifically includes:
And acquiring a start address of a corresponding data area according to the PLC instrument number and the calculated value of each PLC instrument, reading independent data with a corresponding length from a corresponding interface parameter area, and writing data with a corresponding length from the start address of the corresponding data area.
Further, the independent data comprise the current value and the alarm state of the PLC instrument, and the common data comprise the range setting data, the alarm setting data and the valve switch control data of the PLC instrument.
Further, the range setting data of the PLC instrument comprise a range upper limit, a range lower limit and a correction amount, the alarm setting data comprise a high alarm value, a low alarm value and a low alarm value, and the valve switch control data comprise a high alarm switch, a low alarm switch and a low alarm switch.
Further, the method further comprises: the upper computer binds the collected data, and binds the public data of the same type of PLC meters and the independent data of each PLC meter in the same type of PLC meters.
Further, the method further comprises: the upper computer carries out visual display to the data of gathering, includes: and displaying the public data of the same type of PLC meters and the independent data of each PLC meter in the same type of PLC meters.
As a second aspect of the present invention, there is provided a system for exchanging interface parameter data between a PLC instrument and an upper computer, the system including a data classification module, a data acquisition module, and an addressing module;
the data classification module is used for classifying the data types contained in the PLC instrument into independent data and public data, wherein the independent data are data of the PLC instrument, namely variable data, which are changed in real time, and the public data are the same data, namely fixed data, of the same type of the PLC instrument;
the data acquisition module is used for acquiring common data of the same type of PLC meters and independent data of each PLC meter by the upper computer;
the addressing module is used for writing a pointer addressing program and writing or reading the independent data based on the pointer addressing program.
Further, the addressing module reads the independent data based on a pointer addressing program specifically includes:
Programming a PLC instrument number corresponding to each PLC instrument and a calculated value for determining a starting address of a data area of independent data, and programming an interface parameter area of an upper computer;
The addressing module reads the independent data based on a pointer addressing program specifically including:
According to the PLC instrument number and the calculated value of each PLC instrument, independent data with corresponding length is obtained from the initial address of the corresponding data area, and the independent data is written into the interface parameter area;
The addressing module writes the independent data based on a pointer addressing program specifically including:
And acquiring a start address of a corresponding data area according to the PLC instrument number and the calculated value of each PLC instrument, reading independent data with a corresponding length from a corresponding interface parameter area, and writing data with a corresponding length from the start address of the corresponding data area.
The invention has the following beneficial effects:
(1) On the premise of not affecting the functions of the upper computer, the data exchange quantity of the PLC instrument and the upper computer is greatly reduced.
(2) The number of data points in the upper computer is greatly reduced, and the cost of purchasing software authorization is reduced.
(3) The workload of the upper computer programmer for recording the data points is greatly reduced, and the error rate is reduced.
Drawings
Fig. 1 is a schematic flow chart of a method for exchanging interface parameter data between a PLC instrument and an upper computer according to an embodiment of the present invention;
FIGS. 2-3 are schematic diagrams of writing functional modules according to embodiments of the present invention;
FIGS. 4,5 and 6 are illustrations of multiple call allocation background data blocks provided by embodiments of the present invention;
Fig. 7 is a schematic diagram of data arrangement of a PLC instrument according to an embodiment of the present invention;
fig. 8 is a schematic parameter diagram of a PLC instrument 1 according to an embodiment of the present invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are only some, but not all embodiments of the invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
As shown in fig. 1, as a first embodiment of the present invention, a method for exchanging interface parameter data between a PLC instrument and an upper computer is provided, where the method includes:
Step1, dividing data types contained in a PLC instrument into independent data and public data, wherein the independent data are data of the PLC instrument, namely variable data, which are changed in real time, and the public data are the same data, namely fixed data, of the same type of the PLC instrument;
step 2, the upper computer acquires common data of the same type of PLC meters and independent data of each PLC meter;
And step 3, writing a pointer addressing program, and writing or reading the independent data based on the pointer addressing program.
Preferably, step 3 specifically includes:
Programming a PLC instrument number corresponding to each PLC instrument and a calculated value for determining a starting address of a data area of independent data, and programming an interface parameter area of an upper computer;
According to the PLC instrument number and the calculated value of each PLC instrument, acquiring independent data with corresponding length from the initial address of a corresponding data area, and writing the independent data into the interface parameter area, wherein the calculated value is calculated by the PLC instrument number, and the calculated value = 46 (PLC instrument number-1);
And acquiring a start address of a corresponding data area according to the PLC instrument number and the calculated value of each PLC instrument, reading independent data with a corresponding length from a corresponding interface parameter area, and writing data with a corresponding length from the start address of the corresponding data area.
The development is applicable to any PLC and any upper computer system, and in order to further explain the principle of the invention, the three-dimensional force control of the PLC Siemens 1500 series and the upper computer is taken as an example for illustration, and specifically comprises the following steps:
And (one) data classification.
Classifying data into unique data and public data by facing to a device object;
The unique data defines that such data is for individual display and for individual function.
The common data defines that the data is only applied to specific situations, such as PLC range setting, alarm setting, valve switch control, pump start-stop operation and the like.
Taking a PLC instrument as an example:
The unique data of the PLC instrument comprises 1, the current value 2, and the alarm state; the common data of the PLC instrument comprises 1 part of measuring range upper limit 2 part of measuring range lower limit 3 part of correction quantity 4 part of high alarm value 5 part of high alarm value 6 part of low alarm value 7 part of low alarm value 8 part of high alarm switch 9 part of high alarm switch 10 part of low alarm switch 11 part of low alarm switch.
(II) standard functional blocks and arrays:
a, writing standard functional blocks, including a value calculation module, an alarm module and the like, as shown in figures 2-3;
b, multiple calling and distributing background data blocks, namely writing a PLC instrument program in a standard function block mode, wherein the multiple calling and distributing background data blocks are used for automatically and uniformly arranging data of all the PLC instruments; as shown in FIG. 7, the array of PLC meters is arranged, and the variable spacing between adjacent PLC meters is 23 bytes.
Writing a pointer addressing program, reading data, and describing the specific program and functions as follows:
functional description when PLC meter number=1, calculated value=0, the action is to transfer 23 bytes of data starting with db1.dbw0 (i.e., db1.dbw0-db1.dbw46) into 23 byte-length memory bits starting with db2.dbw0 (i.e., db2.dbw0-db2.dbw46).
When PLC meter number=3, calculated value=92, the action is to transfer 23 bytes of data starting with db1.dbw92 (i.e., db1.dbw92-db1.dbw138) into 23 byte-length memory bits starting with db2.dbw0 (i.e., db2.dbw0-db2.dbw46).
The above program segments are executed once triggered by the key + rising edge.
(IV) use of interface parameters in the host computer
As is apparent from the above description, the parameters in the pop-up window to be used as the interface parameter area are all interface parameters db2.dbw0 to db2.dbw46 when PLC instrument number=1, the data displayed by the interface parameters (db2.dbw0 to db2.dbw46) are the parameters (db1.dbw0 to db1.dbw46) of the PLC instrument 1, as shown in fig. 8;
writing a pointer addressing program, writing data, and describing the specific program and functions as follows:
The function is the same as (III) write pointer addressing program, read data.
Functional description when PLC meter number=1, calculated value=0, the action is to transfer 23 bytes of data starting with db2.dbw0 (i.e., db2.dbw0-db2.dbw46) into 23 byte-length memory bits starting with db1.dbw0 (i.e., db1.dbw0-db1.dbw46).
When PLC meter number=3, calculated value=92, the action is to transfer 23 bytes of data starting with db2.dbw0 (i.e., db2.dbw0-db2.dbw46) into 23 byte-length memory bits starting with db1.dbw92 (i.e., db1.dbw92-db1.dbw138).
And (six) triggering single execution of the program segments through key+rising edge.
A large sewage treatment plant, a large chemical plant, taking a total of 500 online PLC meters as an example.
The upper computer data entry work:
the conventional method is that each PLC instrument comprises 1,2, 3,4,5, 6, 7, 8, 9, 10, 11, 12, 13, and 6500 points of the upper computer of the 500PLC instrument.
The interface parameter form is used, wherein the unique data of the PLC instrument is required to be input, namely 1, the current value is 2, and the alarm state is achieved; the total of 1000 points, the interface parameters of the PLC instrument, 1, the upper limit of the measuring range, 2, the lower limit of the measuring range, 4, the correction amount, 5, the high alarm value, 6, the low alarm value, 7, the low alarm value, 8, the high alarm switch, 9, 10, 11 and 500, the PLC instrument only needs to record 1011 points.
According to the data recorded every 30 seconds, the staff does not rest at 8 hours a day and the efficiency is not reduced, so that the time is saved by (6500-1011) by 30/8/60/60=5.72 days.
As a second embodiment of the present invention, there is also provided a system for exchanging interface parameter data between a PLC instrument and an upper computer, where the system includes a data classification module, a data acquisition module, and an addressing module;
the data classification module is used for classifying the data types contained in the PLC instrument into independent data and public data, wherein the independent data are data of the PLC instrument, namely variable data, which are changed in real time, and the public data are the same data, namely fixed data, of the same type of the PLC instrument;
the data acquisition module is used for acquiring common data of the same type of PLC meters and independent data of each PLC meter by the upper computer;
the addressing module is used for writing a pointer addressing program and writing or reading the independent data based on the pointer addressing program.
The foregoing description of the preferred embodiments of the invention is not intended to limit the invention to the precise form disclosed, and any such modifications, equivalents, and alternatives falling within the spirit and scope of the invention are intended to be included within the scope of the invention.

Claims (6)

1. The method for exchanging interface parameter data between the PLC instrument and the upper computer is characterized by comprising the following steps:
Step1, dividing data types contained in a PLC instrument into independent data and public data, wherein the independent data are data of the PLC instrument, namely variable data, which are changed in real time, and the public data are the same data, namely fixed data, of the same type of the PLC instrument;
step 2, the upper computer acquires common data of the same type of PLC meters and independent data of each PLC meter;
Step 3, writing a pointer addressing program, and writing or reading the independent data based on the pointer addressing program;
the step3 specifically includes:
programming a PLC instrument number corresponding to each PLC instrument and a calculated value for determining a starting address of a data area of independent data, and programming an interface parameter area of an upper computer; according to the PLC instrument number and the calculated value of each PLC instrument, independent data with corresponding length is obtained from the initial address of the corresponding data area, and the independent data is written into the interface parameter area; and acquiring a start address of a corresponding data area according to the PLC instrument number and the calculated value of each PLC instrument, reading independent data with a corresponding length from a corresponding interface parameter area, and writing data with a corresponding length from the start address of the corresponding data area.
2. The method for exchanging interface parameter data between a PLC instrument and a host computer of claim 1, wherein the independent data comprises a current value and an alarm state of the PLC instrument, and the common data comprises PLC instrument range setting data, alarm setting data and valve switch control data.
3. The method of exchanging interface parameter data between a PLC instrument and an upper computer according to claim 2, wherein the PLC instrument range setting data includes a range upper limit, a range lower limit, and a correction amount, the alarm setting data includes a high alarm value, a low alarm value, and the valve switch control data includes a high alarm switch, a low alarm switch, and a low alarm switch.
4. The method for exchanging interface parameter data between a PLC instrument and a host computer of claim 1, further comprising: the upper computer binds the collected data, and binds the public data of the same type of PLC meters and the independent data of each PLC meter in the same type of PLC meters.
5. The method for exchanging interface parameter data between a PLC instrument and a host computer of claim 1, further comprising: the upper computer carries out visual display to the data of gathering, includes: and displaying the public data of the same type of PLC meters and the independent data of each PLC meter in the same type of PLC meters.
6. The system for exchanging interface parameter data between the PLC instrument and the upper computer is characterized by comprising a data classification module, a data acquisition module and an addressing module;
the data classification module is used for classifying the data types contained in the PLC instrument into independent data and public data, wherein the independent data are data of the PLC instrument, namely variable data, which are changed in real time, and the public data are the same data, namely fixed data, of the same type of the PLC instrument;
the data acquisition module is used for acquiring common data of the same type of PLC meters and independent data of each PLC meter by the upper computer;
The addressing module is used for writing a pointer addressing program and writing or reading the independent data based on the pointer addressing program;
The addressing module is specifically configured to:
programming a PLC instrument number corresponding to each PLC instrument and a calculated value for determining a starting address of a data area of independent data, and programming an interface parameter area of an upper computer; according to the PLC instrument number and the calculated value of each PLC instrument, independent data with corresponding length is obtained from the initial address of the corresponding data area, and the independent data is written into the interface parameter area; and acquiring a start address of a corresponding data area according to the PLC instrument number and the calculated value of each PLC instrument, reading independent data with a corresponding length from a corresponding interface parameter area, and writing data with a corresponding length from the start address of the corresponding data area.
CN202210404943.5A 2022-04-18 2022-04-18 Method and system for exchanging interface parameter data of PLC instrument and upper computer Active CN114895881B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210404943.5A CN114895881B (en) 2022-04-18 2022-04-18 Method and system for exchanging interface parameter data of PLC instrument and upper computer

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210404943.5A CN114895881B (en) 2022-04-18 2022-04-18 Method and system for exchanging interface parameter data of PLC instrument and upper computer

Publications (2)

Publication Number Publication Date
CN114895881A CN114895881A (en) 2022-08-12
CN114895881B true CN114895881B (en) 2024-08-13

Family

ID=82718140

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210404943.5A Active CN114895881B (en) 2022-04-18 2022-04-18 Method and system for exchanging interface parameter data of PLC instrument and upper computer

Country Status (1)

Country Link
CN (1) CN114895881B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101770232A (en) * 2009-08-25 2010-07-07 上海市离心机械研究所有限公司 Data access method of compressed configuration software variable
CN114116551A (en) * 2020-08-28 2022-03-01 美光科技公司 Instructional actions based on classification of input data

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6477178B2 (en) * 2015-04-06 2019-03-06 オムロン株式会社 PLC control data generation device, PLC control data generation method, and PLC control data generation program
JP6659944B2 (en) * 2015-11-18 2020-03-04 アイコム株式会社 Data setting system, data updating system and data setting method

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101770232A (en) * 2009-08-25 2010-07-07 上海市离心机械研究所有限公司 Data access method of compressed configuration software variable
CN114116551A (en) * 2020-08-28 2022-03-01 美光科技公司 Instructional actions based on classification of input data

Also Published As

Publication number Publication date
CN114895881A (en) 2022-08-12

Similar Documents

Publication Publication Date Title
US8122185B2 (en) Systems and methods for measuring the useful life of solid-state storage devices
CN101667205B (en) Method for memorizing real time measure point data for quick review
CN1545660A (en) Method and system for collecting and retrieving time-series, real-time and non-real-time data
US11429497B2 (en) Predicting and handling of slow disk
CN102710454A (en) Automatic test system and automatic test method
CN101110024A (en) Unit test system and method thereof
CN114253871A (en) Method, system and device for storing and managing data of intelligent electric meter
CN114895881B (en) Method and system for exchanging interface parameter data of PLC instrument and upper computer
CN108921496A (en) A kind of attendance data statistical analysis technique and system
CN100550206C (en) A kind of method and device of surveying physical parameters of flash memory
CN101895483A (en) Gateway application system based on embedded real-time data base
CN113723376B (en) Intelligent screen display data acquisition method, device, equipment and storage medium
CN109614392A (en) Interrupt historical data self-repairing method, device, electronic equipment and medium
CN111291022A (en) Data storage system based on block chain
CN114066089A (en) Batch job operation time-consuming interval determining method and device
CN111666177B (en) Meter data storage method for gas-liquid two-phase flowmeter
CN111915340B (en) Method, device, equipment and storage medium for identifying merchant type
CN102222517B (en) Cluster harddisk automation test method and system
CN112511156B (en) Pulse metering and storing method
CN107610738A (en) A kind of efficient out of memory analysis method
CN113723799A (en) Big data ecological chain application system and application method
Teague et al. A new system for management of the “Master Oceanographic Observation Data Set”(MOODS)
CN108804640A (en) Based on packet method, apparatus, storage medium and the equipment for maximizing IV
CN113190553B (en) BPMN-based data reporting system and data reporting method
CN201425713Y (en) Gateway application system based on embedded real-time database

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant