There is a HarmonicAnalyzer function in the Measurement Studio C++ CNiMath class and a HarmonicAnalyzer function in CVI. Unfortunately, there is no harmonic analyzer in the Measurement Studio ActiveX Analysis control. I believe there is a total harmonic distortion analyzer example with CVI as well.
Tony
NI - Measurement Studio