12-13-2012 08:50 PM
Hi
i have booleans inside 1D array
and i have a numerc control, and a text file so that the entered
number going to be compared with the number in the text file
if the numbers match, the boolean of that number goes on
The question is that, when I enter another number the first
boolean goes off how can I maintain the first
boolean on .......
in the Attachments it is shown i entered 5,then the fourth boolean goes ON
but when i entered the second number "6", the last boolean goes ON
and the first boolean which was ON goes OFF
I wana keep both of them ON HOW ?
Solved! Go to Solution.
12-13-2012 08:56 PM
1. There is no need to reread the file on every iteration of the while loop. Do you expect it to change while your VI is running?
2. You need a wait statement in that loop. Right now you have a greedy loop which means it is running as fast as the CPU will allow it.
3. If you want to maintain data in the array, you need a shift register to store the array between iterations. Use Replace Array Subset to change the value of elements in the array.
12-13-2012 09:31 PM
12-13-2012 09:34 PM
Do we have to guess why it didn't work or can you post your updated code?
12-13-2012 09:43 PM
Why did you remove the loop?
As BillMe said, post your code.
12-13-2012 09:47 PM
code
12-13-2012 09:55 PM - edited 12-13-2012 09:55 PM
Go back to your original code and then re-read RavensFan's first response.
12-13-2012 10:35 PM
I added a wait statement and move the file outside the loop becz it is not going to change
12-13-2012 10:51 PM
Then also move the Read From Spreadsheet File to outside the loop. And what does your loop supposed to do?
12-13-2012 11:01 PM
The loop is to continoue recividng data from the user
ok Can you plz attach what the code should look like