E
EMW
Hi,
For my windows application I'm using OpenNetCF's serialport stuff but I'm
having a small problem.
In my program I want to list a range of available ports to select.
This works fine for the first 16 ports, but not for the higher ports.
I do this as folowed:
For ab = 1 To 32
commport = "COM" + ab.ToString
SerialPort = New Port(commport)
With SerialPort
.PortName = commport + ":"
.RThreshold = cpi.comRThreshold
.Settings.BaudRate = cpi.comBaud
.Settings.ByteSize = cpi.comByte
.Settings.Parity = cpi.comParity
.Settings.StopBits = cpi.comStopbits
End With
Try
ac = SerialPort.Open
err = ""
SerialPort.Close()
Catch ex As Exception
err = ex.Message.ToString
MsgBox(err + vbCrLf + "com" + ab.ToString)
SerialPort = Nothing
End Try
If ac = True And Not SerialPort Is Nothing Then
Me.cbCom.Items.Add(Mid(SerialPort.PortName, 1,
Len(SerialPort.PortName) - 1))
End If
SerialPort = Nothing
Next ab
If have a bluetooth usb stick connected to virtual port 24 but this port
cannot be opened.
Is there a limitation for the amount of ports that can be opened like this?
please help.
Eric
For my windows application I'm using OpenNetCF's serialport stuff but I'm
having a small problem.
In my program I want to list a range of available ports to select.
This works fine for the first 16 ports, but not for the higher ports.
I do this as folowed:
For ab = 1 To 32
commport = "COM" + ab.ToString
SerialPort = New Port(commport)
With SerialPort
.PortName = commport + ":"
.RThreshold = cpi.comRThreshold
.Settings.BaudRate = cpi.comBaud
.Settings.ByteSize = cpi.comByte
.Settings.Parity = cpi.comParity
.Settings.StopBits = cpi.comStopbits
End With
Try
ac = SerialPort.Open
err = ""
SerialPort.Close()
Catch ex As Exception
err = ex.Message.ToString
MsgBox(err + vbCrLf + "com" + ab.ToString)
SerialPort = Nothing
End Try
If ac = True And Not SerialPort Is Nothing Then
Me.cbCom.Items.Add(Mid(SerialPort.PortName, 1,
Len(SerialPort.PortName) - 1))
End If
SerialPort = Nothing
Next ab
If have a bluetooth usb stick connected to virtual port 24 but this port
cannot be opened.
Is there a limitation for the amount of ports that can be opened like this?
please help.
Eric