Hello
I’m using “System.SerialPort” to connect to an USB device. However, if the device cannot be found / is not connected, this command takes very very long to execute (with the device connected, there is no problem). Is there a way to speed it up in case the device is not found?
Thanx
Lukas
For i=System.SerialPortCount-1 downto 0
Try
SerialPort= System.SerialPort(i) // every try takes approx. 10 sec if no device is connected
If Open() Then
// do some coe
else
MsgBox("DEBUG: Could not connect => " + str(i))
End If
Close()
Catch err As OutOfBoundsException
End Try
Next