CMi6140
User’s Manual English
CMi6140
User’s Manual English
page | 27 (38)
[2022-09]
V1.2
Example and Data Size
Below is a break-down of the number of bytes used for the different parts described above.
1
: size (bytes)
2
98 18 # 24 item array : 2 (fixed)
3
A3 # Map with length 3 : 1 (fixed)
4
21 # Key 1 = -2 = Base name : 1 (fixed)
5
68 # Value 1 = String array, length 8 : 1 (fixed)
6
3132333435363738 # meter specific encoding : 8 (fixed, depends on meter)
7
22 # Key 2 = -3 = Base time : 1 (fixed)
8
1A 5DE02740 # Value 2 = 1574971200 = : 5 (fixed)
9
# Time "2019-11-28T20:00Z"
10
08 # Key 3 = 8 = Data value : 1 (fixed)
11
58 21 # Value 3 = Byte array, length 33 : 2 (payload1 < 256 bytes)
12
# or
13
# 3 (payload1 > 255)
14
04064E61BC000415
15
07870000022B9413
16
023BD400025A2303
17
025E1A0202FD1712
18
40 : variable
19
Sum : 22 + (1) + payload1 bytes
20
21
** Record for defining encoder and version **
22
23
A2 # Map with length 2 : 1 (fixed)
24
00 # Key 1 = "0" name : 1 (fixed)
25
61 56 # Value 1 = string => "V" = version : 2 (fixed)
26
02 # Key 2 = integer value : 1 (fixed)
27
00 # Value 2 UINT16
28
# 0x0000 => enc=0, ver=0 : 3 (max)
29
Sum : 8 bytes (max)
30
** Follows X items of same size **
31
32
A2 # Map with length 2 : 1 (fixed)
33
06 # Key 1 = 6 = Time : 1 (fixed)
34
39 0E0F # Value 1 = -3600 = : 3 (fixed)
35
# Time "2019-11-28T19:00Z"
36
08 # Key 2 = 8 = Data value : 1 (fixed)
37
46 # Value 2 = Byte array, length 6 : 1 (payload < 24)
38
0406F24FBC00 # M-bus record with one DIB: : variable
39
# Energy = 12341,234 MWh
40
Sum : X * (7 + (1) + payload2 size)
41
42
Total: 22 + (1) + payload 1 + 8 + X * (7 + (1) + payload2 size)
Given the fixed sizes above using M-Bus and assuming payload is < 256 bytes for the first record and <
24 for the subsequent records, the total size is:
29 + pa 6 + X * (7 + payload2)
Some example sizes:
payload1
payload2
Total
#records
Total
size
33
6
24
367
33
33
12
508
36
32
24
968
Validators
http://cbor.me/ - Validator for CBOR, does not understand SenML or M-Bus
Noted a small bug in the hex interpretation of negative numbers, the diagnostic window seems
correct though.