Click here to Skip to main content
12,406,986 members (60,163 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: VB6
Hi, I am not expert in Visual Basic coding and I need to store data from hyper terminal into some files.
For that I need API which is read data from hyper terminal and store somewhere in file.

Any help for me can be appreciated.
Thanks!
Posted 23-Apr-13 18:49pm

1 solution

Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

Hi

Follow of these code you can open port and read data from Hyper Terminal:

Option Explicit
Private Buffer As String
 
Private Sub Form_Load()
MSComm1.CommPort = 3
MSComm1.Settings = "9600,N,8,1"
 
        If MSComm1.PortOpen Then
            MSComm1.RThreshold = 1
            MSComm1.InputLen = 1
            MSComm1.CommPort = 1
            If Not MSComm1.PortOpen Then 
	        MSComm1.PortOpen = True
            Else
                MsgBox "Warrning!:fail to open port."
            End If
        End If
End Sub
 
Private Sub MSComm1_OnComm()
    Select Case MSComm1.CommEvent
    Case comEvReceive
        Buffer = MSComm1.Input
        MyParser
    End Select
End Sub
 
Private Sub MyParser()
    Do While Len(Buffer) <> 0
        Text1.Text = Text1.Text & ""
        IF MSComm1.InBufferCount > 0 Then 
            Buffer = Buffer & MSComm1.Input
        End IF
    Loop
End Sub

Additionally you can use this link http://msdn.microsoft.com/en-us/library/aa168292(v=office.11).aspx[^] for write your data from Excel file and you can download example of Mscomm follow of this link http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=7585&lngWId=1[^] Wink | ;)

Best Regards.
  Permalink  
v4

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.160730.1 | Last Updated 25 Apr 2013
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100