LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

search for similiar string in the 2D array and display the result with different column

Solved!
Go to solution

Hi Baji,

 

I tried the method but it doesn't work, if i leave the new location (blank) and put the new location and click on the update button, it will still update as empty string. Can you advise on how to able to update after you put in the new location and click update button and still work? Please help! Attached the revised VI.  

Download All
0 Kudos
Message 11 of 14
(722 Views)

You have two major problems with your code you need to fix first.

 

1.  Your outer while loop has a false constant wire to the stop terminal.  That means the VI will run forever and can only be stopped by aborting the VI.

2.  Your inner while loop has the stop terminal controlled by a button outside the loop.  That means it will either run once if that button is true, or run forever if that button is false.  Even if you change the state of the button, the inner while loop won't see it because the reading of that control occurs before the while loop.  There is no reason you want to write to a file in a loop like that anyway.  Perhaps you meant the inner loop to be a case structure?

 

Other tips,

1.  Always give your controls a name and make the labels visible on the block diagram.  You can make the label not visible on the front panel if you want.  You have your update button which has no label showing on the block diagram.  When I made the label visible to see what that control was, I saw the control had an empty name.  By naming controls and making their labels visible on the BD, it is possible to know what that control is supposed to be just by looking at the block diagram.  Otherwise you are forced to double click it and see what control is highlight on the front panel.

 

2.  Make sure you wiring flows from left to write.  It makes it easier to determine what direction the data is flowing by inspecting the block diagram.  Also, use right-click/ Clean up wire to eliminate and unnecessary extra bends in the wiring.

0 Kudos
Message 12 of 14
(709 Views)
And you really need to clean up the wiring on that diagram. It's very sloppy and it just makes it very hard to read and understand. when I see something like that, I don't even try to analyze what might be wrong because it takes to much work to make it readable.
0 Kudos
Message 13 of 14
(705 Views)

I meant left to "right".

 

LV 8.6 as the code cleanup tool which does wonders for straightening out code.  I used it to clean up your code as well as fixing the problems I stated before.

 

Use this as the basis of your code.

 

I'm not sure you are using the correct architecture for this.  I think you should be using something that is event based.  As you have it now, the outer while loop will continuously run through the same data even when nothing changes.

Message Edited by Ravens Fan on 05-29-2009 10:14 AM
0 Kudos
Message 14 of 14
(700 Views)