Results 1 to 10 of 10

Thread: [RESOLVED] MSComm connection for USB-to-Serial Port

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2010
    Posts
    13

    Resolved [RESOLVED] MSComm connection for USB-to-Serial Port

    I am doing a project in VB6.0

    For this I have created two MSComm connections. One is with the physical (Actual) serial port (COM1) of the machine and other one is with a USB-to-Serial convertor (COM2)

    Both the MSComm connections seem to work perfectly with COM1. But both fail to receive anything from COM2.

    Settings of both the ports are similar; still it does not work with COM2.

    I have checked COM2 with other application, the port works fine.

    Any idea? Please help!

  2. #2

    Thread Starter
    New Member
    Join Date
    Apr 2010
    Posts
    13

    Re: MSComm connection for USB-to-Serial Port

    Let me be more clear,

    Here is what I see on port analyzer

    First frame is from a standard application

    Request: 4/27/2010 4:22:51 PM.99664 (+8.5313 seconds)
    6F 03 01 1C 00 02 0C BF o......
    Answer: 4/27/2010 4:22:51 PM.99664 (+0.0000 seconds)

    6F 03 04 FA 7F 43 9E C4 6D o..Cm


    Port closed

    Now when I use my code

    Port opened by process "VB6.EXE" (PID: 2756)

    Request: 4/27/2010 4:23:03 PM.68464 (+12.6875 seconds)

    6F 03 01 1C 00 02 0C BF o......






    There is no response from the device.
    Device setting are same as for standard application.


    Please suggest any way out!

  3. #3
    PowerPoster CDRIVE's Avatar
    Join Date
    Jul 2007
    Posts
    2,620

    Re: MSComm connection for USB-to-Serial Port

    Not quite sure what you're describing. Are you receiving any error messages like "Invalid Port?
    <--- Did someone help you? Please rate their post. The little green squares make us feel really smart!
    If topic has been resolved, please pull down the Thread Tools & mark it Resolved.


    Is VB consuming your life, and is that a bad thing??

  4. #4
    Fanatic Member
    Join Date
    Sep 2009
    Location
    Lakewood, Colorado
    Posts
    621

    Re: MSComm connection for USB-to-Serial Port

    My first thought is that, in fact, the two set of setting are not exactly the same. Perhaps it is a simple as enabling RTS (a common mistake). MSComm1.RTSEnable = True.

    There is no logical difference between physical and USB virtual serial ports, from a programming standpoint. However, I have seen some USB devices that required an updated device driver from the device vendor, before they would work correctly with a MSComm application. So, you also should check that.

    As a last resort, try a new adapter...

    Dick
    Richard Grier, Consultant, Hard & Software
    Microsoft MVP (Visual Basic)

  5. #5
    PowerPoster CDRIVE's Avatar
    Join Date
    Jul 2007
    Posts
    2,620

    Re: MSComm connection for USB-to-Serial Port

    A basic USB/Serial converter rule to follow:
    Until you know you can do otherwise, always use the same USB port that you used when you first installed the converter and its drivers.

    I have some converters that will work on any USB port that I plug it into, while others will work only on the port it was installed on. The latter will always prompt an "Unknown Device Detected!" when plugged into the wrong port.
    <--- Did someone help you? Please rate their post. The little green squares make us feel really smart!
    If topic has been resolved, please pull down the Thread Tools & mark it Resolved.


    Is VB consuming your life, and is that a bad thing??

  6. #6
    Fanatic Member
    Join Date
    Sep 2009
    Location
    Lakewood, Colorado
    Posts
    621

    Re: MSComm connection for USB-to-Serial Port

    Device drivers for USB devices are, in general, installed to recognize the hub/port that is used. Thus, when you change to another port (you will using an alternate connection), you will now be requested to install the device driver -- and a new port number will be assigned. I've never actually seen a USB serial adapter that didn't require a separate instance of the driver for each USB port used, and a separate Virtual Serial Port number. And, over the years, I've used a lot of different ones.

    If you get an unrecognized device notification, there is an issue with the device driver installation, and (in my experience) may require a manual removal of the device and re-install.

    Dick
    Richard Grier, Consultant, Hard & Software
    Microsoft MVP (Visual Basic)

  7. #7
    PowerPoster CDRIVE's Avatar
    Join Date
    Jul 2007
    Posts
    2,620

    Re: MSComm connection for USB-to-Serial Port

    Quote Originally Posted by DickGrier View Post
    I've never actually seen a USB serial adapter that didn't require a separate instance of the driver for each USB port used, and a separate Virtual Serial Port number. And, over the years, I've used a lot of different ones.

    If you get an unrecognized device notification, there is an issue with the device driver installation, and (in my experience) may require a manual removal of the device and re-install.

    Dick
    "Unrecognized Device" was a mis-speak. The prompt is more like "New Device Detected. Would you like to install drivers?" That said, two of the five converters I have, work fine on any of my four ports. One of them is a Belkin and the other is a FTDI.
    <--- Did someone help you? Please rate their post. The little green squares make us feel really smart!
    If topic has been resolved, please pull down the Thread Tools & mark it Resolved.


    Is VB consuming your life, and is that a bad thing??

  8. #8
    Fanatic Member
    Join Date
    Mar 2009
    Posts
    739

    Re: MSComm connection for USB-to-Serial Port

    Quote Originally Posted by max125 View Post
    But both fail to receive anything from COM2
    I'm working on a problem at the moment with a USB adapter based on the Texas Instruments (TI) USB/RS232 chipset. Sends just fine but doesn't receive anything using MSComm.

    Would you know what drivers are installed ? Is it TI ? (DeviceManager > Ports etc)

    Do what DickGrier said - make sure you have the latest drivers and the problem may just go away - and then please come back and tell me if it was a TI adapter.
    Last edited by IanS; Apr 28th, 2010 at 12:50 PM.

  9. #9

    Thread Starter
    New Member
    Join Date
    Apr 2010
    Posts
    13

    Re: MSComm connection for USB-to-Serial Port

    Guys,
    Sorry for delayed reply...


    I have solved the issue, The issue was with DTR & RTS signals
    In most of USB to Serial converter theses signals donot auto switch


    So if we can switch it while sending data on port.

    The Issue can be resolved


    With Port2
    .DTREnable = False
    .RTSEnable = True
    End With

    **** Send Data

    With Port2
    .RTSEnable = False
    .DTREnable = True
    End With


    Thanks all for Their time, also discussion between "Masters", This really helps to new bees like me!

  10. #10
    PowerPoster CDRIVE's Avatar
    Join Date
    Jul 2007
    Posts
    2,620

    Re: MSComm connection for USB-to-Serial Port

    Quote Originally Posted by max125 View Post
    Guys,
    Sorry for delayed reply...

    I have solved the issue, The issue was with DTR & RTS signals
    In most of USB to Serial converter theses signals donot auto switch
    FYI, these two properties don't auto switch when using a hardware serial port either. They're not intended to.
    <--- Did someone help you? Please rate their post. The little green squares make us feel really smart!
    If topic has been resolved, please pull down the Thread Tools & mark it Resolved.


    Is VB consuming your life, and is that a bad thing??

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width