0

I am trying to read data from GE-PQM II energy meter. Energy meter supports real time monitoring via 2 wire RS-485 MODBUS connection. I use libmodbus library in c to read modbus registers.

In GE communication guide (https://www.ccontrols.com/support/dp/GEK-113532.pdf) the address of the register are given in hexadecimal. I converted hex to decimal.

I am trying to read values from modbus register (02F0,02F1) - corresponding decimal values are 752,753

GE-PQM sample

My code:

rc = modbus_read_registers(ctx, 752, 753, clock);

output :

ERROR Too many registers requested (753 > 125)
Too many data

Anything wrong in hex conversion ? or some where else?

Support Ukraine
  • 42,271
  • 4
  • 38
  • 63
Leaner
  • 1
  • 1
  • Did you actually read the [documentation for modbus_read_registers](http://www.unix.com/man-page/debian/3/modbus_read_registers/)? When there is an error, the first thing to do should be to consult the documentation. Check what the third parameter is supposed to be. – kaylum Jul 02 '16 at 07:25
  • If you use this [libmodbus](http://libmodbus.org/), so in function call `int modbus_read_registers(modbus_t *ctx, int addr, **int nb**, uint16_t *dest);` parameter `nb` is number of register for read and it must be equal 2 and not 753. – imbearr Jul 02 '16 at 07:42
  • Thanks for the answer !! – Leaner Jul 02 '16 at 07:58
  • It my fault that i missed it. – Leaner Jul 02 '16 at 08:00
  • No need to convert to decimal either, just use 0x2F0 for address. – Mark Tolonen Jul 02 '16 at 11:13

1 Answers1

0

If you use this libmodbus, so in function call

int modbus_read_registers(modbus_t *ctx, int addr, int nb, uint16_t *dest);
parameter nb is number of register for read and it must be equal 2 and not 753. – imbearr
Armali
  • 18,255
  • 14
  • 57
  • 171