11-09-2010 05:48 PM
Hi!
I have to develop a code where I have to find the maximum value of a waveform and draw a line at 50% of the value. So I chose to find the amplitude of say 10 cycles of waveforms and found the maximum value out of the amplitudes.
But my real problem is, I have to use the maximum amplitude value that I get from the max. array VI and put it back in program to calculate the 50% value.
So is it possible to use the value from a numeric indicator and put it in a numeric control? Like in MATLAB or C, you give the variable a name and use it later to do any computations. Is it possible to do something similar in LabVIEW?
Solved! Go to Solution.
11-09-2010 08:30 PM
Yes but I don't see where you have to use a control or indicator. You can simply use the calclated value to set a cursor's position.
11-09-2010 11:16 PM
I wish I could, but the amplitude keeps changing everytime so the cursor position keeps changing too. So I am planning to calculate the max amplitude out of the loop and feed the same as DC offset in the loop so a line is displayed.
11-10-2010 12:06 AM
you can use local variable....I guess.
11-10-2010 01:18 AM
put it in a shift register and keep a running average, for example.
11-10-2010 01:39 AM - edited 11-10-2010 01:42 AM
Hi A BME,
Please review the attached .png and .vi files. If I understand correctly, you want to plot a 50% line of the maximum signal.
I've made a vi that simulates a signal and then plots the original signal, the 50% of max, and the true 50% amplitude (by adding the two signals, but you'll have to add "abs" before adding them, depending on your signals)
I hope that it'll help you....
11-10-2010 04:00 AM
Also you can modify the vi to account for a DC offset....
11-10-2010 09:44 AM
Hi!
Thank you very much for taking some time out. I have been trying to do this since 2 months and I am stuck right where I am.
The situation is, I have to calculate the amplitude of the irregular waveform for a few trials and then find the maximum amplitude out of the trials and display a line at whatever % of amplitude the user chooses. I tried using property nodes but I am getting Error 1055 for some unknown reason. Then I decided to draw the line using DC offset but it turns out it calculates the amplitude each time and so the line keeps dancing everytime. Now my challenge is to have the amplitude calculated for say, 20 loops and then calculate the max from that. I ran out of ideas so I am posting here. I am using LabVIEW version 8, and I'll upload a few of my attempts. I hope I am not troubling you'll much.
11-10-2010 10:02 AM
@A BME wrote:
I tried using property nodes but I am getting Error 1055 for some unknown reason.
That graph does not have any cursors, so a cursor reference is obviously invalid.
11-10-2010 10:09 AM
Hey! Thank you! Actually, I am new to LabVIEW so I am still learning all this. I did use it, but something wrong with my code. It's calculating the amplitude but is scaling the waveform instead. Sorry again for the trouble.