Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

GetData or PeekData and calling a form to display

Posted on 1997-11-04
3
Medium Priority
?
676 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 300 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…
Suggested Courses

730 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