![modbus rtu master modbus rtu master](https://i.ytimg.com/vi/kAywwvvalwo/maxresdefault.jpg)
When this mark is shown, it is sign of that the communication settings is right, so data, parity bit, stop bit & baudrate is OK (data has successfully reached the dest. Most of the devices which is using RS485 and ModBus protocol (and have an some kind of display) shows an communication (over 485 & modbus) on display by some kind of mark, for example in my case it was an "dot" which blinks when there's an communication. I thought that this library already give 0x before address, because i didn't see it anywhere with 0x before.Īn advice for people with the same problems: I only checks A & B cables (tried a new one) and change address of register from 5000 to 0x5000 and now it works.
#Modbus rtu master software#
I have tried to connect rs485 module with USB2TTL to pc and run software called "qModMaster" and it works, but with arduino it doesn't work. I have tried to change adrress of holding register to 0x5000 or 5002, tried changing number of registers.
![modbus rtu master modbus rtu master](https://2.bp.blogspot.com/-yshnaeqijBo/VvHccHbfI-I/AAAAAAAAAhY/f7zqYfDuiDc8PHXp1ym2lJ-Ui5stbYEQw/s1600/Arduino%2Bgt01.jpg)
I also using an 15cm twisted pair cable UTP. I should mention that there is only A and B screw terminals on power meter, so i have no option to make common ground connection. Unsigned long temp = (unsigned long)regs = interval)ĪltSerial.println(packets.exception_errors) ĪltSerial.println(packets.failed_requests) ĪltSerial.print("Successful requests: ") ĪltSerial.println(packets.successful_requests) Īnd i have got only this output in the pc (its repeating of course): -Īltserial library i am using together with USB2TTL convertor on pins 8 & 9, Modbus_configure(&Serial, baud, SERIAL_8E1, timeout, polling, retry_count, T圎nablePin, packets, TOTAL_NO_OF_PACKETS, regs) Modbus_construct(&packets, 5, READ_HOLDING_REGISTERS, 5000, 2, 0) //initialize packet Unsigned int regs // master register array struct packetPointer packet1 = &packets Packet packets // array of Packets to be configured TOTAL_NO_OF_PACKETS // leave this last entry #define TOTAL_NO_OF_REGISTERS 1// number of registers to poll for: #define polling 500 // modbus scan rate in mSec: #define timeout 1000 // modbus timeout in mSec: #define T圎nablePin 2 // RS485 modbus direction control pin: I think that with that simple modbus library i went far as i can, but it is still doesn't working, but i see on the display of power meter that there is some try to communication (i see a black dot which shows modbus communication) I have tried " Modbus-Master-Slave-for-Arduino", " ModbusMaster and now at last i am using this " simple-modbus". I have tried using many of ModBus libraries and for now none of them doesn't work. There is also mention about 120 ohms resistor placed by the power meter (but it is 15cm long cable, and even with the resistor there is no change) I should communicate with these paramaters:
#Modbus rtu master manual#
I want for example read an L1 Voltage value, which i know from the manual (page 24 & 25) that this value is stored in "read holding register" with adrress 5002. And i have an problem with communication of this module with power meter