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. Web Development
  3. ASP.NET
  4. how we read the device which is connected to our system's serial port ?

how we read the device which is connected to our system's serial port ?

Scheduled Pinned Locked Moved ASP.NET
helpquestion
6 Posts 3 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.
  • A Offline
    A Offline
    avika
    wrote on last edited by
    #1

    I have to develop an application, which can able to connect to a GPS device which is connected to serial port in our system and also able to read all the data from the device. Currently I am able to make connection to my system's serial port but not able to connect to that GPS device and also not able to read the data from the device. So in brief problem is that, "how we read the device which is connected to our system's serial port." Please help me out to solve this problem.

    M 1 Reply Last reply
    0
    • A avika

      I have to develop an application, which can able to connect to a GPS device which is connected to serial port in our system and also able to read all the data from the device. Currently I am able to make connection to my system's serial port but not able to connect to that GPS device and also not able to read the data from the device. So in brief problem is that, "how we read the device which is connected to our system's serial port." Please help me out to solve this problem.

      M Offline
      M Offline
      Manas Bhardwaj
      wrote on last edited by
      #2

      avika wrote:

      Please help me out to solve this problem.

      You are in wrong forum. It has nothing to with ASP.Net.

      Manas Bhardwaj Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.

      A 1 Reply Last reply
      0
      • M Manas Bhardwaj

        avika wrote:

        Please help me out to solve this problem.

        You are in wrong forum. It has nothing to with ASP.Net.

        Manas Bhardwaj Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.

        A Offline
        A Offline
        avika
        wrote on last edited by
        #3

        I have to develop this in ASP .Net web application. I got some information regarding to Serial Port classes and methods from MSDN but still not able to get it. Please help me if you have any idea regard to this.

        M D 2 Replies Last reply
        0
        • A avika

          I have to develop this in ASP .Net web application. I got some information regarding to Serial Port classes and methods from MSDN but still not able to get it. Please help me if you have any idea regard to this.

          M Offline
          M Offline
          Manas Bhardwaj
          wrote on last edited by
          #4

          avika wrote:

          I have to develop this in ASP .Net web application.

          AFAIK, this is no ASP.Net thing.

          avika wrote:

          Please help me if you have any idea regard to this.

          Did you look at this[^]?

          Manas Bhardwaj Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.

          1 Reply Last reply
          0
          • A avika

            I have to develop this in ASP .Net web application. I got some information regarding to Serial Port classes and methods from MSDN but still not able to get it. Please help me if you have any idea regard to this.

            D Offline
            D Offline
            DoctorMick
            wrote on last edited by
            #5

            Are you trying to build a web application that connects to the serial port of the clients PC? You won't be able to do that with ASP.net.

            A 1 Reply Last reply
            0
            • D DoctorMick

              Are you trying to build a web application that connects to the serial port of the clients PC? You won't be able to do that with ASP.net.

              A Offline
              A Offline
              avika
              wrote on last edited by
              #6

              I am able to connect to serial port but not able to read the data from the connected device. Here is the code which i am using to read the device- // Create the serial port with basic settings SerialPort port = new SerialPort("COM1", 9600, Parity.None, 8, StopBits.One); port.Handshake = System.IO.Ports.Handshake.None; port.ReadTimeout = 5000; port.Open(); //retrieve number of bytes in the buffer int bytes = port.BytesToRead; //create a byte array to hold the awaiting data byte[] comBuffer = new byte[bytes]; //read the data and store it port.Read(comBuffer, 0, bytes); string str; System.Text.ASCIIEncoding enc = new System.Text.ASCIIEncoding(); str = enc.GetString(comBuffer); txtData.Text = str; port.Close(); when i am running this code then I get 0 in BytesToRead and comBuffer. I think i am doing something wrong but what it is not have any idea.

              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