LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

For loop initialization before another for loop commanded by an If condition

Hello Everybody,

 

 I have made a program which sweeps the total range of the duty cycle of a command signal, for a MOSFET circuit. I use a for loop, and I measure the output power, find the maximum power and block my circuit at this value.

 But I want that this loop serves as an initialization and I would like to add another For loop which starts with an If condition and sweeps a smaller part of the duty cycle. I have a voltage command, and I want that the second loop starts when the voltage command decreases.

 

So my question is about the structure to use? I can do it by using a formula node, but I need a very fast program. In fact, when the voltage command decreases, I need to find the maximum output power and to block my circuit at the value in 1s.

 

And in general, have you got advices to have a really fast program? (not use graph, tables,....?)

 

Thank you very much,

 

Anthony

0 Kudos
Message 1 of 5
(2,672 Views)
I'm not sure of your problem, but I would suggest considering Case Structure in which you can put your second for loop. If you feel there will be excessive code copy, make the for loop a SubVI.
0 Kudos
Message 2 of 5
(2,638 Views)

My problem is more about my condition. I would like that my second loop starts when there is a variation of 10% of the value of the voltage command without using a formula node. And I would like that the program runs fast.

 

Thank you,

 

Anthony

0 Kudos
Message 3 of 5
(2,628 Views)
What are the contents of the Formula node? Is it difficult to 'G'-code them?
0 Kudos
Message 4 of 5
(2,614 Views)

NitinD wrote:
What are the contents of the Formula node?

 

That is the right question that I was also going to ask!!!

 

Also can you put a version of the code you already have here?

It will be easier to understand your needs with the code you have than with some literal description Smiley Happy

0 Kudos
Message 5 of 5
(2,612 Views)