I am evaluating your serial port control right now, and have encountered a problem. In order to make it easier for my customers to find the correct COM-port, I let my application open all existing com-ports (one at a time), send a special string and wait for the answer. On my Gigabyte T1028X with Broadcom Bluetooth (Win XP SP3), the application freezes when trying to open a bluetooth COM port which is not connected to any device. The "OPEN"-method does not throw any exception, I can handle - it just freezes and has to be terminated using the taskmanager.
When a device is connected to the bluetooth-COM-port, the connection works as expected.
Could you please let us know what string you send to open the com ports?
Do you use only one Serial Port Control or do you have Serial port Control on every com port?
What are the flow control parameters?
Also please monitor the com port that freezes with the help of this utility http://download.sysinternals.com/Files/PortMon.zip and send the log file for analysis to support@fabulatech.com
Could you please let us know what string you send to open the com ports?
This is more or less the code, I am using (it is quite straight forward):
in Sub Form_Load:
Dim cntPorts as integer Dim i as integer Dim portsAvail() as integer
'enumerating the available ports 'store the ports number in portsAvail cntPorts=ftspc1.enumSerialPorts-1 for i=0 to cntPorts
redim preserve portsAvail(i+1)
portsAvail(i) = Replace(ftspc.GetSerialPort(i),"COM","") next i
In Connection-Procedure:
Dim comPortToUse as Integer Dim BaudRate as long Dim Writebuf() as byte BaudRate=9600
'...setting comPortToUse to a vallid value 'then
With ftspc1
.PortName="COM" & portsAvail(comPortToUse)
.BaudRate = Baudrate '9600 Baud
.DataBits = ftspcDataBits8
.FlowControl = ftspcFlowNone
.StopBits = ftspcStopBitsOne
.Open
sTexttoSend="ATZ" & chr$(13)
redim Writebuf(1 to len(stexttosend))
for i = 1 to len(sTexttoSend)
WriteBuf(i)=asc(mid$(sTexttoSend,i,1))
next i
.WriteArray (WriteBuf,len(sTexttosend)) end with
[quote] Do you use only one Serial Port Control or do you have Serial port Control on every com port? [/quote]
Yes! I am using only one control - but when I have finished the search on the first com-port, I close the port and set the .PortName-Property to the next COM-Port to search - the ports are never open at the same time! The application freezes even if I do not switch the com ports but try to connect only to the bluetooth port which does not have a connection to a device.
[quote] What are the flow control parameters? [/quote]
ftspcFlowNone
[quote] Also please monitor the com port that freezes with the help of this utility http://download.sysinternals.com/Files/PortMon.zip and send the log file for analysis to support@fabulatech.com