Design of data acquisition, display, storage and playback software for lower-level measurement and control machines
The lower-level measurement and control server system software includes two parts: interface instrument driver software and application software. Among them, the interface instrument driver is a collection of software programs that complete the control and communication of a specific instrument. It is the link and bridge between the upper-level easy-to-use software and the underlying software. Each instrument module has its own software driver, which is provided to the user by the instrument manufacturer in the form of source code, and the user calls the instrument driver in the application. The application contains two programs: the front panel software program that implements the virtual panel function and the flowchart software program that defines the test function. Its main function is to provide users with a human-machine interface to operate instruments and display data; to realize data collection, analysis, processing, display, storage, etc.; and to send the data that needs to be displayed on the client to the Web server, and at the same time receive control commands from the remote client from the Web server.
1.1.1 Structured design of CNC machine tool measurement and control software
The basic software structure of the CNC machine tool data acquisition system in this article includes data acquisition, data processing, storage and playback, and user interface. Object-oriented design and analysis methods can be used in the design of measurement and control software. Through careful planning and design, the program structure is clear and easy to maintain, modify, and increase. The software program structure diagram is shown in Figure 1.
The structured program mainly includes the following functional modules (see Figure 1 above for the structure diagram):
①A/D channel calibration module
Before acquisition, the acquisition channel is calibrated to ensure the accuracy of the A/D channel.
②Current acquisition module
The current acquisition module uses a data acquisition card with an AD converter to collect the current consumption of the CNC machine tool during the experiment.
The RRBDP software performs various forms of filtering, curve fitting, smoothing and other processing on the collected data.
③Sensor calibration module
The current sensor is calibrated to ensure that the sensor output signal is as close to the true value as possible.
④Laser interferometer data module
Through the USB interface communication, the length collected by the interferometer is obtained and sent to other modules after analysis.
⑤Camera data acquisition and display module
This module is responsible for completing video acquisition, display and analyzing the movement of CNC machine tools.
⑥Test data analysis module
Analyze and match the test data, build a mathematical model and send it to the curve display module.
⑦Real-time curve display module
The relationship curve between current consumption, positioning accuracy and coordinates is displayed in real time, and the XY graph in LabVIEW with good visual effects is used to draw the curve control driver. The waveform is intuitive, detailed and easy to observe.
⑧Waveform analysis module
The relationship curve (i.e., waveform) is analyzed according to the sub-items that need to be studied, and the analysis results and waveform are stored as output data in a specific file format.
⑨Test logging configuration module
Record the information of the tested CNC machine tool, test times, test date, test personnel and output data file directory.
⑩Historical curve playback module and historical data
The export module loads the data and waveform files generated after previous tests and plays them back to ensure that previous test results are traceable.
1.1.2 Design of data display and storage playback program
The basic knowledge required for data display and storage playback program design in this chapter includes: CNC programming, CNC machine tool operation, circuit basics, VC++, C++, Web Service, LabVIEW and test instruments, etc. Based on the above program development structure and foundation, the display interface of each functional module is shown in Figure 2 below:
Figure 1.2 is the LabVIEW real-time data acquisition display interface. The operation process of the software is described as follows:
(1) AD channel calibration refers to the measurement calibration of the acquisition board. If the measured analog quantity is not within the accuracy requirement, the software has its own calibration function.
(2) The parameter setting interface is used to configure some parameters according to user requirements, such as the starting point, end point, step length and other parameters of the displacement.
(3) The test interface is shown in Figure 1.2 above, which is also the main interface of the software. However, after selecting the test method, (when the hardware is connected), real-time collection and display will begin. For the collected data, after the test is completed, click Save to save it to an Excel table, or save it in a specific format. Then pour this data into the analysis software for free analysis, so that corresponding compensation can be made. However, for a large amount of test data in the factory, the database is the first storage method. You can use LabSQL to add records to the database data table, assuming that the data table is a displacement table. The specific steps are as follows:
① Establish a connection with the database. First, create a Connection object through ADO Connection Create.vi, and then use ADO Connection Open.vi to establish a connection with the database. The database is specified by the ConnectionString of ADO Connection Open.vi, and this parameter is provided by the string control on the front panel, as shown in Figure 1.3 below.
② Generate SQL commands and execute them. Enter the table name in the table control on the front panel, and the field values in the Current and Error controls. Use Format Into String in the flowchart to generate SQL commands, connect it to ADO Connection Execute.vi to execute, and display the command in the Command Text control on the front panel. [page]
③Disconnect the connection with the database. Use ADO Connection Close.vi to close the Connection object, and use ADO Connection Destroy.vi to delete the Connection object.
(4) The historical data playback interface can open the file to be played back and queried according to the test date and time according to user needs. The corresponding historical curve drawn on the data playback interface is shown in Figure 1.4.
In the real-time and historical curve display section, the trend curve can clearly depict the distribution trend of field data over a period of time. Through the trend chart, the operator can see the changes in various quantities based on the changing trends of the data at each field data collection point, and can view the data at any historical moment for field operators to make appropriate processing.
1.1.3 Application of data recording and monitoring module DSC
(1) In the process of implementing the above functions, the measurement and control system encountered three practical engineering problems:
① The display speed of field data in the monitoring interface is slow, with the slowest delay reaching 5 seconds. Obviously, this does not meet the real-time requirements of industrial field process control.
②Because LabVIEW software itself does not have a real-time database like FIX industrial control software. When the system is relatively small, that is, when the number of control points is small, the concept of global variables can be used to implement the monitoring function. The on-site measurement points to be monitored or controlled are regarded as global variables, and they are temporarily called "global variable libraries". Then regard each function implemented by LabVIEW as a subroutine, and each subroutine takes data from or writes data to the global variable library. In other words, regard this "global variable library" as a real-time database, and each measurement point on site corresponds to the parameters in the library one by one. This method is still feasible when the number of control points is small, but when the system is large or medium-sized, that is, when there are many on-site control points, it is found in practice that the method of using global variables not only requires a large amount of programming, but also the data search is not as convenient and fast as the database search. In addition, global variables have always been a method that programmers try to avoid.
③ In the actual process control monitoring, it is required to switch back and forth between various interfaces to achieve friendly operability of the interface. FIX monitoring software can easily switch between interfaces by programming functions that call various interfaces. However, in the process of using LabVIEW to switch between interfaces, the above-mentioned "global variable library" is made in the "data overview" interface, and other subroutines (interfaces), such as "real-time and historical curves", "historical data", various flow charts, etc., all exchange data with it. Therefore, the "data overview" subroutine plays the role of a real-time database, and it cannot be closed during the operation of the system. This topic uses VI Sevrer technology to make the "data overview" subroutine start running in a minimized form when the system is already running, ensuring the real-time nature of the data. However, considering that the two subroutines of "historical data" and "historical curves" cannot be closed during the operation of the system due to the need to access historical data, they are also always running in a minimized state. According to the above approach, it is found that during the operation of the system, the switching speed between various interfaces is slow, which cannot fully meet the requirements of real-time and reliability of field process control.
(2) Problem solving method based on DSC module
The first problem is that there is a significant difference in the speed of data reading and writing. Using Datasocket technology to program data reading and writing, the speed of writing data is very fast. So it may be the data buffering in programming or the low execution efficiency of waiting for events in the program. It is decided to connect the data display part directly to the OPC server using Datasocket on the front panel. As a result, the data display speed obviously reaches several hundred milliseconds, which meets the real-time requirements. Moreover, this method has a short development time and high efficiency.
On the premise that LabVEIW can initially realize functions such as data acquisition, display and storage, considering the LabVIEW add-on module launched by NI - Datalogging and Supervision Control Module DSC, this module is designed and developed specifically for process control and is an ideal software tool for easily designing and maintaining distributed monitoring systems. This module can be used to easily connect to devices, including LabVEIW real-time target modules and OPC devices. From system overview to node execution, the module provides built-in development tools to successfully record data, alarms and events; display the trend of production data over time; and extract data from the network database using SQL/ODBC standard queries. The application of this module enhances the flexibility of searching and extracting data and improves the reliability and protection of data records.
Compared with other add-on modules, the DSC module has the following six features: built-in network development tools; for data sharing and integration with third-party devices; application security settings; development tools for distributed monitoring; network database for distributed data recording; real-time and historical trend curves.
(3) Combination of “LabVEIW+DSC” Using the combination of “LabVEIW+DSC”, the software architecture diagram is shown in Figure 1.5.
In order to improve the openness of the system, the design method of "LabVIEW+OPC" was selected. That is, LabVIEW is used as the upper computer monitoring software, and the advanced network communication technology--DataSocket technology is adopted to realize on-site data sharing through the OPC server interface. The OPC server used here is developed by Matrikon. It acts as an intermediate bridge to realize data communication between the monitoring software LabVIEW and the on-site intelligent components, and establishes a one-to-one correspondence with the data collection points of the underlying equipment through the OPC configuration items. As shown in Figure 1.6 below:
Figure 1.6 is the configuration of the OPC server, where the item name is the data collection point corresponding to the site defined by the user, and the Item Path must comply with the syntax requirements of the OPC server and the MODBUS protocol, i.e. "[port].Device. 0~4:", and at the same time set whether the item is to read data or write data, as well as the data type, update time, etc.
There are many ways to access OPC in LabVIEW. This article uses the Tag Configuration Editor engine in the DSC module to establish a connection between LabVIEW and the OPC server. The DSC module uses tags to connect to OPC data items. Through the Tag Configuration Editor, you can match the DSC tags with the OPC data items and generate a scf file, which is equivalent to the real-time database of LabVIEW, as shown in Figure 1.7
Previous article:Application of DDS Technology in High Frequency Quartz Crystal Test System
Next article:Maintenance of electromagnetic flowmeter is the key
- Popular Resources
- Popular amplifiers
- Keysight Technologies Helps Samsung Electronics Successfully Validate FiRa® 2.0 Safe Distance Measurement Test Case
- From probes to power supplies, Tektronix is leading the way in comprehensive innovation in power electronics testing
- Seizing the Opportunities in the Chinese Application Market: NI's Challenges and Answers
- Tektronix Launches Breakthrough Power Measurement Tools to Accelerate Innovation as Global Electrification Accelerates
- Not all oscilloscopes are created equal: Why ADCs and low noise floor matter
- Enable TekHSI high-speed interface function to accelerate the remote transmission of waveform data
- How to measure the quality of soft start thyristor
- How to use a multimeter to judge whether a soft starter is good or bad
- What are the advantages and disadvantages of non-contact temperature sensors?
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- Rambus Launches Industry's First HBM 4 Controller IP: What Are the Technical Details Behind It?
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- CD4013BM is attached to the PCB board and the two-color touch switch (red and green) cannot flip the two colors.
- What is the difference please???
- Orcad learning notes (II) pad and package production
- Can you simplify the equation on the left side of the picture to the equation with RX and RY on the left side of the equal sign?
- [National Technology N32WB452 Review] 4. Bluetooth control of RGB full-color atmosphere lights
- Share a Huawei base station power amplifier from many years ago (2 pictures)
- How many applications can NXP's cross-border processors play? Watch the short video to reveal the secrets & win a prize in the AI-IoT series
- About the problem of transistor driving the same voltage load and different voltage load
- Features of PSE108EX V2.0 POE Switch
- Domestic RISC-V chip onlookers