LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

while loop problem

I have a problem with some while loops. I got tangled up with them Smiley Tongue
 
we have a while loop which lets us enter a password throughout some buttons (numeric keypad) at the bottom of the .jpg you can see this original loop. Outside the loop, the code is checked if it is correct. Inside the loop there is a counter of the entered characters. This sends out a 'true' to the upper while loop, the content in this loop is only activated when the right code is entered.(there's a lot of things going on inside this loop so I drew it in an easier way) The loop where the code is entered, stops when all characters have been received. But we want to re-enter de code to stop the loop above with a 'false' . But the while loop was stopped, because it got the code. So we need another While-loop around it, that's for sure. But we tried this. The things that are happening then:
- we can enter the code and it gives a true to the upper while loop.
- we can enter 6 random numbers and it gives out a 'FALSE'
- but the content in the upper level is not working anymore(when we remove the loop it is working)
 
 
can anybody help me with this problem?
0 Kudos
Message 1 of 7
(2,800 Views)

Hi GB21

Just a thing: the while loop reading the passwords should not be stopped, since you don not know when trying to enter it again.

so this process must be monitoring the keyborad for a valid password and latching a true/false indicator/variable.

the othe process (paralel) will grab this change , maybe using a local, maybe using an event sequence.....

 

hope it helps.
 
I will try to code this .
 
Alipio
---------------------------------------------------------
"Qod natura non dat, Salmantica non praestat"
---------------------------------------------------------
0 Kudos
Message 2 of 7
(2,779 Views)
Hello

this is a quick example of event based keypad to enter a key of 6 chars.

the keypad is modified from keypad.vi in this web.

The boolean latches when the password is correct.

You can adapt it for your application, for sample, counting bad password tries.

you can use the latch value in another loop for processing.

hope it helps
Alipio

---------------------------------------------------------
"Qod natura non dat, Salmantica non praestat"
---------------------------------------------------------
Message 3 of 7
(2,753 Views)

You should switch to a simple state machine using a single while loop. The code could initially be locked in the password entry state. Once the password is correct, the other states will be be unlocked. Shouldn't be too hard. 😉

Search the example finder for "state machine" for some ideas.

0 Kudos
Message 4 of 7
(2,745 Views)
thanks for your help so far! great. I will study on this, coming weekend and get back to you, if I figured it out! thanks so far
 
GB21
 
0 Kudos
Message 5 of 7
(2,738 Views)
I tried to evaluate this VI and I know how everything works. There is only one little thing I don't get. On the left side of the EVENT structure there are a lot of things defined. Like:  Source, Type, Time.....etc .   What does this mean? Are these the objects used inside the structure? I couldn't find it in my LabVIEW basis introduction reader Smiley Indifferent
0 Kudos
Message 6 of 7
(2,688 Views)

That is an "Event Data node". Cut and paste from the helpfile follows.

"

The Event Data Node is attached to the inside left and right borders of each event case. The node identifies the data LabVIEW returns when an event occurs. The node displays data that is different in each case of the Event structure depending on which event(s) you configure that case to handle. If you configure a single case to handle multiple events, only the data that is common to all handled event types is available.

"

You have sized it down and are looking at each the elements of the cluster.

Ben

Message Edited by Ben on 10-01-2005 02:54 PM

Message Edited by Ben on 10-01-2005 02:55 PM

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 7 of 7
(2,679 Views)