LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Creating a multiple user login

I have created a vi that uses "match regular expression" twice to find usernames and passwords in an additional text file. My problem is that the feedback node that I am using is stuck in the loop when it does not find a match in the text file. Is there an easier way of handling this?

0 Kudos
Message 1 of 4
(2,360 Views)

Of course there is an easier way. Nothing should ever be "stuck in a loop", so let's fix that first by showing us a simplified version of your code. There are hundreds of ways not to get stuck, but billions of ways to get stuck. Without seeing your code we cannot tell what's wrong.

I also hope you are encrypting the passwords in the file in some way.

 

 

0 Kudos
Message 2 of 4
(2,358 Views)

I have attached my vi. My goal is to create a user interface system to control an automated tool locker. My code works for a case that matches, but if I enter random letters to check if it doesn't match the while loop doesn't stop because it cant find the end of the file for the text file.

Thanks

0 Kudos
Message 3 of 4
(2,352 Views)

As a first step you need to learn about typical code architectures (e.g. "state machine). Several event structures in sequence and outside a while loop are not correct under any circumstance. I guess the file is a text file with pairs of items on each row delimited by a comma. All you need to do is read it as a 2D string array (there is a tool for that!), split off the first column and do a "search 1D array" to see if it eixsts), the use the found index to index into the row and get the password.

 

See how far you get. I would recommend to do a few more LabVIEW tutorials first.

0 Kudos
Message 4 of 4
(2,337 Views)