0
votes

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?

1
Did you actually read the documentation for 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
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
Thanks for the answer !!Leaner
It my fault that i missed it.Leaner
No need to convert to decimal either, just use 0x2F0 for address.Mark Tolonen

1 Answers

0
votes

If you use this libmodbus, so in function call

int modbus_read_registers(modbus_t *ctx, int addr, int nb, uint16_t *dest);
nb