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?
For i=System.SerialPortCount-1 downto 0
SerialPort= System.SerialPort(i) // every try takes approx. 10 sec if no device is connected
If Open() Then
// do some coe
MsgBox("DEBUG: Could not connect => " + str(i))
Catch err As OutOfBoundsException