LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

The iteration of for loop which is inside While loop

Hello, I'm not good at treating Labview so have many difficulties.

 

반복.jpg

This Block diagram is what I made.

 

'Set.Temp' and 'Delay' array means that the temperature i want to set via Temperature Controller device and time gap between former set temp. and next set temp.

 

What i want to do is setting up cycle of temperature change.

 

For instance, (1st) 50Celcius -> 60 -> 70 / -> (2nd) 50 -> 60 -> 70 -> End(Stop)

 

For this process, I created constant from Counter terminal, N, in for loop and tested via device.

 

However, the cycle kept going and going until I press stop button.

 

How can I control the number of iteration?

 

It'll be very helpful to me if you offer some advice. Thank you.

 

PS) I attached my vi file, too.

0 Kudos
Message 1 of 3
(2,757 Views)

First, I don't see a stop button in your VI.  Perhaps you meant to say that you've been hitting the Abort button on the toolbar.  You have a False constant wired to the stop terminal of your while loop.  That means the while loop and thus your VI is going to run forever until you abort it.  Mmmmm, interesting. The way you describe how your program is running is exactly how you programmed it.

 

I also don't see in your code where you created a "constant from counter  terminal N".

So you only want it to go through 2 cycles of those steps.  Well, why don't you turn that outer while loop into a For Loop and actually wire a constant of 2 to that N terminal.

0 Kudos
Message 2 of 3
(2,749 Views)
  • I am not sure why you still want to run the loops if there is no controller.
  • The "Device ID" is constant for the duration of the program, no need to put it in a shift register.
  • Your while loop will run forever.
  • Your FOR loop will run until the smaller autoindexing array runs out of elements. Then it will repeat after the while loop goes to the next iteration.
  • Enter typical values and make them the array defaults and save before attaching. Currently your arrays are empty, causing the FOR loop code to be skipped entirely.
  • You don't seem to do any error handling.
  • Your delays are integers, so use the correct datatype (U32).
  • You forgot to attach the subVIs. Are they from a commercial driver packet?
0 Kudos
Message 3 of 3
(2,725 Views)