Design of a Power Grid Integrated Parameter Measurement and Control System Based on LabVIEW
2026-04-06 06:01:20··#1
Abstract : LabVIEW virtual instrument software is widely used in the development of measurement and control systems. This paper introduces the technology of customizing the window style of a power grid in LabVIEW, including the customization and use of menus, toolbars, and status bars, as well as the use of databases. This has certain guiding significance for designing virtual instruments with many functions and complex control. In particular, LabVIEW's event programming capability provides a powerful method for developing various human-machine interfaces. The establishment of a Microsoft Access database and its connection with the software provide strong help and support for the implementation of LabVIEW functions. Keywords: Virtual instrument; LabVIEW; Interface Virtual instruments are a product of the development of computer technology and digital signal processing technology. They have advantages such as open functions, flexible design, good network support, and low price, and have achieved rapid development and widespread application in recent years. As a general-purpose graphical programming language, its essence is to make full use of the latest computer technology to realize and extend the functions of traditional instruments. Virtual instruments are designed and defined by the user, combining general modules with one or more functions and calling software modules with different functions to form different instrument functions to meet their specific needs. This article introduces the methods and steps of LabVIEW in software design through the software design of the integrated parameter measurement and control system of the power grid; LabVIEW software development steps: A. Create front panel: Select the required controls from the control panel, place them on the front panel container in a regular manner, organize their relative positions to make the front panel beautiful, and set the properties and display mode of each control. B. Create data flow diagram: Select the required function icons from the function panel, and connect them in order according to the function to be implemented to create a complete data flow diagram. C. Perform function debugging and analysis: Debug the program in various ways, modify the data flow diagram until it meets the requirements . 1. Login settings The software login settings use a sequential structure to control the interface to be displayed only after successful login. The user login subVI property is set to start when the software runs, pop up the login interface, and enter the password to enter the system. 2. Menu settings LabVIEW window itself has the function of customizing menus. Select "Edit - Runtime Menu" in the main menu of the VI front panel, and the menu editing dialog box will pop up. The user customizes the menu in the dialog box according to the requirements [1], as shown in Figure 1.2. The menu response procedure is completed by editing the event structure. In the event dialog box, the event source corresponding to this VI is set to menu selection (user). Only the item tag is left in the selection item. The corresponding event is placed in the event structure. The item tag is connected to the condition structure to select the corresponding instruction, as shown in Figure 3. [align=center] Figure 3. Menu Design[/align] In the custom menu, the menu items are created as needed. After completing the menu customization, the corresponding SUBVI is designed for each sub-menu, and each sub-VI has its own user interface. Create a new folder and save the things that need to be saved during the design process in this folder. Write the menu response procedure. Use the menu selection node provided by LabVIEW to get the selected menu item, and then write the function program corresponding to the menu option in a condition structure. When the VI runs, the condition structure executes the corresponding function program according to the menu returned by the menu selection node [2]. 3. Toolbar On this software interface, the buttons on the toolbar cannot be found in LabVIEW controls, so custom controls are required. Cut the corresponding icon and put it into the drawing tool. Use the cut tool to select the image and press Ctrl+C to copy it to the clipboard. If you want to make a better effect, you can use software such as Photoshop to modify it. Edit the control, put the OK button on the LabVIEW front panel, right-click and select "Advanced - Custom" [3]. After clicking, enter the editing state, click the button in the toolbar to make it become, right-click on the largest outline, select Import Image from Clipboard, and you will have made the image we prepared earlier into a control. 4. Database In the Add User and Add Device subVI, a database is required. Here, Microsoft Access database is used. It is a relational database that organizes the database according to the relational data model. The LabVIEW development environment itself does not have database access function. The LabVIEW SQL Toolkit, an additional toolkit from NI, is used for database access. This toolkit is relatively expensive and not suitable for application. Therefore, we use LabSQL Toolkit, a free, multi-database, cross-platform LabVIEW database access tool developed by NI (National Instruments) to access the database. Create a new folder named LabSQL in the user.lib folder in the LabVIEW installation directory, put the downloaded LabSQL in this folder, and when you run it again, the LabVIEW function module will automatically load LabSQL. LabSQL connects to the database via ODBC [4]. Users need to specify the data source name and driver in ODBC. Therefore, before using LabSQL, you must first create a DSN in the ODBC data source of the Windows operating system. The connection between LabSQL and the database is based on the DSN. In the Windows operating system's Control Panel, click Performance and Maintenance → Administrative Tools → Data Sources. The ODBC Data Source Administrator will pop up as shown in Figure 4. [align=center] Figure 4. Data Source Administrator[/align] [align=center] Figure 5. Creating a New Data Source[/align] Click the "Add (D)..." button in the "System DSN" tab. In the subsequent "Create New Data Source" interface (Figure 5), select "Microsoft Access Driver (*.mdb)" from the driver list and click the "Finish" button. In the dialog box that appears (Figure 6), create a name for the DSN in the "Data Source Name (N)" field, click the "Select" button to select the database to be accessed, and click the "OK" button to finish. [align=center] Figure 6. New Data Source[/align] [align=center] Figure 7. Database Operation Steps[/align] After completing the above settings, you can perform database operations. The basic steps are shown in Figure 7. First, create a Connection object using ADO Connection Create.vi, and then establish a connection to the database using ADO Connection Open.vi. The database to connect to is controlled by the string ConnectionString, which is entered in the front panel controls. In the block diagram, use Format Into Strings to generate SQL commands, then connect them to ADOConnection Execute.vi for execution. Create a Recordset object using ADO Recordset Creat.vi, then open it using ADO Recordset Open.vi, and simultaneously use SQL query commands to retrieve all or part of the records in the database table. Use function selection buttons to control database operations. Close the connection to the database using ADO RecordsetClose.vi and ADO Connection Close.vi, and delete the Connection object using ADO ConnectionDestroy.vi. In design applications, clicking the "Add" button in the design interface will bring up a user registration dialog box, as shown in Figure 8. [align=center] Figure 8. User Registration Front and Back Panels[/align] In sub-VIs such as Hourly Data, to switch the display of test images within the same interface, use tab controls to achieve this function, as shown in Figure 9. [align=center] Figure 9. Hourly Data[/align] [align=center] Figure 10. Power Grid Integrated Parameter Measurement and Control System Interface[/align] The final interface is shown in Figure 10. 5. Conclusion The design of a virtual instrument's soft panel should provide operators with a virtual instrument operating environment. A user-friendly panel is one of the key indicators of a successful virtual instrument design. A virtual instrument integrated system consists of multiple virtual instruments, each controlled by a soft panel. The user's operation of the virtual instrument involves manipulating the soft panel with a mouse. Given fixed hardware resources such as computers and instruments, different virtual instruments correspond to different application programs. The core idea of virtual instrument design is to implement some or all of the instrument's functions through software. Employing object-oriented design methods and utilizing a visual graphical programming environment to establish a graphical user interface is crucial for achieving automation and intelligence in instruments. References [1] Yang Leping, et al. Advanced programming of LabVIEW [M]. Tsinghua University Press, 2003 [2] Li Haitao, et al. Customizing virtual instrument panel with Windows standard window style in LabVIEW [J]. Industrial Control Computer, 2005, Vol. 18, No. 2, p. 60 [3] Zhu Xiaohua, et al. Constructing virtual instruments with ActiveX control [J]. Computer Applications, December 1998, Vol. 18, No. 12, p. 21 [4] Li Gang, Lin Ling. LabVIEW - Easy-to-learn and easy-to-use computer graphical programming language [M]. Beijing: Beijing University of Aeronautics and Astronautics Press, 2001 Design of power grid integrated parameter measurement and control system based on LabVIEW Full text download