03-26-2018 11:08 AM
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?
03-26-2018 11:12 AM
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.
03-26-2018 11:20 AM
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
03-26-2018 11:43 AM - edited 02-20-2025 05:35 AM
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 exists), then 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.