Main Site Documentation

Ethernet communication between a Cobra II and a PC?


Given the following network diagram, what options do we have for machine to machine communication, during production, between the Cobra II and the PC?

Cobra II NET
PC with Windows

We are new to machine to machine (M2M) communication. How do we get started? We assume that there is a wide variety of one-way and two-way communication options between the Cobra and a PC.

That said, what we really need is something to read to ramp up on the M2M communication options available in our particular scenario (above).

Maybe we will use a Socket. In that case, where is the documentation for setting up a Socket between a PC and the Cobra II?

Another idea is to use something like a Client-Server communication through something like TCP. In that case, where is the documentation.

These are just off the top of our heads. What are the various options?


I suggest you start out by reading a book like


@ Mike - Thank you for the book tip, because it gave me the “network programming” search term. Now I can do some Googling.


@ Mike - The one you recommended lead me to this one.

It seems more appropriate for me because

  • my project is in C#,
  • the book has a higher ratio of positive reviews, and
  • it has 175 rather than 580 pages.



In fact there is no real difference to communication between 2 PC’s over Ethernet.
As soon as you have established a connection via Sockets, you have a 2 way serial connection.
You can choose between UDP and TCP protocol.
UDP is connection less.
To send you open a socket and send any data to any IP+port.
For receiving data you open a listening socket which listens on a port.
This is the same for both sides.
Using UDP you need to check for lost or incorrect data by your self.

TCP is a bit different.
The server opens a listening socket and accepts incoming connections.
When accepting a connection you get the 2 way socket to communicate.
The client opens a socket to a listening IP+port.

Since this is the same as on windows .net application, you can use any information source for .net networking.

You can also consider using any higher protocol like Modbus, HTTP, … as well.
But if you can’t find a implementation for windows and NETMF you have to write it yourself.

I’m currently working on a Modbus TCP implementation for windows and NETMF, and will post it in a couple of weeks here on code share.


I would suggest practicing between two programs on a PC first. If this is your first foray into network programming, then having one end be NETMF is only going to lead to frustration, as you deal with the write/debug/deploy/run cycle.

Once you’ve got a solid grasp of the concepts, then move one end of the connection over to the device.