| Dart Home | PowerTCP Emulation for ActiveX | Custom Development | Reply | PowerTCP Emulation / Telnet for ActiveX Topics | Forums |
| Author | Forum: PowerTCP Emulation / Telnet for ActiveX Topic: n00b: ActiveX Telnet questions... |
| mushu From: Orting, WA USA Posts: 17 Member Since: 10/06/04 |
posted October 6, 2004 6:10 PM I am doing the "try before you buy" of the VB6 Telnet object. I am attempting to connect to a hardware device over Ethernet, with its own IP address, send some data, get some data, and quit. Sounds easy, and should be, but I cannot seem to find a tutorial to follow to do this. I have looked at the code for the sample telnet app that came with the module, but I cannot find the section I need to know: how do I perform VT100 emulation? I get mostly "garbage" characters. Or, do I have to just mask off the 8th bit of every character and go from there? Thanks for any help!! |
Tony Priest![]() From: Utica, NY USA Posts: 8466 Member Since: 04/11/00 |
posted October 6, 2004 7:20 PM If what you are connecting to is actually a Telnet server, then you should get a login prompt when you use the sample app to connect to it. The termtype is set in the sample code. You can try setting it to vt100 and see if that helps. Since I can't connect to your device, I can't tell you what the garbage characters are though. |
| mushu From: Orting, WA USA Posts: 17 Member Since: 10/06/04 |
posted October 6, 2004 7:40 PM I'm sure that they are 7-bit ASCII chars being displayed as 8-bit, thus the graphic "garbage" characters. Proper emulation will fix that. I can't seem to get it to make a simple connection with this code: Public Sub performTelnet(ByVal hnd As Form) Dim Data As String, Count As Long hnd.txtStatus.Text = "Initiating connection..." & vbCrLf frmStatus.Telnet1.TermType = "tty" frmStatus.Telnet1.Trace "Telnet.log", True, True, vbCrLf + "---> ", vbCrLf + "<--- " frmStatus.Telnet1.Timeout = 15000 hnd.Refresh frmStatus.Telnet1.Connect addr(curSite) frmStatus.Telnet1.Send vbCrLf & vbCrLf & vbCrLf Count = frmStatus.Telnet1.Search(Data, "*") frmStatus.Telnet1.Close End Sub I'm passing it the hWnd of the form I want to display the text status on. The telnet server accepts a "free" connect (no L:P needed) and you have to hit [Enter] a few times to get an asterisk prompt. I might need to insert a delay between the connect and the 3 CRLF sends...? Anyway, all I want to do is see it do _something_ and it just sits there. I know I'm missing something very basic (heh) but can't see it in the Telnet sample code. Any suggestions? |
Tony Priest![]() From: Utica, NY USA Posts: 8466 Member Since: 04/11/00 |
posted October 6, 2004 7:45 PM What happens if you connect to it with our sample instead of trying to write your own first? If the same thing happens, then what happens if you connect to it with the Windows telnet program? |
| mushu From: Orting, WA USA Posts: 17 Member Since: 10/06/04 |
posted October 6, 2004 8:14 PM I'm assuming it works because I can't read anything. I tried to change your sample emulation to "vt100" but it did not display any different. Here is a sample from the log file: <--- ÿû ---> ÿþ <--- ÿý ÿûÿûÿý ---> ÿü ---> ÿý ---> ÿý ---> ÿû ---> <--- <--- * ---> <--- <--- * ---> <--- <--- * ---> <--- <--- * <--- ÿû ---> ÿþ <--- ÿý ÿûÿûÿý ---> ÿü ---> ÿý ---> ÿý ---> ÿû ---> <--- <--- * ---> <--- <--- * ---> <--- <--- * ---> v <--- v ---> i <--- i ---> e <--- e ---> w <--- w ---> <--- Hopefully the upper-ascii chars displayed properly on your web form above. What am I missing in my example code above that would prevent a simple telnet connection? Do I have an incorrect timeout value? Thanks! |
Tony Priest![]() From: Utica, NY USA Posts: 8466 Member Since: 04/11/00 |
posted October 6, 2004 8:46 PM What you are seeing is option negotiation. Normally setting AutoOption to true will take care of this. If it doesn't, you'll need to determine what options are being asked for and what you need to respond with. See the help for the Command event for details. Since this is a rather advanced issue it is most likely not something we could get to deeply into on this forum. I would suggest that you first contact the manufacturer of the device to find out what options you need to handle. If that does not get you anywhere, contact our sales department (support@dart.com) to find out support options would be available to you. Make sure you reference the url to this topic in message. |
| mushu From: Orting, WA USA Posts: 17 Member Since: 10/06/04 |
posted October 6, 2004 9:03 PM Perhaps it is in the _very_ beginning, but I'm sure there is an emulation issue as well. The hardware device uses the * as the command prompt. Thus, those three asterisks towards the top of the log file are those prompts I got when I hit [Enter] three times. What I'm concerned with is the upper-ascii characters in front and after the asterisks...those should not be there, and when I used CRT (a different telnet program) they were not there. I could set autonegotiate to false as well, since I don't need any advanced commands. Here is the log file from your sample telnet app after I changed it to not negotiate and use vt100 instead of tty: <--- ÿû ÿý ÿû <--- ÿûÿý ---> <--- <--- * ---> <--- <--- * ---> <--- <--- * ---> h <--- h ---> e <--- e ---> l <--- l ---> p <--- p ---> <--- <--- Commands available at current access level: <--- - ACCESS - Change access level to Access Level 1 - HELP - Provide information on available commands - ID - Display identification information <--- - QUIT - Change access level to Access Level 0 * ---> q <--- q ---> u <--- u ---> i <--- i ---> t <--- t ---> <--- |
Tony Priest![]() From: Utica, NY USA Posts: 8466 Member Since: 04/11/00 |
posted October 6, 2004 10:28 PM Please contact our sales department (support@dart.com) to find out what support options are available to you. Make sure you reference the url to this topic in message. |
| Reply | PowerTCP Emulation / Telnet for ActiveX Topics | Forums |
This site is powered by
PowerTCP WebServer for ActiveX
|