Engine control and management systems are the earliest applications of control technology in road vehicles. The main aim of an engine control system is to achieve a desired level of fuel economy while keeping exhaust emissions at acceptable levels. An engine is a very complicated system with a large number of variables, nonlinear and time varying behaviour. The conflicting relation between fuel economy and emission reduction further complicates the situation. Reduction of the typically large number of experimental calibration tests requires the development of reliable and accurate models. Real time hardware in the loop testing of engine electronic control units also mandates the engine model to be real time capable. First, an MVEM based Simulink engine blockset prepared for this purpose is explained in this paper. The use of a virtual engine in a hardware in the loop real time simulation of engine speed control is the main result reported in this paper.