LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Prompting for password

Might I recommend using the "Prompt user" quick-machine, it will generate a pop-up, display your question and then prompt you to enter a password. You can then take this password and compare it against a stored version somewhere to check whether it is correct. You could then prompt a user with a text box saying "Incorrect Password: X Attempts remaining" or "Password accepted". These would only have to be two different cases in a case structure dependent on the comparison between the input and the stored password.

 

By using a shift register to store the number of remaining attempts you could maintain a register so that once the person gets too many incorrect guesses there is a lock out. This counter could be reset upon the entry of a correct password, or a system reset.

0 Kudos
Message 11 of 13
(660 Views)

Hy ogk

First of all thanks for your suggestion. Again, to make things clear, what I eventually need is a boolean output so that I can couple it with an AND condition with another signal (from motion sensors) to activate an alarm

 

I made a very simple VI based on your suggestion but some things aren't going well. For starters the prompt pops up whenever I run the VI, which i dont want to. I only want it to pop up when I press a button. Also, for some reason, I cant stop the VI from forming an infinite loop. I wired the true case of the case structure to the stop button but the loop just goes on.

Another problem is that I want the same password entry to either activate or deactivate the system sequentially i.e. entering the password once enables it and then entering it again disables it, and so on.

 

I also attached an example I found online. This one deals with multiple tabs, however, in which one of the tabs is password protected .In this "passwordExample.vi" , the issue was that If i entered a boolean control inside the true case of entering the correct password, the boolean indicator would not turn on unless I switch to the home tab and return to the "config" tab once again, making it unusable.

 

Regards

Download All
0 Kudos
Message 12 of 13
(637 Views)

I'm not sure what you are looking for here.  Your VI seems to be behaving just like it is programmed.

 

Your "boolean" control is read before your password is entered and the case structure is executed.  So if you change it, it isn't going to be read until the next iteration of the tab control.

 

Since the two property nodes inside the case structure are the same for both cases, they should be outside the case structure.  Just wire the boolean wire going to the case structure to them.

 

Generally, tab controls don't actual "control" any code.  they are usually a UI element to organize controls.  Here you are using the event of going to the Config tab to be the trigger for asking for the password.  Which is okay.  But once you enter a password, I'd assume you'd want the user to stay logged in.  Going back to home then to config tab again would be a painful user experience to have to reenter the password again.  I would store the fact you are logged in as a boolean shift register, and only ask for the password in the event the boolean is currently false.

0 Kudos
Message 13 of 13
(617 Views)