LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Condition for initializing a while loop

Hi,

My program consists of a search in an excel file of a value that I enter as a string So far I get the code that I put in the String control "OF", the program looks it up in an excel column. perfect, it works.

My problem is that I want it to start searching when I have already written in the string control what I want, and not at the beginning of execution, ie I need an initial condition for the while loop that until I have not entered the code , do not start looking. How can I do it? Thanks in advance.

 

I attach the program and the excel, if you want to try, put on the path the directory where the excel is downloaded or saved.

 

Captura.PNG

 

Download All
0 Kudos
Message 1 of 3
(3,354 Views)

If you don't want the while loop to run until the data is ready, then you will have to control the data flow from the OF control. For instance, you can put it in an event structure outside and to the left of the while loop, then have the event only trigger when OF has a value change.

0 Kudos
Message 2 of 3
(3,327 Views)

Do the other controls (path, start cluster) also change often during the run?

 

A greedy UI loop is always a bad idea! (see also)

 

I agree, you should use a value change event for the OF control (also make sure to set the string control to limit to single line). Maybe add value changes on the other controls to the same event case.

 

 

0 Kudos
Message 3 of 3
(3,319 Views)