1 Introduction
The development of computer and its interface technology and the shortcomings of traditional test and measurement instrument systems have made computer-based virtual instrument equipment increasingly dominant in test and measurement instruments. Virtual instrument systems have been widely used in industry for their platform versatility, expandability, easy upgrade and high intelligence. Inserting data acquisition boards based on PC bus (ISA, PCI) into PCs and industrial control computers to form hardware systems, and writing Windows system platform drivers and soft panels to implement software functions have become the main solutions in the industry.
However, in the practice of testing tasks in the field and in harsh environments, we found that virtual instruments based on PCs or industrial computers exposed many problems, such as: large size, inconvenient to carry; card-type structure, easy to loosen and not tighten; mechanical hard disk as the main storage medium, poor seismic performance, etc.
The embedded computing platform characterized by 32-bit embedded microprocessors and embedded operating systems has brought computing into the post-PC era. The small size and high reliability of embedded systems can meet the needs of portable virtual instruments in field operations and harsh environments. Based on the embedded computing platform, designing a virtual instrument system has become a new idea for building a test system.
By building an embedded computing platform based on PC104 bus and adding instrument cards and their functional programs, we have realized a variety of test instruments for radar electronic equipment. The technical problems that need to be solved in building virtual instruments based on embedded systems are concentrated in the construction of system platforms, the design of interfaces and drivers, and the design of soft panels.
2 Hardware System Composition
The hardware system includes an embedded mainboard, an instrument function board, a Flash storage medium (DOC or CF card), an LCD screen, a touch screen, and a signal interface, as shown in Figure 1. The LCD screen and the touch screen realize human-computer interaction, the signal interface is used to couple the test signal, the embedded mainboard is used as a control and calculation unit, and the instrument function board realizes the functions of the specific instrument.
The components are stacked in the following order: touch screen, LCD screen, PC104 motherboard, oscilloscope card, multimeter card. The function cards and embedded motherboard are mechanically and electrically interconnected through the PC104 bus in a stacked manner. This approach has the following benefits:
1. Highly tight electrical contact. The circuit boards are deeply connected through multiple rows of pins, which is much tighter than the ISA and PCI slot connections.
2. The mechanical structure is firm. The circuit boards are tightly connected with four studs, making the mechanical connection between the boards very firm and without shaking.
3. The electrical characteristics of the PC104 pins are fully compatible with ISA, and the electrical characteristics of the PC104Plus pins are fully compatible with PCI, so that the functional boards designed based on ISA or PCI bus can be reused from the electrical principle, which is conducive to the smooth transition of the system transformation process.
Abandoning the hard disk and using DOC or CF card as external storage media can also greatly improve the system's ability to resist vibration and impact.
The use of the hardware system described above can provide hardware support for a small and reliable virtual instrument system, but the resulting problems such as small system storage capacity and limited resources have brought difficulties to the design of the software system. An embedded operating system must be used, and software programming must consider small size and high efficiency.
3. Software System Design
We use embedded Linux as the operating system and write the instrument driver under the Linux platform. We use TinyX and GTK+ as the graphical interface solution to implement the instrument soft panel.
3.1. Embedded Linux system
We use an open source Linux system and use the compilation options to cut unnecessary functional modules to obtain a kernel module of about 500K. We use busybox to replace the shell and add libraries such as glibc.o to the system to build a 4M Linux operating system. The literature [1] on building embedded Linux systems has detailed introductions and guidance.
3.2.IO programming under Linux
The driver of the instrument card is implemented by port reading and writing. The operation method of the port under Linux is in usr/include/asm/io.h. Since the port reading and writing functions are some inline macros, when writing the port reading and writing program, you only need to add: #include and do not need to include any additional library files. In addition, due to a limitation of the gcc compiler, when writing a program containing port reading and writing code, either turn on the compiler optimization option (use gcc?O1 or higher options), or add: #defineexternstatic before #include
Before reading or writing a port, you must first obtain the permission to read or write the port through the ioperm() function. The usage of this function is as follows:
ioperm(from,num,turn_on)
If turn_on=1, it means to obtain the read and write permissions of num ports starting from from. For example, ioperm(0x300,5,1) means to obtain the read and write permissions of 5 ports from port 0x300 to 0x304. The last parameter turn_on indicates whether to obtain the read and write permissions (turn_on=1 means to obtain, turn_on=0 means to release). The ioperm() function is usually called during the hardware initialization phase of the program.
The ioperm() function needs to be run as root or the program must be given root privileges using seuid.
The port is read using the inb(port) and inw(port) functions, where inb(port) reads an 8-bit port and inw(port) reads a 16-bit port.
The write operation of 8-bit and 16-bit ports is completed by the functions outb(value,port) and outw(value,port) respectively. The first parameter of each function indicates the value to be written, and the second parameter indicates the port address.
The functions of the macros inb_p(), outb_p(), inw_p() and outw_p() are the same as the corresponding four port read and write functions mentioned above, except that a certain delay is added after the port operation to ensure reliable reading and writing. You can get a delay of about 4 microseconds by adding: #defineREALLY_SLOW_IO before #include.
3.3.Soft panel programming based on TinyX and Gtk+
The design of the instrument soft panel involves the selection and programming of GUI under Linux. Considering the maturity of XWindows and its consistency with the desktop system, we choose the streamlined XWindows system TinyX as the underlying GUI solution. We use the Gtk+1.2 library as the control set to develop the instrument soft panel program.
The graphical interface development solution based on TinyX and Gtk+ library makes the development of soft panel closer to the development based on Gnome in the desktop environment. Many Linux tools in the desktop environment can be used directly.
The Gtk+ graphics library is the underlying foundation of the GNOME desktop system. It contains a relatively complete set of GUI controls (GtkWidgets). Based on the object-oriented approach, GTK+ uses C language to implement a set of object systems and message and callback mechanisms, and integrates the entire graphics control set into the object framework, making it easier to expand the control set.
In response to the application needs in the field of virtual instruments, a control set of common GUI units can be built. We have developed panel controls for instruments such as oscilloscopes and signal sources and some key GUI unit controls in the form of GtkWidgets. These are conducive to users' secondary development and reuse of software units.
4 Conclusion
Based on the embedded motherboard and embedded software environment, we provide a general solution for constructing virtual instruments. At the same time, by building a GUI environment based on TinyX and Gtk+ libraries, plus a series of panel unit controls developed independently, we provide support for the development of virtual instrument soft panels.
Based on the above solution, we have developed a radar fault detector that integrates the functions of an oscilloscope, a multimeter, a microwave signal source and other instruments.
Practice in the military's field combat environment shows that the system has a solid mechanical structure, high reliability, and is easy to carry and use.
Previous article:Design Method of Parametric Array Test System Based on LabVIEW
Next article:Control system of vehicle motor test platform based on virtual instrument
- Popular Resources
- Popular amplifiers
- Real-time driver monitoring system via modal and viewpoint analysis
- Machine Learning and Embedded Computing in Advanced Driver Assistance Systems (ADAS)
- Chip Manufacturing: A Practical Tutorial on Semiconductor Process Technology (Sixth Edition)
- Embedded Systems with RISC-V and ESP32-C3 - A practical introduction to architecture, peripherals and
- Keysight Technologies Helps Samsung Electronics Successfully Validate FiRa® 2.0 Safe Distance Measurement Test Case
- From probes to power supplies, Tektronix is leading the way in comprehensive innovation in power electronics testing
- Seizing the Opportunities in the Chinese Application Market: NI's Challenges and Answers
- Tektronix Launches Breakthrough Power Measurement Tools to Accelerate Innovation as Global Electrification Accelerates
- Not all oscilloscopes are created equal: Why ADCs and low noise floor matter
- Enable TekHSI high-speed interface function to accelerate the remote transmission of waveform data
- How to measure the quality of soft start thyristor
- How to use a multimeter to judge whether a soft starter is good or bad
- What are the advantages and disadvantages of non-contact temperature sensors?
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- Understanding damper actuators and what drives them in automotive HVAC systems
- [TI recommended course] #Live replay: Application of TI millimeter wave sensors in smart home#
- Anti-reverse connection design for low power consumption Anti-reverse connection and anti-backflow circuit design,,,,
- Three relays control two motors through a single chip microcomputer
- [GD32450I-EVAL] Unpack and power on to build a development environment
- 【Drawing board experience】 PCB design skills of switching power supply
- The history and concept of radio and its key technologies
- Help
- Failed experience of using BlueNRG-1 to make a BLE chicken-eating tool
- Exploiting software vulnerabilities! 19-year-old boy remotely hacked into Tesla