• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1645
  • Last Modified:

Ethernet communication

Hi, I am doing interfacing to machinery using through Ethernet port. On hardware part, I do have all the commands send and receive.

Can anyone help how to send command using ethernet port and read in C#. Is that similiar as com port?
0
Rama Tito
Asked:
Rama Tito
  • 3
  • 3
1 Solution
 
Jaime OlivaresSoftware ArchitectCommented:
You need to learn about Socket Client programming:
http://msdn.microsoft.com/en-us/library/bew39x2a.aspx

connect to your machine's IP address and port and use the read and write operations provided in the example.
0
 
Rama TitoProgrammerAuthor Commented:
Hi, thank you for the link given,

I am looking for basic way to develop it. the links make me a bit confuse. Basically in comm port communication

Set the parameters (baudrate, parity, etc)
then open port
send something
receive something
close port.

i looking for simplest method to develop it, can some one guide me.
0
 
Dave BaldwinFixer of ProblemsCommented:
If it is really an Ethernet network connection, you need to use the info in the link above.  The Ethernet Network port belong to Windows and you have to use their drivers to communicate thru them.  If it is really a 'serial port' on an 8 position RJ45 connector, then you got the info in your previous questions.
0
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
Jaime OlivaresSoftware ArchitectCommented:
I don't think it can be easier. The socket programming model is event-driven, so it won't be as linear as serial port programming could be. btw, serial port programming can be event-driven as well.
0
 
Rama TitoProgrammerAuthor Commented:
Hi, thank you for the advice. I did try out to send command using C# form. I did insert command in textbox1 and by clicking send should receive result in textbox2. Please do guide me up here.
0
 
Jaime OlivaresSoftware ArchitectCommented:
Are you trying with two machines?
0
 
Rama TitoProgrammerAuthor Commented:
Hi, i am trying between pc and machine.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: MCSA MCSE Windows Server 2012

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now