07-09-2009 08:58 AM
Hey,
In my set-up, i need a log-in facility that pops up a sub-vi if successful.
I modified the Login Dialog that comes with LabView examples, and it works fine by poping up the dialog box.
I made a very simple sample sub VI which just displays a string and a stop button.
I expected the sub VI to close after I click the stop button, but there is quite a delay, and sometimes i need to press the stop button twice.
Just wondering is there an easy setup change that will close the sub VI immediately once i hit stop. I need the main VI to continue running then.
Any help would be appreciated.
I've attached the VI's
Rkll
07-09-2009 09:05 AM
07-09-2009 09:06 AM
You should change the mechanical action of your booleans to Latch When Released and the while loop in the subVI needs a Wait (ms) function to avoid hogging the cpu.
p.s. that bit of code with the Select functions is silly. Just wire directly to the case statement.
07-09-2009 10:16 AM
Tanx for the swift response, I works with the sample sub-VI.
However when i tried the actual VI, i get the same problem. I think its because in the actual subVI, i have the while loop stop triggered by a value change event on a stop button.
Is this a problem because of the Mechanical action of the Stop button? Or the event structure?
07-09-2009 10:25 AM
I'm confused. What 'actual VI'? Are you saying that you are running different code than what you posted? Aside from the confusion of asking for a fix of code that you did not post, the only problem with the subVI you posted was you did not have a wait in the loop. If you have an event structure, you don't need a wait.
The incorrect mechanical action is in your top level VI that you posted. Is that different than the 'actual code' as well?
07-09-2009 10:36 AM
Ok, Im sorry for the confusion.
You see, I developed this VI to basically edit arrays. Its called recipeeditor.vi.
Then i needed the login to pop up this recipeeditor if the password was right, so i started developing the login. I used a really quick vi that i made up, just to be extra cautious because i didn't want anything to happen to the other VI. So when you gave me the fix for the other VI, i assumed it would be the same for when i inserted the recipeeditor sub VI.
I hope i'v cleared things up.
I've attached my files again.
07-09-2009 10:47 AM