LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

garbled response when TCP connect is used with telnet

Hi Folks,
 
I am creating a VI that connects to the local machine via telnet and runs a small executable.

I execute the TCP connect VI and and then do a TCP read and get some characters yy%yyu ETC...

I suspect this is the login banner. I have tried the TCP communication example VI's
and get the same characters.
 
I can start a DOS window and telnet into the system and run the executable with not problem.
 
I also have  another application that starts telnet allows me to connect and send and
recieve commands and responses using Labview with no problems.
 
The machine is a xP machine and I have started the telnet service manually.
 
Any Ideas what I am doing wrong?
 I am not a Telnet expert so I may not be doing things in the right sequence to get a readable response.
It's  just confusing that one method works and the other does not not.
 
 
J.R.
0 Kudos
Message 1 of 6
(3,608 Views)

I don't know a great deal about Telnet either but it's a protocol that runs over a TCP connection and as such, your doing simple TCP Reads or Writes is not enough to handle the negotiation, header information, etc. The easiest way to do Telnet communication in LabVIEW is to buy the Internet Toolkit. This includes a set of Telnet VIs.

0 Kudos
Message 2 of 6
(3,595 Views)

Ok I have made some progress. I got hold of a freeware telnet server that LabView TCP Read vi gets responses from. Now I can log on and start my application I get my commands executed but I am getting a duplicate of this session with characters at the beginninng. Does anyone know  what these are and why I get a duplicate? Is this leftover from the previous reads that I do?

The output is paste below:

C:\Program Files\KTS>cd c:\program files\manp_executable                      
                                                                              
C:\Program Files\MANP_EXECUTABLE>manp                                         
manp> manp> enumerate                                                         
manp> host                                                                    
manp> enumerate manp                                                         
domain:brooks
                                                                               

C:\Program Files\KTS>cd c:\program files\manp_executable

C:\Program Files\MANP_EXECUTABLE>manp
manp> manp> enumerate
manp> host
manp> enumerate manp
manp>     

 

 

0 Kudos
Message 3 of 6
(3,581 Views)

Hi,

I need the same vi to connect via TCP telnet. Have you found a solution without using the internet toolkit?

When yes could you please send me the file?

Thank you for your support!

 

0 Kudos
Message 4 of 6
(3,522 Views)

Sorry RoofGroover,

I had no luck creating anything. Had my NI rep come in and demostrate the internet toolkit on my application and it works just fine. We are in process of purchasing the package now.

Sorry for the late response.

 

J.R.

0 Kudos
Message 5 of 6
(3,499 Views)
You should display all this in HEX or \-codes, else all non-printable characters look the same :(. To me, they look like vt100 type escape sequences use to control the display. Maybe you should set you terminal type to something more generic. Alternatively, you could filter them out.
 
How do you do the telnet options negotiation? (See the following old post for some details: http://forums.ni.com/ni/board/message?board.id=170&message.id=112886&query.id=0#M112886 )
0 Kudos
Message 6 of 6
(3,491 Views)