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. COM port problem

COM port problem

Scheduled Pinned Locked Moved C#
csharpcomhelp
7 Posts 4 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.
  • R Offline
    R Offline
    Reza Shojaee
    wrote on last edited by
    #1

    Hi I need send and receive information from "single COM port" to "2 COM port", We know COM has 9 pin and with only 3 pin you can send & receive into one device. So physically this is possible. and I want to know how can implement with C#.

    Best Regards, Reza Shojaee

    OriginalGriffO L I 4 Replies Last reply
    0
    • R Reza Shojaee

      Hi I need send and receive information from "single COM port" to "2 COM port", We know COM has 9 pin and with only 3 pin you can send & receive into one device. So physically this is possible. and I want to know how can implement with C#.

      Best Regards, Reza Shojaee

      OriginalGriffO Offline
      OriginalGriffO Offline
      OriginalGriff
      wrote on last edited by
      #2

      How to use COM port in C#[^] Sorry - didn't understand your question properly. My bad.

      No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced. This message is made of fully recyclable Zeros and Ones

      modified on Saturday, October 31, 2009 7:44 AM

      "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
      "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

      1 Reply Last reply
      0
      • R Reza Shojaee

        Hi I need send and receive information from "single COM port" to "2 COM port", We know COM has 9 pin and with only 3 pin you can send & receive into one device. So physically this is possible. and I want to know how can implement with C#.

        Best Regards, Reza Shojaee

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        I don't know how to split COM port, but I don't think it's possible. The only way is using RS485 Modbus, the interface is like RS232, in RS485 you can send your data to all clients just with device address in the first in your byte array. That means your clients must have a number, for example client1 and client2. You can use SerialPort class also.

        1 Reply Last reply
        0
        • R Reza Shojaee

          Hi I need send and receive information from "single COM port" to "2 COM port", We know COM has 9 pin and with only 3 pin you can send & receive into one device. So physically this is possible. and I want to know how can implement with C#.

          Best Regards, Reza Shojaee

          OriginalGriffO Offline
          OriginalGriffO Offline
          OriginalGriff
          wrote on last edited by
          #4

          Having read the Stancrm post, I see what you are trying to do. If you connect two external machines to a single RS232 port, it may work. RS232 is intended for point to point work, not multidrop and its electrical specification is designed for just that. Certainly, the two devices will be able to hear anything you transmit on the port, (at least until the distances from the source port get too big) but it is unlikely that transmissions into the port from one of two connected devices will work - it may, but it will depend on the design of the hardware connected to the port and the physical tollerances of the components. (i.e. it may work with these two devices, but if one of them is changed for an identical model it may not, or it may work but only intermittently). I would really consider why you are doing this, and look at better technology for it, such as RS485 or USB.

          No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced. This message is made of fully recyclable Zeros and Ones

          "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
          "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

          R 1 Reply Last reply
          0
          • OriginalGriffO OriginalGriff

            Having read the Stancrm post, I see what you are trying to do. If you connect two external machines to a single RS232 port, it may work. RS232 is intended for point to point work, not multidrop and its electrical specification is designed for just that. Certainly, the two devices will be able to hear anything you transmit on the port, (at least until the distances from the source port get too big) but it is unlikely that transmissions into the port from one of two connected devices will work - it may, but it will depend on the design of the hardware connected to the port and the physical tollerances of the components. (i.e. it may work with these two devices, but if one of them is changed for an identical model it may not, or it may work but only intermittently). I would really consider why you are doing this, and look at better technology for it, such as RS485 or USB.

            No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced. This message is made of fully recyclable Zeros and Ones

            R Offline
            R Offline
            Reza Shojaee
            wrote on last edited by
            #5

            About possibility or no, I saw this configuration physically & with delphi software. About using USB or RS485, My devices work with RS232.

            Best Regards, Reza Shojaee

            OriginalGriffO 1 Reply Last reply
            0
            • R Reza Shojaee

              About possibility or no, I saw this configuration physically & with delphi software. About using USB or RS485, My devices work with RS232.

              Best Regards, Reza Shojaee

              OriginalGriffO Offline
              OriginalGriffO Offline
              OriginalGriff
              wrote on last edited by
              #6

              You can buy RS232 - RS485 converters from about £5 - don't know how good they are. Similarly RS232 - USB converters, but they are more expensive. Either solution would work better and be more reliable than multidrop RS232.

              No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced. This message is made of fully recyclable Zeros and Ones

              "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
              "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

              1 Reply Last reply
              0
              • R Reza Shojaee

                Hi I need send and receive information from "single COM port" to "2 COM port", We know COM has 9 pin and with only 3 pin you can send & receive into one device. So physically this is possible. and I want to know how can implement with C#.

                Best Regards, Reza Shojaee

                I Offline
                I Offline
                idan_bismut
                wrote on last edited by
                #7

                You'll need hardware that can allow to use pre-defined pin(s) as RX/TX. For most standard uart hardware cards, the UART COM is usings pins #2/#3 (for RS-232). The other pins are used for RS-422/485 & handshake (RTS/CTS etc.) purpose. If you have any FPGA & VHDL knowledge, you could code yourself some generic UART module that can handle 2 rs-232 on different pins assignments. and then use it as "middle-box" to communicate via it. Could be some1 made such product already...

                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