HIL(Hardware in the loop) simulation of UAV(Unmanned Aerial Vehicle) plays an important role in flight control sysrtem development and algorithm verification. Taking the open source flight control system Pixhawk as the research object, this paper establishes a HIL system based on NI(National Instrument) hardware platform. The dynamic model and kinematic model are modeled through Simulink, the online management of simulation model is realized through Veristand, and the online display of model parameters and fault injection are realized through Labview. The simulation system can test the functional performance, reliability and safety of flight control system. The simulation results show that the simulation platform works reliably and has good real-time performance. It can effectively and reliably carry out the HIL of flight control system for UAV.