Serial port detect
Serial port detect
Serial port detect
Serial port detect
Serial port detect
Serial port detect Serial port detect Serial port detect Serial port detect Serial port detect Serial port detect Serial port detect Serial port detect
Serial port detect Serial port detect
Serial port detect
Go Back  Xtreme Visual Basic Talk > > > Serial port detect


Reply
 
Thread Tools Display Modes
  #1  
Old 01-07-2013, 09:52 PM
arungokul1990 arungokul1990 is offline
Newcomer
 
Join Date: Dec 2012
Posts: 1
Default Serial port detect


sir i am having runtime error 8002 invalid port in VB 6,kindly help me in assigning 1 to 4 ports to transfer data

Code:
Private Sub Command1_Click()
If (MSComm1.PortOpen = False) Then
MSComm1.PortOpen = True
End If
Command1.Enabled = False
Command2.Enabled = True
End Sub

Private Sub Command2_Click()
If (MSComm1.PortOpen = True) Then
MSComm1.PortOpen = False
End If
Command1.Enabled = True
Command2.Enabled = False
End Sub

Private Sub Form_Load()
With MSComm1
.CommPort = 1
.RThreshold = 1
.RTSEnable = True
.Settings = "9600,N,8,1"
.InputLen = 127
.SThreshold = 1
End With
End Sub

Private Sub Form_Unload(Cancel As Integer)
If (MSComm1.PortOpen = True) Then
MSComm1.PortOpen = False
End If
End Sub
Private Sub MSComm1_OnComm()
Dim Buffer As String

Select Case MSComm1.CommEvent
Case comEvReceive
'Text1.Text = " "
Buffer = MSComm1.Input
Text1.Text = Text1.Text & Buffer
End Select
End Sub

Last edited by Flyguy; 01-08-2013 at 02:46 AM.
Reply With Quote
  #2  
Old 01-12-2013, 02:45 PM
Cerian Knight's Avatar
Cerian KnightSerial port detect Cerian Knight is offline
Polymath (in disciplina)

Super Moderator
* Expert *
 
Join Date: May 2004
Location: Michigan
Posts: 4,191
Default

Do you have a COM1 port listed in Device Manager? If so, was this port number changed from something else? If so, Win 7 (and Vista?) requires the port driver for COM1 to be reinstalled after changing port numbers... just repick the proper driver from the list of compatible drivers, since it is already installed.

Also, make sure the port is not open by some other program and no other software for virtualizing ports is installed.
__________________
I got all the answers wrong on the GLAT, apparently even #9 (where I put a period in the middle of the box and labeled it 'singularity ripe for rapid inflation').
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Serial port detect
Serial port detect
Serial port detect Serial port detect
Serial port detect
Serial port detect
Serial port detect Serial port detect Serial port detect Serial port detect Serial port detect Serial port detect Serial port detect
Serial port detect
Serial port detect
 
Serial port detect
Serial port detect
 
-->