Data transfer from PC (app developed using VC++) to Arduino and vice versa

I am doing a project on Satellite Tracking.
I am in need of methodology to transfer Azimuth and Elevation data from PC software to Arduino via ethernet.
How to write code such that both PC software and Arduino send and receive data??
Can anyone help me????

I am in need of methodology to transfer Azimuth and Elevation data from PC software to Arduino via ethernet.

First, is the Arduino going to be a server, responding to GET requests? Or, is it going to be a client, making GET requests?

If the Arduino is a server, having the PC software make a GET request is relatively easy. The Arduino can do whatever you want in an effort to satisfy the GET request.

If the Arduino is a client, you need a server for it to make GET requests to, and some way for the PC to provide the data that the server needs.

Paul,
I want to make PC as server and Arduino as Client. I have to send data from an application to Arduino.

I have to send data from an application to Arduino.

You don't seem to understand how clients and servers work.

A server can not push data to a client. All it can do is respond when a client asks for data.

A server has to have access to some data in order to be useful.

The client (the Arduino) will ask the server for data, by executing a script on the server, and possibly passing in data. The server will analyze that optional data in determining the correct response.

In your case, the script on the server will need access to some data. Where will that script get Azimuth and Elevation data?

Dear Paul,

Finally I was able to transfer data from PC to Arduino. With some modifications in my PC app code and with a slight modification(Set Server IP address) in WebClient example I was able to receive data.

But I have an issue with it. I sent data e.g. : <123.5673@-56.3453> like this. But when I read, I get only <123 .
I modified code as given in http://forum.arduino.cc/index.php?topic=120514.0. Still I get only 123.

while(client.available() > 0)
  {
    char inChar = client.read();
    if(inChar == SOP)
    {
       index = 0;
       inData[index] = '\0';
       started = true;
       ended = false;
    }
    else if(inChar == EOP)
    {
       ended = true;
       break;
    }
    else
    {
      if(index < 79)
      {
        inData[index] = inChar;
        index++;
        inData[index] = '\0';
      }
    }
Serial.print(indata);
  }

Is there any problem with the code???

Is there any problem with the code????

Yes. Data arrives slower than the Arduino can read it. Only the "123" part has arrived when the while loop starts. The while loop reads that data, and ends before any more data arrives.

You need that while loop in a while(client.connected()) loop.

You need to move the Serial.print() statement after the while(client.connected()) loop.

Dear Paul,
Sorry I dint mention this earlier.
The value sent from server changes every second. i.e the server will send data every second through a timer.
I modified the code as you said but still I get only first 3 characters.
Also the (int x = client.available():wink: received size is only 3.