READ MODBUS

Hello everyone.
I have big problem and I need your help …
I have an RCM 3900 and I connect via an RS485 logger: Slave address 7, Baud Rate: 9600, Data Length: 8, Stop Bit = 1, Parity = No Parity

I’d like to read this register through the library MODBUS_MASTER.lib (MBM_ReadRegs). After I wrote this program but it does not work. Can someone help me, please?

#define Mesure
#define MODBUS_DEBUG_PRINT 0 // define to 1 to print transactions
#define CINBUFSIZE 15
#define COUTBUFSIZE 15
#define MODBUS_PORT C

#define _RS485 485
#define SERIAL_PORT_MODE _RS485
#use modbus_master.lib
#use “rcm39xx.lib”

int MBM_Send_ADU ( char *Packet, int ByteCount );
int MBM_Rcv_Resp ( char * Packet );
void serInit ( void );

main ()
{ int i,a, RegsValue[50];
serInit();
i = MBM_ReadRegs ( 7, &RegsValue[0], 0xC55E, 4 ); // read reg 0
a =MB_SUCCESS;
if (a==0)
printf(“Connexion NON OK”);
else printf(“Connexion OK”);
printf("%d, %d,
", RegsValue[1], RegsValue[2]);
while (1);
}

void serInit ( void )
{ serCopen (9600 ); // open the serial port
}

/* START FUNCTION DESCRIPTION ********************************************
MBM_Send_ADU
END DESCRIPTION **********************************************************/

int MBM_Send_ADU ( char *Packet, int ByteCount )
{ auto unsigned CRCvalue;
auto unsigned long Endtime;
int i;

// insert CRC
CRCvalue = MODBUS_CRC ( Packet, ByteCount );
Packet[ByteCount+1] = CRCvalue; // store low byte
Packet[ByteCount] = CRCvalue>>8; // store high byte
ByteCount+=2; // adjust for CRC

#ifdef MODBUS_DEBUG_PRINT & 1
printf ( “Tx:” );
for ( i=0; i