01-23-2013 06:07 AM
Hi everybody,
I uploaded a VI snippet to facilitate the response for you.
In this VI, I want to draw the curve of THD as a function of time. I found some problems to configure the time. I tried to put the absolute and the relative time but it is the same ( I have always a point in the midle of the curve). I can see the THD variable is changing but I am unable to put the time in the x -axis.
I have also another problem: I want to go across a for loop to make some manipulations ( I put an empty for loop). Then when I return from a 1D arry to dynamic data, I found NaN in the THD.
Please Can you help me to sort this out.
Solved! Go to Solution.
01-23-2013 09:29 AM
You have no time data since you threw it away with the conversion to DBL. Dynamic data is just evil so if you want to retain timing information, convert to a waveform data type. You can easily get the Y array and convert back to a waveform with the Get Waveform Components and Build Waveform functions.
01-23-2013 11:22 AM
Thank you,
It is working now.
But I still find problem to see the graph. Actually, I did some changements then I clicked undo but I found the graph drawn just in the right side in the graph. I tried to change the autoscale but nothing happens. I observed this "bug" several times before. I do not know how to get rid of it.
Thanks.
01-23-2013 11:28 AM
You need to post your code.
01-24-2013 03:25 AM
Sorry for the delay,
You can find my code as snippet VI attached. You will see I have NaN in the THD.
Best regards,
01-24-2013 09:46 AM
Just keep it simple in this case. Do not do any conversion from/to dynamic data and remove the for loop. Just wire the dynamic data straight through to the multiply.
01-24-2013 09:59 AM - edited 01-24-2013 09:59 AM
The Express VIs and the Dynamic Data Type (which Dennis correctly characterizes as evil) mask so much of what is going on.
Here is a modification of your VI which
1. Converts the DDT signals to a waveform immediately on coming from the Simulate Signal VI.
2. Extracts the array component for your log distortion.
3. Reconstructs the waveform to preserve timing information.
4. Uses the SINAD Analyzer.vi from the Signal Processing >> Waveform Measurements palette to get THD as a DBL scalar, not a mystery DDT.
5. Added Wait time control.
6. Added graphs to visualize signals. Added chart for THD visualization.
7. Added a clippler with a front panel control so the distortion can be changed significantly.
Lynn
Note when I saved this back to version 8, I got some warnings, so some things may not work correctly.
01-24-2013 11:13 AM
I don't know how can thank you Lynn. You helped me a lot. Your response is really professional and amazing.
Also, thanks for Dennis_Knutson.
I am wondering when I will become so good as you in Labview coding.
01-24-2013 11:31 AM
Both Dennis and I have been working with LabVIEW for many years. The key is not so much how long but how smart you work. Learn from your mistakes, take classes when you can, and learn from those who have already learned about it. Some of the experts on the Forum are relatively new at LabVIEW programming.
Lynn