Arduino Modbus Master code to read data using arduino uno from EB meter

Hi,

I have on energy meter which is providing MODBUS output .I am writing modbus master code for read values from energy meter.

i want to monitor Register number 400021 and 400022 for control relays.Based on those two register value,I will enable /disable the relay's.

My questions is,modbus master code is correct or not and how to read particular register values.

#include <ModbusRtu.h>

uint16_t au16data[16]; //!< data array for modbus network sharing
uint8_t u8state; //!< machine state
uint8_t u8query; //!< pointer to message query

Modbus master(0,0,0); // this is master and RS-232 or USB-FTDI

modbus_t telegram[2];

unsigned long u32wait;

void setup() {
// telegram 0: read registers
telegram[0].u8id = 1; // slave address
telegram[0].u8fct = 3; // function code (this one is registers read)
telegram[0].u16RegAdd = 0; // start address in slave
telegram[0].u16CoilsNo = 4; // number of elements (coils or registers) to read
telegram[0].au16reg = au16data; // pointer to a memory array in the Arduino

// telegram 1: write a single register
telegram[1].u8id = 1; // slave address
telegram[1].u8fct = 6; // function code (this one is write a single register)
telegram[1].u16RegAdd = 4; // start address in slave
telegram[1].u16CoilsNo = 1; // number of elements (coils or registers) to read
telegram[1].au16reg = au16data+4; // pointer to a memory array in the Arduino

master.begin( 19200 ); // baud-rate at 19200
master.setTimeOut( 5000 ); // if there is no answer in 5000 ms, roll over
u32wait = millis() + 1000;
u8state = u8query = 0;
}

void loop() {
switch( u8state ) {
case 0:
if (millis() > u32wait) u8state++; // wait state
break;
case 1:
master.query( telegram[u8query] ); // send query (only once)
u8state++;
u8query++;
if (u8query > 2) u8query = 0;
break;
case 2:
master.poll(); // check incoming messages
if (master.getState() == COM_IDLE) {
u8state = 0;
u32wait = millis() + 1000;
}
break;
}

au16data[4] = analogRead( 0 );

}

when I am printing au16data[],its showing 000000769.I don't get any value from modbus master.When I am checking salve usin Mtester,I can able view slave data