Embedding a C/C++ Interpreter Into Virtual Instruments for Script Blocks
Hong Duan, Harry Hui Cheng · Volume 4: ASME/IEEE International Conference on Mechatronic and Embedded Systems and Applications and the 19th Reliability, Stress Analysis, and Failure Prevention Conference · 2007
Virtual Instruments (VIs) are popularly used for testing, measurement, simulation, and control of instruments and mechatronic systems. A virtual instrument is typically programmed using graphical icons, called a G language. Although using graphical icons is simple and easy, it is quite inefficient for development of applications with special requirements and operations which have not been implemented in advance in a VI. It would be desirable to combine the ease of use of the G language with traditional programming for development of complicated applications in VI. This paper describes the design, implementation and application of embedding a C/C++ interpreter into a VI for scripting blocks in C/C++. With a C/C++ interpreter enabled VI, complicated algorithms and operations can be achieved using a script code associated with a graphical icon called the C script block. The ideas are illustrated by embedding a C/C++ interpreter into a LabVIEW platform through both techniques of code interface node (CIN) and dynamic link library (DLL) available for interfacing external programs in LabVIEW. The application of script blocks in VI is illustrated by the harmonic wavelet analysis for the vibration of a traffic detection system on the highway. Embedding a C/C++ interpreter into VIs has a great potential for enhancing the VIs with easy programmability for handling complicated applications.