LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to write a telnet VI with automatic login?

Hi,
 
I'm new to Labview and working on a labview program to automate power measurement.  This program requires a login to a linux host system and run a few linux commands to configure the system undertest.  All of these info (username, password, linux commands, etc) are fed from another VI automatically.  I bought the Internet toolkit, but is still unsuccessfully figure out how to write it.  Could someone show me an example on how to write an automatic login/pass and perform an "ls" command? 
0 Kudos
Message 1 of 7
(11,211 Views)

Anh

You should be able to use the telnet play script for this.

Also look at the telnet line client example shipped with the toolkit.

Note that the prompt and replay strings have the / mode switched on to make sure \r\n is carriage-return,line-feed.

This should get you started

David

Message Edited by David Crawford on 02-16-2006 01:21 AM

Message 2 of 7
(11,196 Views)
Thanks David, it works for me finallySmiley Very Happy  However, the Telnet Play Script.vi took a long time to execute.  I did some debug and found out that the Telnet Write.vi inside the Play Script.vi hold every execution (each data in entry) for at least 7-10 seconds.  I could not see any delay programmed in the Telnet Write itself and it worked normally when I tested outside of this Play Script.vi.  Does anyone have any idea?
Anh

0 Kudos
Message 3 of 7
(11,180 Views)
After some debugging, it turns out that the timeout input is always overwrited by the program default of 25 secs.  I cloned and modified the Telnet Play Scirpt.vi so that when a command expected to take a longer time, it will be routed to a wait frame.  With this case structure select, the program can be fine tuned for speed depending on command run.
0 Kudos
Message 4 of 7
(11,158 Views)
0 Kudos
Message 5 of 7
(8,545 Views)

I am not able to do a automatic telnet login.

I have done the steps stated in your chain.


Can any one share a sample vi..

My scenario is
Prompt: login:

Reply. root

Prompt: Password:

Reply. password

Prompt: ~ #

Reply: ifconfig

 

Pls help ASAP

0 Kudos
Message 6 of 7
(5,728 Views)

Hi,

I am not able to do a automatic telnet login.

I have done the steps stated in your chain.


Can any one share a sample vi..

My scenario is
Prompt: login:

Reply. root

Prompt: Password:

Reply. password

Prompt: ~ #

Reply: ifconfig

 

I am attaching my VI here.

 

Pls help ASAP

0 Kudos
Message 7 of 7
(5,715 Views)