To realize the real-time measurement of masses of nanoparticles, virus molecules, organic macromolecules, and gas molecules, and to analyze their physical and chemical properties, a ZnO nanowire (NW) resonator operating at room temperature with an ultrahigh resonant frequency, real-time detection, and high precision was designed and developed in this study. The machining method is simple and easy to integrate into an integrated circuit. A closed-loop detection system based on a phase-locked loop (PLL) and frequency modulation technology (FM) was used to perform closed-loop testing of electromagnetically excited ZnO NW. The first-order resonance frequency of the resonator was 10.358 MHz, the quality factor Q value was about 600, the frequency fluctuation value fRMS was about 300 Hz, and the FM range could reach 200 kHz. The equivalent circuit model of the resonator was established, the parasitic parameters during the test were obtained, and the frequency accuracy and phase noise of the resonator were analyzed and tested. The experimental results show that the closed-loop system can automatically control the resonator in a wide range of frequency bands, with good tracking performance of the resonant frequency, small frequency fluctuation, and low phase noise level.