This paper presents the application of a hierarchical control scheme for islanded AC microgrids with a primary droop control and a centralized extended optimal power flow control. The centralized control is responsible for computing and sending, in an online manner, the control references to the primary controls in order to achieve three operational goals, i.e., improvement of the global efficiency, voltage regulation through reactive power management and compliance of the restrictions regarding the generation units capacities. Two case studies are defined and online tested in a laboratory-scaled microgrid implemented in the Microgrid Laboratory at Aalborg University. The primary controllers are included in a real-time simulation platform (dSPACE 1006), while the extended optimal power flow is conducted in a central controller by using a Smart Meter and LabVIEW for data acquisition and MATLAB for its implementation, taking into account load and capacity profiles. The obtained results show the reliability of the proposed scheme in a real system and its advantages over the conventional droop control.