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 / C++ / MFC
  4. Ethernet code for talking to Hardware I/O

Ethernet code for talking to Hardware I/O

Scheduled Pinned Locked Moved C / C++ / MFC
c++hardware
6 Posts 5 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.
  • M Offline
    M Offline
    Mike Grove
    wrote on last edited by
    #1

    I need to write some code (using C++/VS2010/Windows7), that can talk to a hardware I/O module (PhoenixContact Axioline F Bus Coupler) which is connected via Ethernet and, as usual, have never done this before. I just need someone to point me in the right direction so I can get started, if possible please... There's plenty of stuff on MSDN, eg.

    Quote:

    Getting Started with Winsock

    , but I don't have the confidence to dive right in just yet.

    C L J A 4 Replies Last reply
    0
    • M Mike Grove

      I need to write some code (using C++/VS2010/Windows7), that can talk to a hardware I/O module (PhoenixContact Axioline F Bus Coupler) which is connected via Ethernet and, as usual, have never done this before. I just need someone to point me in the right direction so I can get started, if possible please... There's plenty of stuff on MSDN, eg.

      Quote:

      Getting Started with Winsock

      , but I don't have the confidence to dive right in just yet.

      C Offline
      C Offline
      CPallini
      wrote on last edited by
      #2

      Actually "Getting Started with Winsock" is a great resource, in my opinion. You could try the examples to get acquainted. However, knowing how socket works on Windods, could be not enough. You probably should have a look at the open source project "Simple Open EtherCAT master"[^] (I know it's Linux).

      Veni, vidi, vici.

      1 Reply Last reply
      0
      • M Mike Grove

        I need to write some code (using C++/VS2010/Windows7), that can talk to a hardware I/O module (PhoenixContact Axioline F Bus Coupler) which is connected via Ethernet and, as usual, have never done this before. I just need someone to point me in the right direction so I can get started, if possible please... There's plenty of stuff on MSDN, eg.

        Quote:

        Getting Started with Winsock

        , but I don't have the confidence to dive right in just yet.

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

        Winsock is just a thin wrapper around basic internet sockets, the latter being quite simple to use. Take a look at Programming Windows TCP Sockets in C++ for the Beginner[^], or any of the links at https://www.google.com/search?q=sockets+c%2B%2B[^].

        Veni, vidi, abiit domum

        M 1 Reply Last reply
        0
        • L Lost User

          Winsock is just a thin wrapper around basic internet sockets, the latter being quite simple to use. Take a look at Programming Windows TCP Sockets in C++ for the Beginner[^], or any of the links at https://www.google.com/search?q=sockets+c%2B%2B[^].

          Veni, vidi, abiit domum

          M Offline
          M Offline
          Mike Grove
          wrote on last edited by
          #4

          Thanks Richard - I'm particularly interested in that 'Beginner' link... :-D

          1 Reply Last reply
          0
          • M Mike Grove

            I need to write some code (using C++/VS2010/Windows7), that can talk to a hardware I/O module (PhoenixContact Axioline F Bus Coupler) which is connected via Ethernet and, as usual, have never done this before. I just need someone to point me in the right direction so I can get started, if possible please... There's plenty of stuff on MSDN, eg.

            Quote:

            Getting Started with Winsock

            , but I don't have the confidence to dive right in just yet.

            J Offline
            J Offline
            jschell
            wrote on last edited by
            #5

            Mike Grove wrote:

            I can get started

            1. Learn basic TCP programming (TCP is probably what you need). You can do this using nothing but your computer. 2. Research the protocol of the device that you want to talk to. 3. Insure that you have a connection between your computer at the device. 4. Using 1, create code based on the information from 2 to actually send and receive from the device.

            1 Reply Last reply
            0
            • M Mike Grove

              I need to write some code (using C++/VS2010/Windows7), that can talk to a hardware I/O module (PhoenixContact Axioline F Bus Coupler) which is connected via Ethernet and, as usual, have never done this before. I just need someone to point me in the right direction so I can get started, if possible please... There's plenty of stuff on MSDN, eg.

              Quote:

              Getting Started with Winsock

              , but I don't have the confidence to dive right in just yet.

              A Offline
              A Offline
              Albert Holguin
              wrote on last edited by
              #6

              I've actually done this a few times in my life, it's not any more difficult than having an API for two pieces of software to communicate across. Usually on the hardware side, they'll implement a regular ethernet stack so they follow all the same rules and guidelines that you do on the PC software side. As a matter of fact, most people usually buy an Ethernet "core" that gives them the functionality without implementing it themselves, same as you using the Winsock library. The only trick is really understanding the bytes received and what they mean (just an exercise in arranging structures and casting bytes).

              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