Software Design of Network Measurement and Control System for CNC Machine Tools Based on B/S Mode

Publisher:SparklingSoulLatest update time:2013-01-18 Source: 21IC Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

  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.

Software program structure diagram

  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:

Display interface of each functional module

  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.

Establishing a connection to the database

  ② 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.

The corresponding historical curve drawn on the data playback interface

 

  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.

Software architecture diagram

  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:

Configuration of OPC Server

  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

LabVIEW Real-time Database

Reference address:Software Design of Network Measurement and Control System for CNC Machine Tools Based on B/S Mode

Previous article:Application of DDS Technology in High Frequency Quartz Crystal Test System
Next article:Maintenance of electromagnetic flowmeter is the key

Latest Test Measurement Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号