FabulaTech Forum Newbie
Re: Serial Port Control freezes opening Bluetooth
« Reply #2 on: Sep 24th, 2009, 5:38am »
on Sep 24th, 2009, 2:06am, Alex_Webster wrote:
|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
for i=0 to cntPorts
redim preserve portsAvail(i+1)
portsAvail(i) = Replace(ftspc.GetSerialPort(i),"COM","")
Dim comPortToUse as Integer
Dim BaudRate as long
Dim Writebuf() as byte
'...setting comPortToUse to a vallid value
.PortName="COM" & portsAvail(comPortToUse)
.BaudRate = Baudrate '9600 Baud
.DataBits = ftspcDataBits8
.FlowControl = ftspcFlowNone
.StopBits = ftspcStopBitsOne
sTexttoSend="ATZ" & chr$(13)
redim Writebuf(1 to len(stexttosend))
for i = 1 to len(sTexttoSend)
Do you use only one Serial Port Control or do you have Serial port Control on every com port?
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.
What are the flow control parameters?
Also please monitor the com port that freezes with the help of this utility
and send the log file for analysis to firstname.lastname@example.org
I will do that!