Posts: 3
Joined: Mon Jan 15, 2007 3:56 pm
Location: Spain

Enabled=false hang up the program

Wed Aug 29, 2007 8:17 pm

I am using serial tools from visual BASIC 6,0 running in a laptop with Windows XP. The program obtains the list of ports COM and it opens one by one to detect the port in which is the device with which it is wanted to connect. The problem is when arriving at the COM6. The program tries to open it, and after the timeout occurs then the program set the enabled property to false and the program is locked and it does not respond. The code is the following:

Private Sub OpenPort
Set mobjPort = New SerialXP.Port
mobjPort.BaudRate = 19200
mobjPort.EndTrigger = Chr(10)
mobjPort.ComPort = 6
mobjPort.Parity = 2
mobjPort.Timeout = 5000
mobjPort.Enabled = True
End Sub

'OnRead Event
Private Sub mobjPort_OnRead(Data As Variant)
If IsNull(Data) Then
mobjPort.Enabled = False
MsgBox "Hello"
End If
End Sub

The instruction MsgBox "Hello" is not executed

The COM6 is a virtual port Blootooth, but before arriving at the COM6 it opens and it closes the COM3 that also is a virtual port Blootooth without problems.

I need a solution urgently since the program works well in some computers but in others as this portatil fault. The program already is being distributed and it cannot fail

Thanks in advanced

Return to “SerialTools”