Share this

Design of a LabVIEW-based simulation system

2026-04-06 06:21:38 · · #1

0 Introduction

With the advancement of modern science and technology, the structure of equipment is becoming more and more complex, the level of intelligence is also increasing, the operating procedures are strict, and the level of operators is very high. If training is combined with actual equipment, it is limited by the venue, funding and the maintenance of the equipment itself. Simulation training is safe, economical, controllable, repeatable, risk-free, and not limited by climate conditions and venue space. Therefore, it is necessary to design a simulation system suitable for operation training. However, due to the specific instruments of many devices, it is not easy to purchase. Using other instruments will cause errors in appearance and functional gaps. However, with the concept of virtual measuring instruments (VI) proposed by National Instruments (NI), a major change has been triggered in the traditional instrument field, enabling computer and network technologies to penetrate the instrument field and combine with instrument technology, completely breaking the situation that traditional instruments can only be defined by manufacturers and cannot be changed by users [1]. LabVIEW is a graphical programming software developed by NI and is currently the most successful and widely used virtual instrument software development environment [2]. LabVIEW is a technologically advanced graphical programming language and development environment. Its application scope covers the entire development process from product design to manufacturing and is known as "the language of engineers" [3]. Virtual instrument systems generally consist of two parts: hardware and software [4]. The hardware part consists of a computer and modular functional hardware, and there are various configuration methods depending on the different modular functional hardware. The software part is based on instrument drivers, interface software and application programs, which control and realize functions such as data acquisition, analysis, processing and display. We can independently design various types of virtual instruments and display interfaces. The actual simulation system includes data acquisition system, data transmission protocol, data parsing and data display.

1. Data Collection

In practical data acquisition systems, the secondary output signals of AC current or voltage transformers generally need to be rectified into DC signals. Direct diode rectification can affect low-end accuracy due to the forward voltage drop of the diode. Therefore, active rectification is used in applications with higher requirements. The circuit diagram of the active rectification scheme used in this paper is shown in Figure 1. R1 is the sampling resistor, selected according to the transformer's specifications. The diode is an IN4148, the IC is an LM324, and the operating power supply is ±5V. The P1 and P2 interfaces are connected to the transformer.

Figure 1 Active rectifier circuit diagram

The AC voltage transformers used in this system are TV16E type epoxy-encapsulated precision voltage transformers from Beijing Yaohua Dechang Electronics Co., Ltd.; the AC current transformers are TA3523FT type epoxy-encapsulated four-range current transformers from Beijing Yaohua Dechang Electronics Co., Ltd.; and the DC current transformers are JT0.01T19 type current transformers from Chengdu Jingfeng Electronics Co., Ltd.

2. Data Transmission and Parsing

The data collected by the current transformer is converted into a 0-5V DC signal by the acquisition board, and then passes through the control acquisition board. This board's high-precision A/D converter chip converts the analog signal to a digital signal. The digital signal is then processed by a high-precision AVR microcontroller. The data is transmitted to the host computer in real time via reliable UART serial communication, generating a series of strings. The system continuously reads the data collected by the acquisition board, and then communicates with LabVIEW via the network card.

Since the source and terminal do not need to establish a connection before transmitting data using the UDP protocol, there is no need to maintain the connection state, including the sending and receiving state. Therefore, a server can transmit the same message to multiple clients at the same time. Although the UDP transmission performance is unreliable, it is an ideal protocol for broadcasting information in situations where the real-time and accuracy requirements of data transmission are not very strict [5]. This system requires real-time display, and UDP can fully meet the requirements.

Since this system uses a display, it employs a UDP protocol to receive data. As shown in Figure 2, the program mainly consists of three parts: opening UDP, reading UDP data, and closing UDP.

Figure 2 UDP Protocol Data Reception Procedure

Before receiving data, first open a UDP port, setting the port (the port on the local host where the UDP socket connection will be created) to 6350. The network address and connection ID do not need to be set. Use a while loop to receive data. UDPRead is the core function for receiving data, with a maximum value set to 400 and a timeout of 1 millisecond. Close the UDP port and connect it sequentially to the port used for reading UDP data.

Data is transmitted to LabVIEW via the UDP protocol. A parsing program, as shown in Figure 3, parses the received string into the data that each virtual instrument needs to display, and then displays it through the virtual instruments.

Figure 3 Data parsing procedure

3. Data Display

Due to the special shape and performance of the selected instrument, there is no ready-made virtual instrument, and it needs to be made by ourselves during simulation.

3.1 Creation of Virtual Instruments

Select a photo of the instrument you want to use and draw it in Photoshop. Open LabVIEW, then click "Edit" to "Import Image to Clipboard," and then press Ctrl+V to copy it to the LabVIEW front panel, as shown in Figure 4(a). In the Numeric Controls, select "Gazette," and then select the appropriate range, as shown in Figure 4(b). Right-click on "Ruler," select the blank option in "Style," and then open the Tool Palette. Change the dial and frame color to transparent, and change the pointer to the desired color (black), as shown in Figure 4(c). Combine the gauge and pointer, move the image to the front, and then lock all three together. A suitable virtual instrument interface is now created, as shown in Figure 4(d). Follow this general procedure for the remaining instruments.

Figure 4. The process of creating a virtual instrument

As can be seen from Figure 4(a), the reading of the dial is not linear. To construct a mathematical model of the panel, practice shows that using piecewise functions is a convenient, concise and efficient method. The part of the ammeter program in the flowchart of Figure 4 is shown in Figure 5.

Figure 5 Part of the program for the nonlinear instrument.

We can use mathematical operations to give the function expression of the dial, and then use conditional statements to represent it segment by segment. In this way, we can accurately and clearly drive the movement of the pointer.

3.2 Implementation and Display of the Display Interface

All the virtual instruments were combined onto a single front panel, and the UDP protocol data receiving program, instrument program, and data parsing program were integrated into a single program flowchart. Data was acquired and transformed by the data acquisition board, controlled by the industrial control computer, and transmitted to the host computer in real time via UART serial communication. A series of strings were then generated and entered into the program. The result after running the program is shown in Figure 6.

Figure 6. Operation display interface of the power supply vehicle simulation equipment.

Conclusion

This system is applied to a semi-physical power supply vehicle simulation system. It has an aesthetically pleasing appearance and is compatible with the original machine. During operation, the system is stable, with minimal data loss and accurate display. It provides a reference for using LabVIEW to create display interfaces.

Read next

CATDOLL CATDOLL 115CM Nanako Silicone Doll

Height: 115 Silicone Weight: 22kg Shoulder Width: 29cm Bust/Waist/Hip: 57/53/64cm Oral Depth: N/A Vaginal Depth: 3-15cm...

Articles 2026-02-22