Results 1 to 7 of 7

Thread: Creating a Virtual Serial Port in code

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Aug 2007
    Posts
    97

    Creating a Virtual Serial Port in code

    A question for the vb.net GURU(s) out there. Is there a way I can create a virtual serial port in vb.net in code.

    Basically I want to be able to read what is being written to a com port (which will be the virtual port) reformat what is being written and send it out another com port. This is of course without buying external software or using a driver for this. I've been searching around alot over the internet but could only find external software to do this. Has anyone done this before?


    Thanks in advance

  2. #2
    Lively Member
    Join Date
    Sep 2002
    Posts
    77

    Re: Creating a Virtual Serial Port in code

    Its a bit messy but since there are no other ideas at the moment:

    You could use a third com port with a looping cable so that what goes out of COM1 can be read via COM2 reformatted and sent out of COM3.

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Aug 2007
    Posts
    97

    Re: Creating a Virtual Serial Port in code

    Thanks for the input, yes I also thought of making a special RS232 cable for this but the only problem is that it would take up 2-3 com ports on a computer.

    Do you happen to know if it is even possible using vb.net to utilize only one com port for this?

  4. #4
    Still learning kebo's Avatar
    Join Date
    Apr 2004
    Location
    Gardnerville,nv
    Posts
    3,762

    Re: Creating a Virtual Serial Port in code

    It is possible to make a serial port loop back setup, but I've never done it with rs232, only rs422.

    HTH
    kevin
    Process control doesn't give you good quality, it gives you consistent quality.
    Good quality comes from consistently doing the right things.

    Vague general questions have vague general answers.
    A $100 donation is required for me to help you if you PM me asking for help. Instructions for donating to one of our local charities will be provided.

    ______________________________
    Last edited by kebo : Now. Reason: superfluous typo's

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Aug 2007
    Posts
    97

    Re: Creating a Virtual Serial Port in code

    The loopback is possible but the only issue is that you will still need to use another serial port to send the reformatted information to another device. Which means two com ports are used instead of just one.

    e.g. Com1 transmits to com2, com2 transmits to device.


    But unfortunately the plan was to read data being sent out one com port (the virtual port that I'm wanting to learn how to create).

    Read the data being sent out the virtual port(this may need looping back).

    Reformat the data and send the reformatted data out a physical com port.

    If this is possible then I will be able to use only one com port.

    Any one done this sort of thing before?

  6. #6

    Thread Starter
    Lively Member
    Join Date
    Aug 2007
    Posts
    97

    Re: Creating a Virtual Serial Port in code

    Someone please help

  7. #7
    Fanatic Member Andy_P's Avatar
    Join Date
    May 2005
    Location
    Dunstable, England
    Posts
    669

    Re: Creating a Virtual Serial Port in code

    Take a look at this link, see if it helps:

    http://sourceforge.net/projects/com0com/
    Using Windows XP Home sp3
    Mucking around with C# 2008 Express
    while ( this.deadHorse ) { flog( ); }


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