moDiag
FabulaTech Forum Newbie
Posts: 2
|
|
Re: Serial Port Control freezes opening Bluetooth
Reply #2 on: Sep 24th, 2009, 5:38am |
Quote Modify
|
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 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 [/quote] I will do that!
|