A virtual instrument design scheme for software control measurement equipment with industrial computer as the core

In order to simplify the measurement process and improve production efficiency, this paper presents a virtual instrument design scheme with the industrial computer as the core and the existing measurement equipment controlled by software. The system control software adopts the design idea of ​​component object model (c()M), which is convenient for software maintenance and upgrade, and uses the Access database to propose the concept of “real-time measurement archive”. The entire system achieves the expected goals better without increasing too much cost.


The system is based on the industrial computer, supplemented by a certain peripheral simple circuit, through the GPIB, USB and serial communication port, the existing measuring instruments are connected, and the control software for the measurement process is developed by the programmer. The measurer only needs to correctly connect the instrument and the device, and send a simple operation instruction to the juice machine to realize the whole process of measurement, data analysis, processing and recording.

1. Measuring instrument as a COM component

In software development, the instrument can be designed as a COM component. The function of the instrument should be fully realized in the C()M component setting juice and the corresponding interface function is given. In the virtual instrument software, the operation of the specific instrument is realized by calling these components. In this way, the programmer can treat the specific instrument as a component when developing the virtual instrument control software, and complete the operation of each instruction of the actual instrument through each function of the component. This is not only easy to troubleshoot problems that may occur with the hardware, but once the hardware is updated, the developer only needs to perform upgrade and maintenance for the C0M.

Taking a spectrum analyzer as an example, the process of measuring the spur value of a signal within the range of pressure control is set by the juice:

1) First adjust the spectrum analyzer to the logarithmic coordinate system, and set the center frequency of the spectrum analyzer and the appropriate bandwidth according to the variation range of the signal to ensure that the spectrum analyzer can capture signals within the controlled voltage variation range. This implements a sub-process of measuring spurious initialization;

2) Read all signals outside the main lobe of the signal within the bandwidth at different voltage control points, with the largest sidelobe value as the spurious value. In order to avoid white noise of the signal, the measurement of the spurious value is affected. The same pressure point is used to measure the idea that several groups of signals are averaged by software. Smoothing the signal fluctuation caused by white noise, taking the smoothed spurious value as the measurement result, thus implementing the sub-process of measuring the current signal spur value.


Figure 1 Stray value measurement flow chart

In the process of continuously measuring several groups of signals for averaging, there is a time for the industrial computer to communicate with the spectrum analyzer between adjacent two sets of data measurement, which weakens the time correlation of the signal and is not conducive to smooth white noise. . In order to improve the accuracy of the measurement, a spectrum analyzer that can be used for the mean value measurement is introduced. The industrial computer only needs to read the maximum value of all signals outside the main lobe after the mean value measurement as the current signal spurious value. Redesign the spectrum analyzer COM component according to the above ideas. The process of measuring the spurious value is still in accordance with the above measurement flow chart. The virtual instrument software calls the updated component, and the programmer may not even need to change the source code of the virtual instrument software.

The spur values ​​measured by the software before and after the improvement of the same signal are -76.3dB and -78.2dB, respectively, while the value measured by the calibration device is -78.51dB, and the measured value of the improved software is more accurate.

2, using Access database for real-time measurement archive

During the measurement process, sometimes the equipment may be accidentally interrupted due to a series of unpredictable faults such as sudden power failure, computer* attack, etc., but the user measurement may not be finished yet, and there is no large submission measurement report, but in the system memory. All the data in the data will be lost, which is very unfavorable for the user, so a real-time database backup of all the user's measurements must be made.

The database for monitoring the whole process of user measurement uses all memory variable storage methods, including the user's set amount, the user's measurement result, the user's operation steps, and the automatic judgment of the measurement result, and the corresponding fields are established in the database. When the user performs a virtual instrument operation. Each new measurement of a product will create a new measurement record with the product number and measurement time filled in by the user. During the operation, the user's operation and results will be submitted to the database in real time, only after all the users have finished measuring and saving the report. The record is deleted, otherwise the record is retained, and the remaining record is the real-time measurement archive of the abnormal exit system. This is the process of the system real-time measurement archive. When the user opens the virtual instrument software next time, the software will automatically load the database. If there is a data record in the database, after the operation interface is loaded, the user will be prompted to have a previously unfinished task, and let the user choose whether to continue the unfinished task or delete the task. An incomplete test record, if you choose to continue, it will give an unfinished task list, let the user choose to start an unfinished task, the user will automatically restore the corresponding value in the database to the virtual instrument operation interface, restore some The result of an unexpected state, so that the process of loading the measurement archive is realized through the system inquiry and the user's choice. Of course, if the user can also choose to delete some test records that are not complete but do not want to keep, and clean up the archive database, you can also choose a new measurement to start a new operation.

The workflow of the virtual instrument software is shown in Figure 2.


Figure 2 is a database-based software workflow

3, system performance

Using the solution of this paper, the virtual instrument software developed by VB.NET programming language is successfully applied to the measurement of indicators of a certain product. The whole system has a short development cycle and simple and convenient maintenance. The "Real-Time Measurement Archive" adds an ability to resist external emergencies based on the internal protection of the software, effectively protecting the measurement data. The time required for each product measurement is only 1/3 to 1/4 of the original manual instrument measurement (excluding the later data processing time), which greatly improves the production efficiency. The development cost of the whole system is very low. All the measuring instruments use the existing equipment. The hardware investment is only one industrial computer and GPIB adapter card and some cables.

700 Puffs

700 Puffs,Electronic Cigarettes,Portable Vape Pen,NEW Disposable Vapes,Rechargeable Disposable Vape

Shenzhen Xcool Vapor Technology Co.,Ltd , http://www.xcoolvapor.com