CN111460025A - L-based variable-adjustable data acquisition method and system - Google Patents

L-based variable-adjustable data acquisition method and system Download PDF

Info

Publication number
CN111460025A
CN111460025A CN202010056789.8A CN202010056789A CN111460025A CN 111460025 A CN111460025 A CN 111460025A CN 202010056789 A CN202010056789 A CN 202010056789A CN 111460025 A CN111460025 A CN 111460025A
Authority
CN
China
Prior art keywords
data
queue
variable
module
array
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.)
Pending
Application number
CN202010056789.8A
Other languages
Chinese (zh)
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.)
Huazhong University of Science and Technology
Original Assignee
Huazhong University of Science and Technology
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 Huazhong University of Science and Technology filed Critical Huazhong University of Science and Technology
Priority to CN202010056789.8A priority Critical patent/CN111460025A/en
Publication of CN111460025A publication Critical patent/CN111460025A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/26Visual data mining; Browsing structured data
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01DMEASURING NOT SPECIALLY ADAPTED FOR A SPECIFIC VARIABLE; ARRANGEMENTS FOR MEASURING TWO OR MORE VARIABLES NOT COVERED IN A SINGLE OTHER SUBCLASS; TARIFF METERING APPARATUS; MEASURING OR TESTING NOT OTHERWISE PROVIDED FOR
    • G01D21/00Measuring or testing not otherwise provided for
    • G01D21/02Measuring two or more variables by means not covered by a single other subclass
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures

Abstract

The invention discloses a variable adjustable data acquisition method and system based on L abview, belonging to the field of data acquisition.A mode of combining an event structure with three layers of queues is adopted for controlling multivariable and acquisition variables needing to be adjusted at any time, wherein, a first level queue is used for receiving data uploaded by a lower computer, each frame of data is packed into an array, a second level queue is used for receiving the array of the first level queue, array elements are accessed in an array index mode, each element is classified through a condition structure, and a third level queue is used for receiving the classified data transmitted by a second level queue module and displaying and storing the data according to types.

Description

L-based variable-adjustable data acquisition method and system
Technical Field
The invention belongs to the field of data acquisition, and particularly relates to a variable-adjustable data acquisition method and system based on L abview.
Background
In the fields of test measurement, automation and industrial control, along with the continuous improvement of the automation degree, critical variables need to be closely monitored at any time, the acquired data volume is larger and larger, and certain requirements are provided for the flexibility of variable acquisition because key variables concerned at different time intervals are changed at any time.
Two ways exist for traditional data acquisition: firstly, fixedly acquiring partial parameters, namely fixedly acquiring certain specific variables during starting up each time and discarding other variable data; and secondly, directly collecting all variables and uploading. The problems with this are: if only part of the parameters are fixedly acquired, parameters are omitted, and acquisition is incomplete, so that the system cannot be comprehensively controlled; if all the data are collected, the system is overstaffed and runs slowly, resources of the upper computer and the lower computer are wasted, and the additional processing burden of the system is increased. In addition, in the field of industrial control, with the change of factors such as production, environment, and operation conditions, the variables to be paid attention to are different, for example, special data acquisition is required for the variables which are frequently in question in the industrial production line, and at this time, the measured variables are required to be changed flexibly in real time according to the actual situation, which requires the data acquisition system to have the function of changing the variables at any time. However, in the conventional data acquisition and processing methods, fixed variable data is acquired and processed, and when the ever-changing acquisition requirements are met, the original acquisition program must be modified greatly, so that the variables cannot be tracked and acquired in real time, and a data acquisition method for multivariable and variable situations is urgently needed.
Disclosure of Invention
Aiming at the defects of the prior art, the invention aims to provide a variable-adjustable data acquisition method and system based on L abview, and aims to solve the problem that the existing data acquisition is not flexible enough when facing the constantly changing acquisition requirements.
In order to achieve the purpose, the invention provides a variable-adjustable data acquisition method based on L abview, which comprises the following steps:
s1, setting variables and sampling the variables according to the setting;
s2, packing each frame of sampling data uploaded by the lower computer into a plurality of groups and sending the groups into a primary queue;
s3, receiving the array of the primary queue by using the secondary queue, accessing array elements in an array index mode, classifying each element by a conditional structure, and then feeding the element into the tertiary queue;
s4, displaying and storing the classified elements according to types by the third-level queue;
s5, judging whether the collected variable type needs to be changed, if so, executing variable changing operation and returning to the step S1; otherwise, ending.
The variable change operation in step S5 includes:
s51, stopping data reception of the upper computer;
s52, emptying all data in the primary queue, the secondary queue and the tertiary queue;
and S53, sending a variable change instruction to the lower computer and waiting until the lower computer returns the information of successful change.
Further, the variable modification operation is performed in an event structure.
Further, the step S1 includes:
and (4) selecting the type and the number of variables to be acquired in advance through the event structure, and waiting until the lower computer returns information of successful selection.
The invention also provides a data acquisition system with adjustable variables based on L abeview, which comprises a setting module, a parameter setting module and a parameter setting module, wherein the setting module is used for setting the variables;
the primary queue module is used for receiving data uploaded by a lower computer, and each frame of data is packed into an array;
the second-level queue module is used for receiving the array of the first-level queue module, accessing array elements in an array index mode and classifying each element through a conditional structure;
the third-level queue module is used for receiving the classified data transmitted by the second-level queue module, and displaying and storing the data according to types;
and the variable changing module is used for judging whether the acquired variable type needs to be changed or not, and if so, executing variable changing operation.
Further, the variable modification operation is performed in an event structure.
Further, the initialization module selects the type and the number of the variables to be collected in advance through the event structure and waits until the lower computer returns the information of successful selection.
Compared with the prior art, the invention has the following beneficial effects:
1. the method can be widely applied to industries such as industrial control, production and manufacturing, medicine, agriculture and animal husbandry and the like, and particularly can flexibly change the variable type according to the actual working conditions in the field of industrial control with complicated and variable field variables, so that the whole acquisition process is more targeted and has higher efficiency, accurate analysis is realized, and the large-scale modification of the original acquisition program is not needed;
2. the three-level queue mode provided by the invention has the advantages that the classification of variables is independent into a single thread, the receiving speed and the speed difference between classification, display and storage can be balanced, and the problem of program crash caused by overlarge primary queue due to overlong time occupied by program classification in the traditional architecture is effectively solved.
Drawings
FIG. 1 is a flow chart of the operation of the present invention;
FIG. 2 is a three-level queue structure of the data acquisition method of the present invention;
fig. 3(a) and 3(b) are waveform diagrams of data before and after the change of the acquisition variable according to the embodiment of the present invention, respectively.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention. In addition, the technical features involved in the embodiments of the present invention described below may be combined with each other as long as they do not conflict with each other.
The invention provides a variable adjustable data acquisition method based on L abview, which comprises an event structure for processing functions of port connection, variable type and variable number change and the like, a primary queue structure for receiving data, a secondary queue for variable classification and a tertiary queue for variable display and storage, wherein the event structure is combined with the tertiary queue structure by combining the advantages of a producer consumer mode and a queue message device mode.
The queue functions at each stage are different: the data uploaded by the lower computer is processed by the upper computer and then sent into a first-level queue in an array form; the secondary queue is used for receiving the data of the primary queue, indexing the data according to an array indexing mode and then classifying the data according to a type required in advance; and the third-level queue is used for displaying and storing the data classified by the second-level queue.
The invention adopts three-level queues, and the reason is that: and aiming at the requirement that the variable needs to be flexibly changed, the step of data classification is added. However, the existing two-stage queue architectures, such as producer-consumer mode and queue message handler mode, cannot balance the receiving speed and the speed difference between classification, display and storage, and can cause the whole program to crash in a short time. The classification of the variable types is the most time-consuming part in the whole program, and the variable types are separated from the receiving process and the display process in a queue mode, so that the problem of program crash caused by overlarge first-level queue due to the fact that the program classification occupies too long time can be effectively solved.
In addition, in the process of changing the variable type each time, all data in the queue is cleared firstly, then the receiving condition of the upper computer is closed, the lower computer is informed to change the variable type, the lower computer is waited to return a message of successful change, and then new data is received.
FIG. 1 is a flow chart illustrating the operation of the present invention, including the following steps:
1. starting the upper computer, selecting a communication protocol with the lower computer, and starting connection between the upper computer and the lower computer;
2. initializing the whole upper computer program;
3. the method comprises the following steps of selecting the type and the number of variables to be collected through an event structure, starting data receiving, classifying and displaying after a lower computer returns information of successful selection, and completing the function by adopting a three-level queue structure, as shown in fig. 2, wherein each level of queue occupies one thread, and each thread is as follows:
3.1 packaging each frame data uploaded by the lower computer into an array form, and then sending the data into a primary queue;
3.2 receiving the array of the primary queue by using the secondary queue, then indexing the elements of the array in an array indexing mode, classifying the element types by using the condition structure of each element, and sending the classified elements into the tertiary queue;
and the 3.3 third-level queue is used for receiving the classified elements in the second-level queue and displaying and storing the elements according to types.
4. And judging whether the acquired variable type needs to be changed, if so, executing variable changing operation and starting to receive new data, and if not, ending.
The change of the variable is carried out in an event structure so as to ensure the timeliness of instruction transmission and separate from data. The variable modification process is as follows:
4.1 stopping the data receiving process of the upper computer;
4.2 emptying all data in the third-level queue;
4.3 sending an instruction for changing variables;
4.4, waiting for the return information of the lower computer which is successfully changed;
4.5 the upper computer starts the receiving of new data and carries out the classified display and storage process of data.
Example one
The method in the embodiment is applied to unmanned ship indoor experimental data acquisition, and comprises the following steps:
1. starting an upper computer, and carrying out an initialization process: emptying a receiving buffer area, a queue buffer area and an emptying oscillogram, and configuring default acquisition parameters;
2. the upper computer and the lower computer are connected through a network port, and four data types required to be collected are set through an event structure: variable 1-temperature, variable 2-rotating speed, variable 3-voltage and variable 4-current; selecting a TCP protocol, starting network port connection, starting data acquisition after a lower computer sends a message of successful connection, wherein the function is completed by adopting a three-level queue structure, each level of queue occupies one thread, and each thread is as follows:
(1) packaging each frame data uploaded by a lower computer into an array form, and then sending the data into a first-level queue;
(2) receiving an array of the primary queue by using the secondary queue, then indexing elements of the array in an array indexing mode, classifying element types by using a condition structure through each element, and sending the classified elements into the tertiary queue;
(3) the third-level queue is used for receiving the classified elements in the second-level queue and displaying and storing the elements according to types.
The acquired data and waveforms are shown in fig. 3(a), the data in the graph are the most original acquired data, one frame of data is 4 effective data with 16 bits, the uploading frequency is 5K, and it can be seen that the acquisition frequencies of the four groups of variables are consistent, and the acquired data amount is basically consistent;
3. in practice it has been found that current is a factor that requires further attention, while the attention to other factors, such as voltage, can be suitably attenuated. Therefore, at the moment, more monitoring needs to be carried out on the current, the type of the variable 3 is changed from voltage to current, then a variable change command is started, after the command is started, the upper computer firstly closes the original data receiving condition and empties the data in the queue so as to avoid confusion between the data collected this time and the data collected last time, then the changed command is sent to the lower computer, and after the lower computer replies a message of successful change, the data collection work is started again. The data and waveforms collected this time are shown in fig. 3(b), and it can be seen that the change frequency of the waveform diagrams of the variables 1 and 2 is basically kept unchanged, the waveform diagram of the variable 3 has no data, and the change frequency of the waveform diagram of the variable 4 is twice as high as the original change frequency.
In the embodiment, although only 4 variables are set, each variable can be flexibly changed along with the actual working condition, so that extra burden can not be caused to the system, and the acquisition requirement is well met; on the basis, the problem of program breakdown caused by overstaffed primary queues due to overlong time occupied by program classification is effectively solved by utilizing a three-stage queue structure. During operation, the type of the variables required to be acquired is set on the front panel through the pull-down menu, and the number of the acquired variables is input through numbers, so that the adjustment of the acquired variables can be conveniently completed, large-scale modification on programs is not needed, and the acquisition instantaneity is guaranteed.
It will be understood by those skilled in the art that the foregoing is only a preferred embodiment of the present invention, and is not intended to limit the invention, and that any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the scope of the present invention.

Claims (7)

1. A variable-adjustable data acquisition method based on L abview is characterized by comprising the following steps:
s1, setting variables and sampling the variables according to the setting;
s2, packing each frame of sampling data uploaded by the lower computer into a plurality of groups and sending the groups into a primary queue;
s3, receiving the array of the primary queue by using the secondary queue, accessing array elements in an array index mode, classifying each element by a conditional structure, and then feeding the element into the tertiary queue;
s4, displaying and storing the classified elements according to types by the third-level queue;
s5, judging whether the collected variable type needs to be changed, if so, executing variable changing operation and returning to the step S1; otherwise, ending.
2. The data acquisition method as claimed in claim 1, wherein the variable change operation in step S5 includes:
s51, stopping data reception of the upper computer;
s52, emptying all data in the primary queue, the secondary queue and the tertiary queue;
and S53, sending a variable change instruction to the lower computer and waiting until the lower computer returns the information of successful change.
3. The data collection method of claim 2, wherein the variable modification operation is performed in an event structure.
4. A data acquisition method as set forth in any one of claims 1 to 3, wherein the step S1 includes:
and (4) selecting the type and the number of variables to be acquired in advance through the event structure, and waiting until the lower computer returns information of successful selection.
5. A data acquisition system with adjustable variables based on L abview is characterized by comprising a setting module, a parameter setting module and a parameter setting module, wherein the setting module is used for setting the variables;
the primary queue module is used for receiving data uploaded by a lower computer, and each frame of data is packed into an array;
the second-level queue module is used for receiving the array of the first-level queue module, accessing array elements in an array index mode and classifying each element through a conditional structure;
the third-level queue module is used for receiving the classified data transmitted by the second-level queue module, and displaying and storing the data according to types;
and the variable changing module is used for judging whether the acquired variable type needs to be changed or not, and if so, executing variable changing operation.
6. The data acquisition system of claim 5, wherein the variable modification operations are performed in an event structure.
7. The data acquisition system according to claim 5 or 6, wherein the initialization module preselects the type and number of variables to be acquired through an event structure and waits until the lower computer returns information of successful selection.
CN202010056789.8A 2020-01-17 2020-01-17 L-based variable-adjustable data acquisition method and system Pending CN111460025A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010056789.8A CN111460025A (en) 2020-01-17 2020-01-17 L-based variable-adjustable data acquisition method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010056789.8A CN111460025A (en) 2020-01-17 2020-01-17 L-based variable-adjustable data acquisition method and system

Publications (1)

Publication Number Publication Date
CN111460025A true CN111460025A (en) 2020-07-28

Family

ID=71681754

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010056789.8A Pending CN111460025A (en) 2020-01-17 2020-01-17 L-based variable-adjustable data acquisition method and system

Country Status (1)

Country Link
CN (1) CN111460025A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112067307A (en) * 2020-09-02 2020-12-11 南京航空航天大学 LabVIEW-based data acquisition and monitoring system of small piston engine

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050015158A1 (en) * 2003-07-16 2005-01-20 Kyung-Yang Min Data acquisition system and method for process control and recording medium with recorded data acquisition program
CN102507190A (en) * 2011-10-10 2012-06-20 北京理工大学 Engine test data acquisition system with automatic data recording and compressing functions
CN104063216A (en) * 2014-06-12 2014-09-24 北京航天发射技术研究所 High-speed data processing display method based on Labview
CN106649496A (en) * 2016-10-10 2017-05-10 国信优易数据有限公司 Government affairs data collecting and sharing system and method
CN108981787A (en) * 2018-07-23 2018-12-11 中电科技(合肥)博微信息发展有限责任公司 Measuring system and measurement method based on LabVIEW

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050015158A1 (en) * 2003-07-16 2005-01-20 Kyung-Yang Min Data acquisition system and method for process control and recording medium with recorded data acquisition program
CN102507190A (en) * 2011-10-10 2012-06-20 北京理工大学 Engine test data acquisition system with automatic data recording and compressing functions
CN104063216A (en) * 2014-06-12 2014-09-24 北京航天发射技术研究所 High-speed data processing display method based on Labview
CN106649496A (en) * 2016-10-10 2017-05-10 国信优易数据有限公司 Government affairs data collecting and sharing system and method
CN108981787A (en) * 2018-07-23 2018-12-11 中电科技(合肥)博微信息发展有限责任公司 Measuring system and measurement method based on LabVIEW

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
刘佳 等: "方波激励的生物电阻抗谱自动测试系统", 《北京生物医学工程》 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112067307A (en) * 2020-09-02 2020-12-11 南京航空航天大学 LabVIEW-based data acquisition and monitoring system of small piston engine

Similar Documents

Publication Publication Date Title
WO2022032684A1 (en) A method, device, system and storage medium for fault diagnosis and solution recommendation
US6847850B2 (en) Process control loop analysis system
KR100603612B1 (en) Apparatus and Method of RFID Reader Interface and Event Management for Heterogeneous Readers with Multi-Protocol
EP2053786A2 (en) Targeted resource allocation
CN106406253B (en) System and method for controlling and/or analyzing an industrial process
CN102929620A (en) Flexible measurement and control platform system and development method thereof
US20180259929A1 (en) Control device and non-volatile computer readable recording medium
US7505875B2 (en) Monitor system, and monitor device and data collecting device therefor
EP3835898A1 (en) Artificial intelligence computing device, control method and apparatus, engineer station, and industrial automation system
CN110445671B (en) Network traffic monitoring method based on SDN
CN105278879A (en) Processing method and device of monitoring data
CN111752195A (en) Embedded industrial Internet of things data acquisition monitoring system and method
CN111460025A (en) L-based variable-adjustable data acquisition method and system
US11044319B2 (en) Equipment analysis support apparatus, equipment analysis support method, and equipment analysis system
CN101158859B (en) Defect data real time collecting device and method thereof, and production line real-time data capturing system
CN108416151A (en) A kind of Satellite TT information flow intelligentized design system and fault message method for rapidly positioning based on model
CN104717676B (en) A kind of wireless communication signals monitoring analysis system based on PXI instruments
EP3418829B1 (en) Method of logging process data in a plc controlled equipment
CN111108453A (en) Control system, control method, and control program
CN112654939B (en) Control system and control device
EP3926428B1 (en) Control device, control program, and control system
CN210573361U (en) Integrated numerical control terminal
KR101627489B1 (en) Function unit, analog input unit, and programmable controller system
US6192286B1 (en) FA information managing method
US20170235299A1 (en) Numerical controller

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