LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Match Pattern Function to log in to telco card. (Username/Password)

Solved!
Go to solution
Highlighted

Hello again, i am trying to automate the log in process using labview. At the picture below you can take a look at my VI.

For some reason even though it exits the first loop and reaches the second, it just doesn't move to the second. Maybe it doesn't even write the 'root' & 'enter' string.

 

I tried adding delay, to give it some time to write it, but didn't help.

Any idea how to resolve it? Or if my idea is not right, how to go about it?

0 Kudos
Message 1 of 9
(264 Views)
Solution
Accepted by topic author rozakos

The second loop is completely redundant. Not sure if that's the problem, or what is...

 

The 2nd loop will either stop immediately (if Password is found) or never (if Password is not in the string). The string will never update... Think wireflow.

 

If you want to update the string, well, you actually have to update it...

Message 2 of 9
(244 Views)

wiebe@CARYA wrote:

If you want to update the string, well, you actually have to update it...


And by that, wiebe means you have to continue to read from the serial port.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
Message 3 of 9
(223 Views)

@crossrulz wrote:

wiebe@CARYA wrote:

If you want to update the string, well, you actually have to update it...


And by that, wiebe means you have to continue to read from the serial port.


Yes, or step up the architecture. I'd probably consider two (separate) read and write loops, but there's not enough detail to recommend that with absolute certainty.

 

Btw, there's no requirement that wires must have bends. Straight wires are actually preferred Smiley Embarassed.

Message 4 of 9
(194 Views)

I made some changes,added the two read and write loops! What i want to do is basically, sent an "Enter" at the boot of the card, that way it will enter the test mode. Then i want the program to type the username/password when 'login' and 'password' show up respectively. For some reason the program does enter test mode, but it won't type root, eve after adding the loops.

 

 

 

 

0 Kudos
Message 5 of 9
(166 Views)

Stacked Sequence Structures are not an improvement! They just hide things.

 

Notice the duplicate code (the copies of the same sequence frame). Those pieces of code should be subVIs.

 

At this point it's going to be very hard to diagnose the VI, without actually being able to run it. I was suggesting two parallel loops, one for reading, one for writing... I'm not sure if it's needed, it will complicate things.

 

Are you supposed to be sending end of line characters continuously, while reading the password? I can't tell if there's a good reason for it, but it seems weird.

Message 6 of 9
(154 Views)

As far as structure...

1. Learn to use Shift Registers.  That will eliminate all of your local variables.

2. Learn to use a State Machine.  It will help immensely to organize your code.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
Message 7 of 9
(138 Views)

3. Learn to make proper subVIs. Divide and conquer.

Message 8 of 9
(115 Views)

You are right guys, thank you for the tips, i used some of them to my next VI (which i am gonna open a thread about, since i am stuck again) Smiley Tongue

0 Kudos
Message 9 of 9
(89 Views)