This paper describes an investigative hardware-in-the-loop simulation (HILS) effort through virtual instrumentation on longitudinal control of an unmanned aerial vehicle (UAV). The proportional-integral-differential (PID) controller and fuzzy logic controller (FLC) are designed for the pitch angle hold mode of autopilot; moreover, they are implemented by an embedded real-time control system as a prototype autopilot and tested by hardware-in-the-loop simulation. The hardware configuration of HILS is composed of a personal computer, an embedded real-time control system, several data acquisition devices, servo and sensor unit. The real-time control and data acquisition tasks in HILS is carried out by virtual instruments that is developed by graphical programming language LabVIEW. HILS provides a platform for researchers to correct and improve their design efficiently. The closed-loop performance between PID controller and FLC is evaluated in HILS. The results demonstrate that in the presence of unmodelled dynamics and nonlinear saturation the FLC has an excellent robust performance.