Share this

Test software design based on virtual instruments and VME bus

2026-04-06 08:32:56 · · #1
Abstract: This paper presents a test software based on the VME bus developed using virtual instrument technology. It has been successfully applied to the electronics testing of the main drift chamber of the Beijing Spectrometer III, a large detector at the Beijing Electron-Positron Collider. The software utilizes the dynamic link library calling mechanism provided by LabVIEW. By calling the dynamic link library compiled in VC++, it accesses various functional boards on the underlying VME bus, thereby realizing communication between LabVIEW and non-NI boards. This provides an effective test software for the electronics testing system of the Beijing Spectrometer III main drift chamber. Keywords: Virtual Instruments; VME Bus; LabVIEW; Dynamic Link Library Abstract: This paper presents the design of Virtual Instrument technique based VMEbus, which has been applied in BESIII Main Drift Chamber Electronics successfully. This design, developed in LabVIEW and VC++ 6.0, has realized the communication between LabVIEW and data acquisition card non-NI. LabVIEW and its DLL calling mechanism are introduced briefly. Testing functions of the software, as well as its user interfaces, are described in detail. Key words: Virtual Instruments; VMEbus;, LabVIEW; Dynamic Link Library 1 Introduction The concept of virtual instruments proposed by NI in the United States is a major breakthrough in the concept of traditional instruments. The so-called virtual instrument is to fully combine traditional instrument hardware and computer software technology to realize and expand the functions of traditional instruments[1]. Compared with traditional instruments, virtual instruments have obvious technical advantages in terms of intelligence, processing power, performance-price ratio, and operability. At the same time, VME bus is one of the best performing and most widely used international bus standards. Therefore, its combination with virtual instruments provides a broader development space for automatic testing systems. 2. Implementation of Testing Software on the VME Bus This paper describes the design of an effective testing software system using virtual instrument technology on the VME bus. This software enables hardware debugging and performance testing of the BESIII main drift chamber electronics testing system. The testing system uses the SBS VP7 embedded single-board computer, a 6U main controller based on the VME bus. The VP7 integrates a CPU, memory, hard disk, graphics card, USB interface, serial port, parallel port, and 10/100M Ethernet interface. It can run operating systems such as Windows 2000/NT/98, VxWorks, Linux, and MS-DOS, and provides a UniSDK_NT toolkit for the Windows operating system. The core of the UniSDK_NT toolkit is the UniAPI interface functions, written in standard C language. UniAPI implements access and control of the VME bus. The main interface functions used in this design include: API_RESULT VmeMasterOpen(VME_MASTER_CHANNEL *pMasterChannel); API_RESULT VmeMasterClose(VME_MASTER_CHANNEL *pMasterChannel); API_RESULT VmeWrite32(VME_MASTER_CHANNEL MasterChannel, U32 VmeAddress, U32 Data); U32 VmeRead32(VME_MASTER_CHANNEL MasterChannel, U32 VmeAddress, API_RESULT *pResult), etc. The test software uses Visual C++ 6.0 as the development tool for calling the VP7 API, performing read and write operations on the VME bus and responding to interrupts, and generating a dynamic link library (DLL) for use by upper-layer user programs. As it is necessary to implement functions such as parameter setting and data display, and to operate the panel as if it were a real instrument during the test, the test software uses the virtual instrument software development platform LabVIEW to write the upper-level user program. LabVIEW, as a graphical programming language, has one of the most convenient features: it provides a large number of graphical components similar to the control panel of the actual instrument. This makes interface programming extremely simple, and operating these graphical interfaces on the computer is almost exactly the same as operating the actual instrument in reality. However, LabVIEW is not as powerful as C language in accessing the underlying hardware, especially the hardware designed by the user. To this end, LabVIEW has implemented the connection with external program code through DLLs, shared libraries, etc., and has implemented tasks that it cannot or is not easy to implement itself through external code that can or is more suitable for completing such tasks [2]. The software uses the dynamic link library mechanism provided by LabVIEW and accesses the underlying functional plug-ins by calling the DLL generated by VC++ compilation. The dynamic link library mechanism is the key technology used by the test software, which is specifically implemented by the "Call Library Function Node (CLF)" in the LabVIEW function template. The implementation method is shown in Figure 1. [align=center] Figure 1 Schematic diagram of the test software implementation method[/align] 2.1 Using VP7 API to write dynamic link library test software in VC++ environment. The test software is written and linked using the interface functions in UniSDK_NT provided by VP7. The process of generating a DLL file is as follows: 1) Select File\New\Project from the menu to create a new project, and name the project DAQdll; 2) Select Win32 Dynamic-Link Library from the project list; 3) Select the storage directory, which creates the DAQdll.dll project; 4) In the DAQdll project, select Add\Add New File to create a new file DAQdll.cpp; 5) Edit the DAQdll.cpp file: #include …… void GetWaveform(VME_MASTER_CHANNEL channel, int nModuleNum, int nChannel, unsigned long waveform[]) { API_RESULT Api_Result; …… for (int i=0; i<63; i++) { waveform[i] = VmeRead32(channel, chnAddr, &Api_Result); } return 0; } …… 6) In the DAQdll project, select Add\Add New 7) Edit the DAQdll.def file: LIBRARY DAQdll EXPORTS ;Explicit exports can go here GetWaveForm @1 These lines describe the DLL's properties. The first line gives the DLL's name; the second line uses the EXPORTS statement to list the exported functions; the third line is a comment statement; the fourth line is the name of the callable functions in the DLL. 8) Compile the program, and the DAQdll.dll dynamic link library file will be successfully generated for use. 2.2 LabVIEW Calling Dynamic Link Libraries LabVIEW provides four ways to call external program code, among which the dynamic link library mechanism is a common method for LabVIEW to call standard shared libraries and user-defined library functions. In specific implementation, the "Call Library Function Node" in the "Advanced" sub-template of the LabVIEW Function Template is used. The configuration of this node in this design is shown in Figure 2. [align=center]Figure 2. Configuration dialog box for calling library functions[/align] The items that need to be configured are: 1) Enter the path name of the DLL to be linked to this node, D:\DAQdll, in the "Library Name or Path" option; 2) Enter the name of the function to be called in the DLL file, GetWaveForm, in the "Function Name" option; 3) Select "C" in the "Calling Conventions" option, meaning the library being called is a library created using the C language; 4) Select "Run in UI Thread" in the options below the "Brouse" button, meaning the call process runs in the user interface thread; 5) In the parameter settings and return value settings, there are three options: Parameter Name, Parameter Type, and Data Type. The parameter type and data type should be set to be exactly the same as the type of the called function. The first parameter is the return value of the called function. Clicking "Add Parameter After" on the right allows you to add input parameters and output results to the function. Each parameter must have its own parameter type and data type set. After the settings are complete, the prototype of the called function will be displayed in the "Function Prototype" box. 3. Application of the Testing Software in Practice This design uses the aforementioned virtual instrument technology to implement the software design of the BESIII main drift chamber electronics testing system. Data acquisition and display of the testing system were performed, and the waveform reconstruction function of the testing system was completed, resulting in the result shown in Figure 3. When using this software, the input waveform can be adjusted by changing the parameters on the left, and the adjustment results are reflected in the reconstructed waveform on the front panel of the virtual instrument. For the same input waveform, the oscilloscope observation results and the reconstructed results displayed on the monitor by the virtual instrument match well. [align=center] Figure 3 Waveform Reconstruction Virtual Instrument Program[/align] 4. Conclusion Virtual instrument technology is a perfect combination of computer technology, software technology, and electronic technology, with software being the core of the virtual instrument. Using LabVIEW to call the dynamic link library mechanism compiled by VC++, a practical and reliable testing system was established on the VME bus. Applied to the BESIII main drift chamber electronics testing system, it provides an effective testing scheme for the system and achieves good results. 5. Innovations of the author: 1) By calling dynamic link libraries, data acquisition on the VME bus can be implemented using non-NI boards in the LabVIEW development environment, which can reduce the cost of purchasing data acquisition hardware when developing and testing systems. 2) The steps and points to note in the process of using CFLN are described in detail, which improves the success rate of program debugging for developers. References: [1]. Xue Defeng. Implementation of a virtual instrument based on the graphical programming language LabVIEW [J]. Automation and Instrumentation, 2003, 109(5): 24-26 [2]. Ji Shunxiang, Liu Wangsuo, et al. Application of external code interface technology of LabVIEW [J]. Microcomputer Information, 2006, 11-1: 205-207
Read next

CATDOLL 102CM Li Anime Doll

Height: 102cm Weight: 15.5kg Shoulder Width: 26cm Bust/Waist/Hip: 51/46/66cm Oral Depth: 3-5cm Vaginal Depth: 3-13cm An...

Articles 2026-02-22