USB Com emulator Port Misbehaves
-
Hi - I have a VB.Net app that controls several devices - including a servo on a USB/Com port using a VCP - I am adding another device with another USB/Comport VCP driver and my vb.et program will not send the write buffer contents to the port, but does not throw an error but hangs on the next read. I have tested the interface and device (a USBI/O24R board) using hyperterminal and the device and ports work fine. Lots of time searching for a similar problem - no joy - so here are a few questions. Is there a limit on how many USB/Serial (virtual COm Port) emulators in a system. Is there a problem with high com munbers (I started at 17) - but I should point out that I move the USB/Serial port to com2 with the same results. Is there a problem with the USBI/O24R driver ? I have had a few emails with the chip supplier but no help yet except try getting to a lower com port - no results. Below is an extract of my test code . . . I added the GetSerialPortNames to see what was happening - POrtmon shows tthe name of the port and the open/close and a single write of "0A" but none of the data string. No change when the VCP was forced to Com2 Thanks for the help Bob __________________________________________ Public SwitchCommName As String = "COM2" Public SwitchCommSpeed As Integer = 9600 Public SwitchCommParity As System.IO.Ports.Parity = IO.Ports.Parity.None Public SwitchCommDataBits As Integer = 8 Public SwitchCommStopBits As System.IO.Ports.StopBits = IO.Ports.StopBits.One Public SwitchComDataOut As String Public SwitchCommFlowControl As System.IO.Ports.Handshake = IO.Ports.Handshake.None Dim SwitchCom As SerialPort = My.Computer.Ports.OpenSerialPort(SwitchCommName, SwitchCommSpeed, IO.Ports.Parity.None, SwitchCommDataBits, IO.Ports.StopBits.One) Public SwitchCommdataOut As String Public SwitchCommDataIn As String Public Switch_WordOK As Boolean = False Sub InitializeRemoteSwitch() Call GetSerialPortNames() MsgBox("OK") SwitchCom.DiscardInBuffer() 'ID device First SwitchCommdataOut = "?TTTTTTT" '& vbCrLf SwitchCom.WriteLine(SwitchComDataOut) Try SwitchCommDataIn = SwitchCom.ReadLine() MsgBox(SwitchCommDataIn) Catch ex As Exception End Try 'Set I/02 as Input (switch), I/04 as output (Red) and I/06 as Output (Green) 'Default is input 'Values = 2 , 8 and 32 so output total is 40 Dim S