Arduino RS 485 Serial Communication

Hi everyone, I bought a pair of arduino just yesterday, and I am trying to communicate two arduinos with a RS 485 Serial Communication, one arduino is reading a potenciometer and send the data to the other one who changes the speed of an animations with leds.
I have read a lot of post about this topic and i am planning to do this schematic
http://johanneskinzig.de/_Media/arduinors485_schaltplan_med_hr.jpeg

then i got this code:
Server:

void loop() 
{
  // send message to slave ("A") with different value
  for (int i = 0; i < 5; i++)
  {
    switch (i) 
    {
      case 0 : Serial.println("A1000"); break;
      case 1 : Serial.println("A0100"); break;
      case 2 : Serial.println("A0010"); break;
      case 3 : Serial.println("A0001"); break;
    }
    delay(2000);
  }
}

and Slave

 while (Serial.available())
  {
    // get the new byte:
    char inChar = (char)Serial.read(); 
    // add it to the inputString:
    inputString += inChar;
    // if the incoming character is a newline, set a flag
    // so the main loop can do something about it:
    if (inChar == '\n')
    {
      stringComplete = true;
    } 
  }

i also learned that i have to set D13 high or low if i want to send or receive, that is clear for me,
but i dont understand how to use Serial.avaliable, acording with the documentation that function returns 1 when there is some new Data on Port
so if i want to send a message to the server saying sarcastically "hey!, im ready which is he speed?" the server need to have the Serial.avaliable and then we should respond "speed is XX" so now slave has to have the line Serial.avaliable ?
how do i create a good comunication protocol?
thanks

Zouzan:
how do i create a good comunication protocol?

Use a packet format.

Each packet should start with a fixed byte-sequence and have a fixed byte-sequence at / near the end. The fixed bytes help immensely with resynchronization and framing. I like the Optomux fixed bytes: ">" to start "\r" to end.

Each packet should include a checksum. My personal favourite is CRC-16. Choose based on your needs.

Each packet should include a reasonable number of bytes for the source address and the destination address. In your case, they are not important. As soon as you add a third node to your network the destination address will become very important. As soon as you need internetwork routing the source address will become very important. Put them in now or lose your hair later.

Each packet should have a fixed byte-sequence that can be used for future expansion. A single zero filled byte is an excellent choice. Including this allows you to extend / alter the packet format by using an unexpected value (a non-zero byte in my example).

Optionally include space for control information for things like acknowledgements.

Optionally include space for a sequence number to facilitate large transfers.

Each packet should include a length. Either the overall length of the packet or the length of the payload. I prefer the length of the payload.

Finally, the payload is whatever data you want to transfer.