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. C#
  4. ethernet comm instead of serial

ethernet comm instead of serial

Scheduled Pinned Locked Moved C#
question
4 Posts 2 Posters 1 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.
  • F Offline
    F Offline
    faladrim
    wrote on last edited by
    #1

    hi i have an app running with serial comm. i read my comport for data that i send via an antenna, but to read it serial takes to long so i was thinking to use wireless ethernet. but i have no clue how this works is it simelar to serialport? and were can i find samples for this? ive been looking on the net but i didnt find what i was looking for. any ideas thx

    E 1 Reply Last reply
    0
    • F faladrim

      hi i have an app running with serial comm. i read my comport for data that i send via an antenna, but to read it serial takes to long so i was thinking to use wireless ethernet. but i have no clue how this works is it simelar to serialport? and were can i find samples for this? ive been looking on the net but i didnt find what i was looking for. any ideas thx

      E Offline
      E Offline
      Ed Poore
      wrote on last edited by
      #2

      faladrim wrote:

      is it simelar to serialport?

      It can be and then again it might not.:~ Can you provide some more details as to the application? Regarding the C# side of things both SerialPort & TcpClient or whatever you use to access the TCP/IP side of things will derive from System.IO.Stream so there shouldn't be too much to change on that side of things. But then again it depends completely on what the application is trying to do.


      I have no idea what I just said. But my intentions were sincere.

      F 1 Reply Last reply
      0
      • E Ed Poore

        faladrim wrote:

        is it simelar to serialport?

        It can be and then again it might not.:~ Can you provide some more details as to the application? Regarding the C# side of things both SerialPort & TcpClient or whatever you use to access the TCP/IP side of things will derive from System.IO.Stream so there shouldn't be too much to change on that side of things. But then again it depends completely on what the application is trying to do.


        I have no idea what I just said. But my intentions were sincere.

        F Offline
        F Offline
        faladrim
        wrote on last edited by
        #3

        well with a microprocessor i send data to my pc first i used a serial wire, but later i used two antennas to establish the communication i made some sort of protocol to send my data u know with a header and an end... so if i read the data in my pc it takes over 10 min to read all the data im sending and that is not so mutch. i have no idea to fasten this up so i thought i maybe could use ethernet because this transfers data mutch faster than serial but i have no idea how i can read this in my app now this is port.readchart() but i have no idea to start comm with ethernet. thx for the help :)

        E 1 Reply Last reply
        0
        • F faladrim

          well with a microprocessor i send data to my pc first i used a serial wire, but later i used two antennas to establish the communication i made some sort of protocol to send my data u know with a header and an end... so if i read the data in my pc it takes over 10 min to read all the data im sending and that is not so mutch. i have no idea to fasten this up so i thought i maybe could use ethernet because this transfers data mutch faster than serial but i have no idea how i can read this in my app now this is port.readchart() but i have no idea to start comm with ethernet. thx for the help :)

          E Offline
          E Offline
          Ed Poore
          wrote on last edited by
          #4

          First I would try using some form of simple compression algorithm to see if you can shrink the data first if this is viable. It'll be simpler than changing the hardware. A second alternative would be to try and find a USB module for the microprocessor, there are drivers available for Windows which make the USB port then look like a very high speed serial port. Nothing would need to be changed in the code except for the baud rate to reflect the change in speed. Thirdly, to read data over an ethernet connection you need to establish a connection using the System.Net.(Sockets?.)TcpClient class. Basically you connect to a specific IP address and port number and the TcpClinet is inherited from System.IO.Stream so you can create a StreamReader / Writer, BinaryReader / Writer etc from this to read in the data however you want. E.g. (this is off the top of my head so I can't verify it's accuracy)

          TcpClient micro = new TcpClient(ipAdressOfMicro, portNumber);
          StreamReader microInput = new StreamReader(micro.BaseStream);
          // Read in a line of text from the micro
          string line = microInput.ReadLine();


          I have no idea what I just said. But my intentions were sincere.

          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