LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Creating a LabVIEW Telent Server

I am trying to create a Telnet Server in my application. On connection the client is prompted to enter a username and password. Everything seems to work fine on a Windows 2000 Professional telnet client, but when a XP client connects, the client echos every key pressed twice. So that if a user presses "a", the screen displays "aa". I have an echo character built into the LabVIEW telnet server wich I think is causing the extra character to be shown. If I disable it, the connection works correctly for an XP client but no characters are displayed for the 2000 Pro client. I think that the key is that I need to control the client echo by issuing a 'IAC Will Echo' or IAC Don't Echo' command to the telent connection. Does anyone
know how to do this? Just sending the command as a string does not work.
0 Kudos
Message 1 of 9
(6,222 Views)
Long ago, I've written some primitive telnet clinet in LabVIEW. Yes, you need to properly do the option negotiations. This is in simple binary code, see the bottom of RFC 854, RFC 855, and Section 6.6 of RFC 2400, for details.

Send the following raw strings (decimal):
IAC Will Echo = 255 251 1 (FF FB 01 in hex)
IAC Don't Echo = 255 254 1 (FF FE 01 in hex)

Of course you should properly negotiate and answer the negotiation attempts by the client.

Maybe use a packet sniffer to see what codes are exchanged if a XP telnet client talks to a real telnet server.
Message 2 of 9
(6,221 Views)
Thanks for the links that makes a lot of sense! The problem that I am still having is that then I send 255 254 1 to the client, it displys it on the client's screen. What do you mean by raw strings (decimal)?
Also, what is a packet sniffer?
0 Kudos
Message 3 of 9
(6,221 Views)
You need to send exactly 3 bytes and these might not be printable charaters.

To form the desired string to send, create a string constant on your diagram, right-click it and select "Hex display". Now type "FFFB01" and it will show it as "FFFB 01" because it is hex, ignore the space, it is only cosmetic. (If you display it in normal display, it'll look like garbage and if you display it as "\" codes, it'll look as follows: "\FF\FB\01").

Good luck.
Message 4 of 9
(6,221 Views)
I tried exactly what you suggested, but the client is not reponding and is displaying the option as non-printable characters.
0 Kudos
Message 5 of 9
(6,221 Views)
Ok it works. The Telnet Write.vi was adding an extra FF to the command. Once I removed I was able to turn echo off, but when I set the echo option in Windows XP pressing the enter button no longer returns with CRLF. It only reply's CR. In 2000 Professional, pressing the enter button returns CRLF. Do I need to set a terminal type or is there a way to set the end of line character?
0 Kudos
Message 6 of 9
(6,221 Views)
I was using all plain TCP, because I don't have the internet tool kit. I don't know if any (or what kind of) option negotiation is done inside the telnet VIs of the internet toolkit.

I don't think the end-of-line character used will be a problem, just code your program to deal with all possibilities.
0 Kudos
Message 7 of 9
(6,221 Views)
I got it. I just had to configure the telent session on the client so that enter would only send CR and not CRLF. Thanks for you help!
0 Kudos
Message 8 of 9
(6,221 Views)
Hi,
 
I only need to built a vi that makes a TCP connect via telnet and sends a command to the telnet session without using the internet toolkit!
 
I ´am not so good in programming, do you have a sample vi? could you please help me!
 
Thanks!
0 Kudos
Message 9 of 9
(6,042 Views)