Showing results for 
Search instead for 
Did you mean: 

Changing X-axis label output of a spectral measurements block

Go to solution

Morning everyone, 


I'm fairly new to labview and have recently bumped into a problem using the spectral measurements block running an FFT on my signals.


I've three line-voltage waves with harmonics on them feeding into the signals input of the Spectral Measurements block and an FFT on the RMS magnitude as the output. This is breaking my wave down nicely into it's harmonic components. However, for what I'm trying to do I want these harmonics displayed as a percentage of the fundamental on Y-axis and the number of the harmonic on the X-axis i.e. if I have a fundamental at 60 Hz I would like the 2nd harmonic to be labeled as 2 on the x axis rather than 120 Hz, 3 for the third rather than 180 Hz etc.


I've managed to scale my X and Y axis and values respectively to give me a percentage of the fundamental at each specific harmonic, however, what I can't seem to do is re-label the X-axis as "Harmonic" rather than "Frequency". Everytime I try to change it, labview changes the axis straight back to "Frequency"? 


Unfortunately I cant share the VI but hope the description above makes it clear enough to understand!


Cheers Smiley Happy

0 Kudos
Message 1 of 7

It may be something as simple as changing the Time Scale factor to 1/fundamental, so a frequency of 60 becomes 1, 120 becomes 2, etc.  If this simple change doesn't work, make a copy of your VI (call the copy "For Forum"), strip out all the "proprietary bits" that have nothing to do with acquiring and post-processing your Secret Data, and post it, preferably with a Waveform Constant consisting of "Representative Data", the FFT, and the Graph/Chart you are using for the display.  We can then "see what you did" and can better "tell you how to do what you want to do".


Bob Schor

0 Kudos
Message 2 of 7

I'm guessing you are using express VIs. I suggest you ditch them. Then you can do whatever you want with the graph.

Certified LabVIEW Architect

G# - Award winning reference based OOP for LV, for free! VIPM Github
0 Kudos
Message 3 of 7

Thanks for the advice bob,


Yeah I'm dividing throughout by my fundamental frequency so it's giving me the harmonics correctly, it's literally just changing the actual label of the graph from "Frequency" to "harmonic" that doesn't want to play. 


Attached is screencap of the waveform graph front panel with a mock wave having been put into it - this is all I'm okay to share at the moment - circled is the issue

0 Kudos
Message 4 of 7

Yeah, at the moment I'm using the express VI - was hoping there may be a way to change it without having to change out the express VI, but think you may be right here unfortunately :/

0 Kudos
Message 5 of 7
Accepted by topic author 06thgroves
05-20-2019 06:15 AM

You can convert the dynamic data into a waveform and remove the attribute NI_ExpXDimension. Then you can rename the x-scale. See attached VI.

Certified LabVIEW Architect

G# - Award winning reference based OOP for LV, for free! VIPM Github
0 Kudos
Message 6 of 7

Brilliant thank you! does exactly what I was after

0 Kudos
Message 7 of 7