The mathematical model of electronic throttle was established in this paper, and a sliding mode control algorithm was designed based on the model. The simulation made to validate the control algorithm was achieved by LabVIEW Control and Simulation Toolkit. The control program was converted to C code and downloaded to the controller by LabVIEW embedded module. The simulation results showed that the controller met the ideal effect. There are many advantages of this kind of development mode, such as graphical programming, rich function module and code automatic generation. The development efficiency and quality can be increased.