Ethernet code for talking to Hardware I/O
-
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.
-
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.
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.
-
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.
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
-
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
Thanks Richard - I'm particularly interested in that 'Beginner' link... :-D
-
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.
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.
-
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.
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).