Modbus protocol error

Hello,
I am testing Schneider Modbus protocol with arduino. I used ModbusMaster.h library for arduino and I used RS485 module for Modbus communication. After uploaded the program to the arduino to read the data, I got response timeout error. I cannot fix it. Help me out!

How many serial ports does your Arduino have, think carefully ?
You a computer connected to the Arduino, correct ?
You have a TIA-485 module connected to the Arduino, correct ?

I'm sure you will see where the problem is :slight_smile:

And your Schneider PM1200 is a "real" ModBus device so it uses a parity bit on the serial interface:

Fast 16 ms power meter response, average time to read 10 parameters is
90 to 100 ms (9600 Baud, Even parity, One stop bit). (page 47 of the manual)

Your serial port initialization has to be changed from

Serial.begin(9600);

to

Serial.begin(9600, SERIAL_8E1);

Just to rule out your next idea: SoftwareSerial is not able to provide a parity bit so must use the hardware serial interface.