Click here to Skip to main content
Rate this: bad
good
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 19: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
0 OriginalGriff 200
1 PIEBALDconsult 150
2 BillWoodruff 148
3 Jochen Arndt 135
4 DamithSL 130
0 OriginalGriff 5,695
1 DamithSL 4,506
2 Maciej Los 4,007
3 Kornfeld Eliyahu Peter 3,480
4 Sergey Alexandrovich Kryukov 3,190


Advertise | Privacy | Mobile
Web01 | 2.8.141216.1 | Last Updated 25 Apr 2013
Copyright © CodeProject, 1999-2014
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