Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. USB Com emulator Port Misbehaves

USB Com emulator Port Misbehaves

Scheduled Pinned Locked Moved Visual Basic
helpcsharpcomalgorithms
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    rfrank5356
    wrote on last edited by
    #1

    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

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups