Control PinMode and Delay from PC through Xbee Not Working

This is what I am doing,

I have an Xbee connected to PC through Explorer USB. I am trying to send command to an arduino connected with Xbee too in the following format, for example,
"O6000",
Which means the pin 8 will output high (Open) for 6000ms.

However, I dont know why, this code doesnt not work out, when I connect the Xbee to PC, I keep getting rubbish information on my console log even I suppose there is no output to be transmitted from Arduino side.

char Array[6];
boolean newdata=false;
char endMarker = '\n';
char rc;
int count=0;
int SOLENOID=8;
int duration;
void setup()
{
Serial.begin(9600);
}

void loop()
{
while (Serial.available() > 0 && newdata == false) {
char rc = Serial.read();

if (rc != endMarker) {
Array[count] = rc;
count++;
}
else {
Array[count] = '\0'; // terminate the string
count = 0;
newdata = true;
}
}
Serial.println(Array);
if (Array[1]=='O'){
digitalWrite(SOLENOID, HIGH);
duration=(Array[2]-'0')*1000+(Array[3]-'0')*100+(Array[4]-'0')*10+(Array[5]-'0');
delay(duration);
}
}

This is my code. Anyone got an idea?

If you don't KNOW that the Arduino, via the XBees, got good data, why are you trying to use the data?

What kind of XBees are they? How are they configured?

How is the XBee connected to the Arduino?

What app on the PC is sending/receiving data to the serial port that the XBee is connected to?

What kind of "garbage output"?

Array indices start at 0. The O should be in position 0, not position 1.