时间:2024-07-28
WEN feng, YUAN Xiao-kang, DING Zhi-zhao, WANG Xiao-li, ZHEN Guo-yong
(1. Science and Technology on Electronic Test & Measurement Laboratory, North University of China, Taiyuan 030051, China;2. The 41st Research Institute of China Electronics Technology Group Corporation, Qingdao 266555, China)
Abstract: In order to realize the efficiency, reliability and safety tests on the complex cable network of an electronic system, an efficient cable network resistance tester is designed. Firstly, the design background and hardware structure are briefly described. Then aiming at the multi-task parallelism considering real-time measurement of parameters and real-time control of the system in the tester testing, a real-time multi-task control software is developed by using multi-thread testing technology in parallel test to realize multi-task complex control. Finally, the least squares method is used to improve the test accuracy of the tester. The test results show that the test error is basically within 0.3%, and the test speed can reach 345 point/min.
Key words: cable tester; multi-thread parallel; least square method
Cable is the bridge of signal communication among various kinds of electronic equipment, and the resistance of cable is one of the important indexes of cable network. By analyzing the resistance, we can judge whether there is hidden danger in the cable network. The cable network system of modern equipment is complex because the model is numerous and the number of pins is various. The test of these cable networks is a complicated work[1]. The traditional test method has a manual use of hand-held three tables, buzzers and other tools for point-by-point testing, which is suitable for testing less cable type and less cable core[2]. If we need to complete the test on a large number of multi-core cables, not only a lot of time and energy of the staff are consumed, but also manual testing is easy to cause gross error due to errors in operation.
In view of the problems existing in the traditional cable testing, this paper designs an efficient cable network tester, which can automatically test the cable network of various types of equipment.
The test system adopts peripheral component interconnect extensions for instrumentation (PXI) bus frame. PXI hardware consists of three basic parts: chassis, system controller and peripheral modules. The chassis is the structure platform of the system controller and peripheral module; The system controller (host card) is used as the main control unit of the whole system; The peripheral module is mainly chosen according to the user’s needs.
The tester uses ADLINK PXIS-2508 (G) chassis. The chassis is a standard 8-slot 3U PXI chassis, the host card used for the chassis is Linghua Technology PXI-3980 board, and the board CPU model is Core i7 dual core with the main frequency of 2.1 GHz. The peripheral module uses PXI-2575 matrix switch (2 blocks) and PXI-4070 digital multimeter. The hardware frame of the tester is shown in Fig.1[3].
Fig.1 Hardware structure of the tester
Cable transfer board and transfer cable constitute transfer cable module.The test on the cable network of different types of missiles can be realized by the design of transfer cable module[4], and the universality of the instrument can also be realized.The PXI-2575 matrix switch can measure channel switching, and can complete the switch of 196 measuring points at most. The resistance of the card relay is about 0.5 Ω, and the maximum speed of switching is 140 times per second when the hardware is triggered.The system uses two matrix switches,which can realize the switch of the maximum 196×196 measuring points. The maximum measurement accuracy is 6.5 bit, and the measuring range of the multimeter can be automatically adjusted or manually adjusted according to the measured value. In theory, the maximum sampling frequency of the 6.5 bit measurement can reach 100 sampling per second.The PXI-4070 digital multimeter is mainly used to measure the resistance between access points. PXIS-2508 (G) chassis and system controller control the digital multimeter and matrix switch module via the PXI bus.
The digital multimeter module can communicate with the matrix switches in the PXI chassis by using the timing and synchronization functions inherent to the PXI platform.The digital multimeter module sends and receives the trigger signal through the trigger line of the PXI backplane, so as to realize the handshake with the matrix switches. This scanning method avoids the software expenditure required by the traditional scanning list method. The whole measurement sequence adopts hardware timing, without other software delay, which can not only save CPU resources, but also ensure the optimal throughput.
When measuring, the positive and negative terminals of the multimeter are connected to the COM terminal of the matrix switch 1 and switch 2, respectively, and the computer uses PXI bus to control the matrix switches to complete the switching of measuring points. The multimeter is responsible for testing the channel resistance, and the measured value is uploaded to the host computer through the PXI bus, and then displayed and stored.
Multi-thread technology means the program contains multiple execution streams, that is, a program can run multiple different threads simultaneously to perform different tasks[5-7]. When the computer CPU contains only one kernel, the multiple tasks can only be executed concurrently, that is, multiple tasks are executed at the same intervals. Since the computer executes very quickly, logically multiple tasks are executed at the same time interval; When the computer enters the multi-core aera, a CPU has multiple kernels, therefore each task in the multi-thread tasks can be executed by different kernels simultaneously, and the parallel test is realized, which greatly improves the system efficiency.
The system software is programmed with C# language under the Visual Studio 2010 platform of Microsoft Corp. C# language can thread by using the Thread class to create, suspend, restore, sleep, terminate and set the priority.The Thread class is located under the system. The functions of creating, suspending, restoring, sleeping and terminating the thread are shown in Table 1.
Table 1 C# thread operation functions
In C# applications, users can define priorities for threads by using ThreadPriority enumerations. C# can set 5 different priorities, from high to low, respectively, namely Highest, AboveNormal, Normal, BelowNormal and Lowest. When the thread is created, if the priority is not specified, the system defaults it to ThreadPriority.Normal.
In multiple threads, if different threads read and write a variable simultaneously, it is easy to cause the object access error and thus leads to the program abnormal. Thread synchronization technology can prevent shared objects from being accessed simultaneously through mutex locks. When a thread locks a shared object, other threads that want to access the object must wait for the shared object to be unlocked before it can be accessed. The object locking mechanism ensures that only one thread can access the object at a time in case of confusion. C# language mainly uses Mutex, Monitor and Lock to achieve thread synchronization operation.
The software needs to finish the resistance measurement, processing test data, data storage and real-time display of the main interface and other operations. When a single thread is used, you must finish one task and then do other tasks, which greatly reduces the efficiency of the program execution, and the real-time performance of the system is difficult to be guaranteed. Each module of the program is executed under multiple independent threads, which can realize multi-task running simultaneously and improve the utilization ratio of CPU.
The software mainly contains five threads: one main thread and four sub-threads. The main thread is mainly used to respond to the operation of the user interface and to display each point value in real time in the software interface. It has the highest priority, which ensures that the user’s operation can be processed in time and each point can be displayed in real time. The four sub-threads include resistance measurement thread, data display thread, database storage thread and data processing thread. By setting multi threads, it can ensure multiple threads running at the same time, and effectively improve work efficiency.
The flow chart is shown in Fig.2.
Fig.2 Software flow chart of upper computer
In order to improve the measurement accuracy, for the processing of the results, each data will take several measurement methods for the mean value, and the expression of error is obtained by least square method. For the resistance of the transfer cable, before measuring, the cable interface measuring point is shortened by the calibration cable, and the resistance value of the transfer cable is measured in the form of the database calibration value. When the tester is tested for the channel resistance, the resistance of the cable is automatically deducted from the system software because the test resistance contains the loop resistance of the transfer cable. The design of the algorithms is described as follows.
The test instrument is used to measure the value of the high precision resistance box. It is convenient to measure the resistance of each range. The digital multimeter module of the tester is set as automatic. The measurement number of the multimeter under the automatic range is set to 5.5 bit by default.and the measurement result is shown in Table 2.
In order to obtain better measurement results and higher accuracy, the measured resistance is processed by the least squares method. The least squares formula are
The average value of each group is taken as the standard value, anda=0.996 45 andb=0.063 23 can be calculated. The correction formula isy=0.996 45x+0.063 23. The measurement resistance is again obtained by using the correction formula, as shown in Table 3. It can be seen that the measurement error is further reduced by least square method.
Table 2 Original test data of the system
Table 3 Data correction by least square method
To improve the test efficiency, reliability and safety of all kinds of cables on the cable network, an efficient portable cable tester is studied. The degree of automation of the system is high, which greatly reduces the error caused by human factors affecting the test[7]. By using multi-thread technology, the software ensures the real-time performance of the system, and makes the system reliable and efficient. By using least square method and Romanowski criterion, the measurement accuracy is improved effectively. The system has been successfully applied to the test of a certain missile cable network.
我们致力于保护作者版权,注重分享,被刊用文章因无法核实真实出处,未能及时与作者取得联系,或有版权异议的,请联系管理员,我们会立即处理! 部分文章是来自各大过期杂志,内容仅供学习参考,不准确地方联系删除处理!