Trying to interpret returned data from energy meter

334 Views Asked by At

I'm trying to read a power meter, model Shark200 using Modbus RTU. I was already able to read it, but I couldn't interpret the returned data. How to interpret the date and value fields?

Example of the returned data:

0; 2; 6144; 3840; 17239; -26413; 17267; -27130; 17250; 31448; 16765; 23237; 16612; -9774; 16571; -17050; 2; 6144; 7680; 17237; -1267; 17267; 2169; 17249; -21791; 16745; 27777; 16681; -27502; 16550; 23033; 2; 6144; 11520; 17240; -224; 17267; -919; 17250; -1291; 16771; 13918; 16607; 26412; 16547; 23206; 2; 6145; 11520; 17238; -28002; 17267; -16499; 17250; 14486; 16771; 1838; 16612; 22630; 16541; 28452; 2; 6146; 0; 17237; -15796; 17266; -2358; 17249; 26544; 16917; 963; 16889; 15450; 16858; -447; 2; 6146; 3840; 17238; 22871; 17267; -8911; 17250; 11932; 16710; -25045; 16676; 32575; 16489; 16235; 2; 6146; 7680; 17239; -7892; 17268; 25489; 17250; -5705; 16771; -15073; 16674; 7403; 16544; -6094; 2; 6146; 11520; 17241; 13096; 17268; -12353; 17251; 29292; 16774; -296; 16676; 18266; 16540; -14520; 2; 6147; 0; 0

In the manual it says:

Historical Log Record In the manual

3

There are 3 best solutions below

13
Simon On

Basically each byte represents a HEX value in your Timestamp

Looking at the example

0x060717101600

is meant to be read:

YYMMDDHHMMSS in HEX format, so

YY = 06h = 06dec or (2006)
MM = 07h = 07dec (July)
DD = 17h = 23dec 
HH = 10h = 16dec
MM = 16h = 22dec
SS = 00h = 00dec

Modbus protocol works with 16bit registers so you will receive the timestamp in 6 bytes (3 registers), so your registers will look like:

YYMM = 0607h
DDHH = 1710h
MMSS = 1600h

EDIT: looks like the time is expressed in 24h format

0
João Soares On

There are several logs you can read. To read the desired log, you need to write the log number in position 0xC34F or DEC 49999.

My code to write:

c.WriteSingleRegister(49999, 640);

Log Number:

0 - System Events; 1 - Alarms; 2 - Historical Log 1; 3 - Historical Log 2; 4 - Historical Log 3

enter image description here

0
João Soares On

I believe there's no erros in my reading. Because even when reading other addresses that have timestamps, the returned data has the same format. Reading the manual, I found this but I dont know what it means:

enter image description here