Leaner
Leaner

Reputation: 1

modbus Hex address Conversion

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?

Upvotes: 0

Views: 2003

Answers (1)

Armali
Armali

Reputation: 19385

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

Upvotes: 0

Related Questions