‎08-12-2009 02:36 PM
Hello Everybody,
I am a beginner in Labview. I have a small circuit with MOSFET transistors where I command the duty cycle and I acquire the output power. So, I use a for loop (from 1 to 100%) in Labview to sweep the range of the duty cycle and I measure the output power and build an array (with 2 columns: the value of the duty cycle and the power associated) and a graph. I obtain the value of the maximum power with the array function max&min.
But I would like to obtain the value of the duty cycle corresponding to the maximum power and then block my circuit at this value, in a very short time.
I am trying to manage it by using a formula node and writing C code but as NI says, it is slower if I use a formula node instead of graphic programming, so that's why I am asking to you if there is a graphic function to solve my problem.
Thank you very much,
Anthony
‎08-12-2009 02:39 PM
‎08-12-2009 03:10 PM
Oh yes that's true. I am sorry.
Thank you!
‎08-13-2009 07:58 AM
Antho wrote:Oh yes that's true. I am sorry.
Thank you!
No need to be sorry. The polymorphism that Darin pointed out is one of the fun/mysterious parts of LV. There are few amoung us that keep track of which data types are supported by which operators so the more experienced will "just try it out". There have been many times when I was faced with a code challenge that "would be so much easier if..." and to my suprise it actually worked!
Sea Story Time!
One of my earliest G-Daddies was Jay Grassel (now with NI) who taught me, "If you don't know how an operator works, do a ctrl-n and try it out!"*
Ben
* ctrl-n = Open new VI
‎08-13-2009 09:44 AM
@Ben wrote:
No need to be sorry. The polymorphism that Darin pointed out is one of the fun/mysterious parts of LV.
I could hardly fail to disagree with Ben less...![]()
‎08-13-2009 10:22 AM
Thank you for the advice, it's better now to understand the functions.
But I have another question about the array max&min function. Is there a mean to obtain the value of the index corresponding to half of the value of the maximum. Because I have Pmax and the index, and I would like the value of the index for Pmax/2 too.
Thank you
Anthony
‎08-13-2009 10:26 AM
Take the value of Pmax/2 and subtract it from all values in our array and take the absolute value. Then use another Array max min an look for the minimum since that will be the value closest to Pmax/2.
Ben
‎08-13-2009 10:40 AM
Yes it works! Thank you very much!
Anthony
‎08-13-2009 10:40 AM - edited ‎08-13-2009 10:41 AM
Be aware that the "Min Max" vi returns the maximum value from the array irrespective of the column.
So if you want the maximum Power, I would first get the column with Power data and then use the "Min Max" vi.
But not on the complete 2D array.
If one day you're power will be less than 100W, the suggest solution will return 100, not from the power but from 100% duty cycle!
Watch out!!!
‎08-13-2009 11:50 AM
Ben wrote:
One of my earliest G-Daddies was Jay Grassel (now with NI) who taught me, "If you don't know how an operator works, do a ctrl-n and try it out!"*
I have been meaning to do this for a while, but Ben's post finally motivated me to start a new thread with this in mind. It is my LV equivalent of the Word of the Day calendar.