Conduct FFT in C++block and output spectrum

Hi, I’m sorry I might be asking some stupid questions, any suggestions would be appreciated.

I build a very simple buck converter, and I need to do FFT to its Vsw in the C++block. I tried to coding in the block and it could compile, however the C++block outputs nothing. Does this block only output time domain waveforms? How can I output the spectrum from the C++block (Magnitude vs. frequency of Vsw)

FFT is performed on a time-domain signal (i.e. transient simulation). Your question is whether your C++ block is not outputting anything in the transient simulation, or if you have a signal from the C++ block but don’t know how to perform an FFT in the waveform viewer after probing that signal.