Problem in Modbus slave device not sending any data

I have loaded this program and when it runs it shows no data on the virtual terminal in Proteus
this is the program

#include <ModbusRtu.h>
// data array for modbus network sharing
uint16_t au16data[16] = {
3, 1415, 9265, 4, 2, 7182, 28182, 8, 0, 0, 0, 0, 0, 0, 1, -1 };

/**

  • Modbus object declaration
  • u8id : node id = 0 for master, = 1…247 for slave
  • u8serno : serial port (use 0 for Serial)
  • u8txenpin : 0 for RS-232 and USB-FTDI
  • or any pin number > 1 for RS-485
    */
    Modbus slave(1,0,0); // this is slave @1 and RS-232 or USB-FTDI
    void setup() {
    slave.begin( 19200 ); // baud-rate at 19200
    }
    void loop() {
    slave.poll( au16data, 16 );
    }

Have any one worked on this library and got success?

Modbus-Master-Slave-for-Arduino-master.zip (200 KB)

[code]#include [/code]What's that?

Jayesh023: I have loaded this program and when it runs it shows no data on the virtual terminal in Proteus

A modbus slave waits for a master to send data, so of course it won't output data without a request.

You'll need a Modbus master to send data, either use a PC program or another Arduino.