LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do you loop a problem indefinitely?

Hi all,

 

I want to make something like:

time loop.png

 

Where A and B are both the current time x is a constant, z is a variable and y is change in time.  I know the > needs to enter into an "If" loop but I'm not sure how to keep A and B at the same time and how to get the integer y out of the "If" loop.  After the program solves for y I need it to continue looping inside the main system indefinitely.

 

Thank you for your help,

Falcon

0 Kudos
Message 1 of 9
(4,096 Views)

There is no such thing as a "if" loop in LabVIEW. We have FOR and WHILE, and you are probably looking for a while loop.

 

Take a tick count, feed it in a feedback node, and subtract the previous value from the feedback node output whenever the condition is met. Repeat forever.

 

(To get access to Y value in a different loop, use a local variable, action engine, or queue, for example.)

0 Kudos
Message 2 of 9
(4,091 Views)

Is this related to this problem? Please keep it all in one place, then. Thanks!

0 Kudos
Message 3 of 9
(4,084 Views)

Compare to infinitiy. The positive infinity block is in the numeric section. The greater than comparison is in the comparison section. Compare something to infinity and wire the output to the stop icon in the while loop found in the structures section. Whatever you put in the while loop will loop indefinitely. It's recommended that you put one of the wait blocks found in the timing section, wire zero to the wait vi or a small number that works for you. It wasn't that long ago that I was learning, so I remember where you are coming from.

0 Kudos
Message 4 of 9
(4,067 Views)

@gchristi1 wrote:

Compare to infinitiy. The positive infinity block is in the numeric section. The greater than comparison is in the comparison section. Compare something to infinity and wire the output to the stop icon in the while loop found in the structures section. 


What???? 😮 Are you really serious?

 

To loop forever, simply wire a FALSE diagram constant to the conditional terminal. No comparison needed. 😉

Message 5 of 9
(4,057 Views)

"Loop indefinatly" most often means "Loop until i press stop button" 🙂

 

Create a boolean control and wire it to the stop of a while loop.

 

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 6 of 9
(4,037 Views)

@gchristi1 wrote:

Compare to infinitiy. The positive infinity block is in the numeric section. The greater than comparison is in the comparison section. Compare something to infinity and wire the output to the stop icon in the while loop found in the structures section. Whatever you put in the while loop will loop indefinitely. It's recommended that you put one of the wait blocks found in the timing section, wire zero to the wait vi or a small number that works for you. It wasn't that long ago that I was learning, so I remember where you are coming from.


My computer is SO FAST it'll complete an infinite loop in under twenty seconds.  How can I handle that?

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

0 Kudos
Message 7 of 9
(4,006 Views)
Have you tried squaring the Inf constant? 😄
Message 8 of 9
(3,996 Views)

@altenbach wrote:
Have you tried squaring the Inf constant? 😄

Hehe. Smiley Very Happy

0 Kudos
Message 9 of 9
(3,962 Views)