Arduino Xbee communication using Xbee Shield

Hi all, i have this configuration in my zigbee network:

1- Coordinator: Xbee series 2 connect with Xbee Board USB in my computer
1- Router: Arduino Uno + Xbee Shield + Xbee Series2

I set PANID and the address in correct way, my xbee are setting usi API mode.

I want to try to send a simple packet from router to coordinator but when i try to send somethings using Arduino monitor serial, my coordinator dont receive anything in its console.

This is my code:

// We'll use SoftwareSerial to communicate with the XBee:
#include <SoftwareSerial.h>
// XBee's DOUT (TX) is connected to pin 2 (Arduino's Software RX)
// XBee's DIN (RX) is connected to pin 3 (Arduino's Software TX)
SoftwareSerial XBee(2,3); // RX, TX

void setup()
{
  // Set up both ports at 9600 baud. This value is most important
  // for the XBee. Make sure the baud rate matches the config
  // setting of your XBee.
  XBee.begin(115200);
  Serial.begin(115200);
}

void loop()
{
  if (Serial.available())
  { // If data comes in from serial monitor, send it out to XBee
    XBee.write(Serial.read());
  }
  if (XBee.available())
  { // If data comes in from XBee, send it out to serial monitor
    Serial.write(XBee.read());
  }
}

Thanks all for support

my xbee are setting usi API mode.

But your code assumes that they are in AT mode.

I'm fairly sure you need to be in AT mode to just print to serial.

Thanks for reply, i fix my code and now it works using XBee.h library:

// We'll use SoftwareSerial to communicate with the XBee:
#include <XBee.h>
XBee xbee = XBee();
uint8_t payload[] = { '5','7' };
XBeeAddress64 addr64 = XBeeAddress64(0x0013A200, 0x40FC875B);
void setup() {
Serial.begin(9600);
xbee.setSerial(Serial);
}

void loop() {
 ZBTxRequest zbTx = ZBTxRequest(addr64, payload, sizeof(payload));
 xbee.send(zbTx);
 delay(10000000);
}

It is possible to send AT commands using a sketch like this?

You can send AT commands when you are using AT mode.

Can i send an AT command from a AT router to and API coordinator?

The XBee that you are sending AT commands to must be in AT mode. Is that so hard to understand?

Sorry i comment two times similar because i dont see the first comment and i think that it isnt post.

I am studying XBee-arduino library available on GitHub, so i see this type of variable.

RemoteAtCommandRequest remoteAtRequest = RemoteAtCommandRequest ();

I suppose that, usign this type, i can send AT command usi API mode because this library is created for using ZigBee network in API mode. It is correct?