LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to maintain data in a boolean array

Solved!
Go to solution

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 ?

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

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.

0 Kudos
Message 2 of 28
(3,451 Views)

Tx 

i removed the loop and i added Replace Array subset
but it didnt work

0 Kudos
Message 3 of 28
(3,445 Views)

Do we have to guess why it didn't work or can you post your updated code?

0 Kudos
Message 4 of 28
(3,442 Views)

Why did you remove the loop?

 

As BillMe said, post your code.

0 Kudos
Message 5 of 28
(3,436 Views)

code

 

Download All
0 Kudos
Message 6 of 28
(3,433 Views)

Go back to your original code and then re-read RavensFan's first response.

0 Kudos
Message 7 of 28
(3,427 Views)

I added a wait statement and move the file outside the loop  becz it is not going to change 


0 Kudos
Message 8 of 28
(3,418 Views)

Then also move the Read From Spreadsheet File to outside the loop. And what does your loop supposed to do?

0 Kudos
Message 9 of 28
(3,407 Views)

The loop is to continoue recividng data from the user
ok Can you plz attach what the code should look like

0 Kudos
Message 10 of 28
(3,404 Views)