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. Virtual Com port

Virtual Com port

Scheduled Pinned Locked Moved Visual Basic
comhardwarehelptutorialquestion
10 Posts 2 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.
  • S Offline
    S Offline
    Subjugate
    wrote on last edited by
    #1

    Hi guys i need some help on virtual com port communication. I need to communicate to my external hardware via virtual com port. Now that i already gotten the command line for my hardware i just need to know how can i communicate with it and send the command. Will be greatly thankful if that is any example to allow me to understand better.

    D 1 Reply Last reply
    0
    • S Subjugate

      Hi guys i need some help on virtual com port communication. I need to communicate to my external hardware via virtual com port. Now that i already gotten the command line for my hardware i just need to know how can i communicate with it and send the command. Will be greatly thankful if that is any example to allow me to understand better.

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      Google for "System.Io.Ports.SerialPort" and you'll come up with dozens of examples and documentation.

      A guide to posting questions on CodeProject[^]
      Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
           2006, 2007, 2008

      S 1 Reply Last reply
      0
      • D Dave Kreskowiak

        Google for "System.Io.Ports.SerialPort" and you'll come up with dozens of examples and documentation.

        A guide to posting questions on CodeProject[^]
        Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
             2006, 2007, 2008

        S Offline
        S Offline
        Subjugate
        wrote on last edited by
        #3

        I look up google on the topic, but what they shows are all communication between computer. I cant find any which is communication with hardware.

        D 1 Reply Last reply
        0
        • S Subjugate

          I look up google on the topic, but what they shows are all communication between computer. I cant find any which is communication with hardware.

          D Offline
          D Offline
          Dave Kreskowiak
          wrote on last edited by
          #4

          Talking to an external piece of hardware on a serial port is no different than talking to a PC.

          A guide to posting questions on CodeProject[^]
          Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
               2006, 2007, 2008

          S 1 Reply Last reply
          0
          • D Dave Kreskowiak

            Talking to an external piece of hardware on a serial port is no different than talking to a PC.

            A guide to posting questions on CodeProject[^]
            Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                 2006, 2007, 2008

            S Offline
            S Offline
            Subjugate
            wrote on last edited by
            #5

            Ok, sorry for asking stupid question. But i am quite new to serial communication. Another question i have is why when i Dim Withevents Port as serialPort = New Serialport, is labeled as error as undefined. But i have already imported the library.

            D 1 Reply Last reply
            0
            • S Subjugate

              Ok, sorry for asking stupid question. But i am quite new to serial communication. Another question i have is why when i Dim Withevents Port as serialPort = New Serialport, is labeled as error as undefined. But i have already imported the library.

              D Offline
              D Offline
              Dave Kreskowiak
              wrote on last edited by
              #6

              Did you put this at the top of your code??

              Imports System.Io.Ports
              

              And are you using .NET 2.0 (Visual Studio 2005) or greater?

              A guide to posting questions on CodeProject[^]
              Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                   2006, 2007, 2008

              S 1 Reply Last reply
              0
              • D Dave Kreskowiak

                Did you put this at the top of your code??

                Imports System.Io.Ports
                

                And are you using .NET 2.0 (Visual Studio 2005) or greater?

                A guide to posting questions on CodeProject[^]
                Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                     2006, 2007, 2008

                S Offline
                S Offline
                Subjugate
                wrote on last edited by
                #7

                yes i did.. that's is why i don't understand why the error still appear.

                D 1 Reply Last reply
                0
                • S Subjugate

                  yes i did.. that's is why i don't understand why the error still appear.

                  D Offline
                  D Offline
                  Dave Kreskowiak
                  wrote on last edited by
                  #8

                  I'll repeat my question. Are you using .NET 2.0 (Visual Studio 2005) or greater?

                  A guide to posting questions on CodeProject[^]
                  Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                       2006, 2007, 2008

                  S 1 Reply Last reply
                  0
                  • D Dave Kreskowiak

                    I'll repeat my question. Are you using .NET 2.0 (Visual Studio 2005) or greater?

                    A guide to posting questions on CodeProject[^]
                    Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                         2006, 2007, 2008

                    S Offline
                    S Offline
                    Subjugate
                    wrote on last edited by
                    #9

                    Yes, i am using visual studio 2005.

                    D 1 Reply Last reply
                    0
                    • S Subjugate

                      Yes, i am using visual studio 2005.

                      D Offline
                      D Offline
                      Dave Kreskowiak
                      wrote on last edited by
                      #10

                      Well, there's nothing to add a reference to since the SerialPort class is in System.dll. I have no idea what you're doing wrong. It should be as simple as:

                      Imports System.Io.Ports

                      Public Class MyForm
                      ...
                      Private ComPort As SerialPort = New SerialPort

                      A guide to posting questions on CodeProject[^]
                      Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                           2006, 2007, 2008

                      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