Solved

GetData or PeekData and calling a form to display

Posted on 1997-11-04
3
660 Views
Last Modified: 2010-08-05
I have a program that captures data out of the comm port. I also can TELNET to the device  but when I try and invoke the peekData or GetData It see's nothing. I am using another form to display the data back, Could that be the issue? Here is the code out of the books online of the GetData I am using. Is there any good examples of TCP/IP (telnet)programs out there?
 
Private Sub Winsock1_DataArrival_(ByVal bytesTotal As Long)
    Dim strData As String
    Winsock1.GetData strData
    Text1.Text = strData
End Sub

Here is how it is being called.

Private Sub mnuTelnetOpen_Click()
   
   'Winsock1.RemoteHost = "140.248.152.196"
    Winsock1.RemotePort = 23
    'txtTerm.Text = ""
    Winsock1.Connect
    TCPform.Show vbModal
End Sub

Private Sub Winsock1_Connect()
 Dim PauseTime, Start, Finish, TotalTime
 Dim error1, last1
 
    Winsock1.SendData "root" & Chr(13)
    Beep
    Winsock1.SendData Chr(13)
    Winsock1.SendData Chr(13)
    'MSComm1.InputLen = 0 ' Get all available data
    'MSComm1.Handshaking = 1
     
   
       
     If MSComm1.PortOpen = True Then
     
        Winsock1.SendData "ls" & Chr(13)

Thanks in advance for your help.

-S
0
Comment
Question by:smurray
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 6

Accepted Solution

by:
anthonyc earned 100 total points
ID: 1439800
smurray,

When you open a form modally, you stop all processing on the calling form until you return from the modal form.  Therefore, you are not getting your events.  You need to not show the form modally, and some how create a "pseudo-modal" form.  By that I  mean, it's operates like a modal form, but is not really modal.

Anthony
0
 

Author Comment

by:smurray
ID: 1439801
Thanks for the tip on the modalm but I still cannot read back from the device. Is there an example on how to GetData during a Telnet session?
0
 
LVL 6

Expert Comment

by:anthonyc
ID: 1439802
what you did looks perfect   I have a telnet OCX of my own, and that's how I made it.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question