Wired M-Bus Specification

8

Appendix

8.1 Alarm Protocol

The formerly described method for an alarm protocol (see diploma work of Andreas Steffens “Eigenschaften und Anwendungen des M-Bus”) was based on time slices for each of the maximum 64 alarm devices. This alarm protocol has not been standardized.

We now suggest to return to standard alarm protocol which conforms to the standard IEC 870-2:

The master software polls the maximum 250 alarm devices by requesting time critical data (REQ_UD1 to adresses 1 .. 250). A slave can transmit either a single character acknowledgement E5h signalling no alarm or a RSP_UD with the CI-Field 71h to report an alarm state.

68h 04h 04h 68h 08h Adr 71h Alarm State CS 16h

Fig. 34 Telegram for an Alarm-Respond

The alarm state is coded with data type D (boolean, in this case 8 bit). Set bits signal alarm bits or alarm codes. The meaning of these bits is manufacturer specific.

The timeout for time critical communication must be set to 11..33 bit periods to ensure a fast poll of all alarm devices. With a baudrate of 9600 Bd and all 250 slaves reporting an alarm just in time before a timeout occurs each slave will be polled in periods of maximum 5.5 seconds. This seems to be fast enough for alarms in building control systems and other applications. For faster alarm systems the number of alarm sensors could be limited to 63 (reducing the worst case overall signal delay to less than 1.5 sec or increase the transmission speed to 38400 Bd (with the new repeater hardware) and achieve the same speed for up to 250 devices.

The functionality of the FCB- and FCV-Bit should be fully implemented in this alarm protocol to ensure that one-time alarms are safely transmitted to the master. If the slave has reported an one-time alarm and the next REQ_UD1 has a toggled FCB (with FCV=1) the slave will answer with an E5h signalling no alarm. Otherwise it will repeat the last alarm frame to avoid that the alarm message gets lost.

This new alarm protocol has the advantages of being standardized in IEC 870-2, simple implementation in slaves and master, fast poll cycles and using almost (with the exception of shorter timeout) the normal protocol. In addition it is allowed under EN1434-3 which allows all other types of communication of IEC-870-5-2.

8.2 Coding of Data Records

The standard IEC 870-5-4 defines the following data types for usage inside the application layer:

Type A = Unsigned Integer BCD := XUI4 [1 to 4] <0 to 9 BCD>
27 26 25 24 23 22 21 20  
digit 10 digit 1 1UI4 [1 to 4] <0 to 9 BCD> := digit 100            
8 4 2 1 8 4 2 1 2UI4 [5 to 8] <0 to 9 BCD> := digit 101
8 4 2 1 8 4 2 1 XUI4 [5 to 8] <0 to 9 BCD> := digit 10X-1
Type B = Binary Integer := I[1..X] <-2X-1 to +2X-1-1>
27 26 25 24 23 22 21 20 1B1 [X] := S=Sign: S<0> := positive
            S<1> := negative
S 2X-2           2X-8 negative values in two’s complement
Type C = Unsigned Integer := UI[1 to X] <0 to 2X-1>
27 26 25 24 23 22 21 20 UI8 [1 to 8] <0 to 255>
             
2X-1             2X-8  
Type D = Boolean (1 bit binary information) := XB1 B1[i] <0 to 1>
27 26 25 24 23 22 21 20 XB1: B1[i] <0 to 1>
            B1[i] <0> := false
2X-1             2X-8 B1[i] <1> := true
Type E = Compound CP16 (types and units information)
27 26 25 24 23 22 21 20 1UI6[1 to 6] <0 to 63> := physical unit 1
215 214 213 212 211 210 29 28 1UI6[9 to 14] <0 to 63> := physical unit 2
                1UI4[7,8,15,16] <0 to 15> := measured media

The following data types can only be used with the variable data structure:

Type F = Compound CP32: Date and Time
27 26 25 24 23 22 21 20
215 214 213 212 211 210 29 28
223 222 221 220 219 218 217 216
231 230 229 228 227 226 225 224
Type G: Compound CP16: Date
27 26 25 24 23 22 21 20 day: UI5 [1 to 5] <1 to 31>
215 214 213 212 211 210 29 28 month: UI4 [9 to 12] <1 to 12>
                year: UI7[6 to 8,13 to 16] <0 to 99>
Type H: Floating point according to IEEE-standard
"Short floating Point Number IEEE STD 754" = R32IEEESTD754
R32IEEESTD754 := R32.23 {Fraction, Exponent, Sign}

Fraction = F := UI23 [1to 23] <0 to 1-2-23>
Exponent = E := UI8 [24 to 31] <0 to 255>
Sign = S := BS1 [32] S<0> = positive
S <1> = negative

F <0> and E <0> := (-1) S * 0 = ± zero
F <¹ 0> and E <0> := (-1) S * 2E-126(0.F) = denormalized numbers
E <1 to 254> := (-1) S * 2E-127(1.F) = normalized numbers
F <0> and E <255> := (-1) S * ¥ = ± infinite
F <¹ 0> and E <255> := NaN = not a number, regardless of S
bits 8 7 6 5 4 3 2 1
octet 1 F = Fraction              
  2-16 2-17 2-18 2-19 2-20 2-21 2-22 2-23
octet 2 F = Fraction              
2-8 2-9 2-10 2-11 2-12 2-13 2-14 2-15  
octet 3 E (LSB) F = Fraction            
  2-0 2-1 2-2 2-3 2-4 2-5 2-6 2-7
octet 4 Sign E = Exponent            
  S 27 26 25 24 23 22 21

The following ranges are specified by IEE Std 754-1985 for floating point arithmetics:

Range: (-2128 + 2104) to (+2128 - 2104), that is -3.4* 1038 to +3.4*1038
smallest negative number: -2-149, that is: -1.4* 10-45
smallest positive number: +2-149, that is: + 1.4* 10-45

8.3 Tables for Fixed Data Structure

8.3.1 Measured Medium Fixed Structure
Value Field Medium/Unit Medium      
hexadecimal Bit 16 Bit 15 Bit 8 Bit 7  
0 0 0 0 0 Other
1 0 0 0 1 Oil
2 0 0 1 0 Electricity
3 0 0 1 1 Gas
4 0 1 0 0 Heat
5 0 1 0 1 Steam
6 0 1 1 0 Hot Water
7 0 1 1 1 Water
8 1 0 0 0 H.C.A.
9 1 0 0 1 Reserved
A 1 0 1 0 Gas Mode 2
B 1 0 1 1 Heat Mode 2
C 1 1 0 0 Hot Water Mode 2
D 1 1 0 1 Water Mode 2
E 1 1 1 0 H.C.A. Mode 2
F 1 1 1 1 Reserved

Notes:

  1. Record Medium/Unit is always least significant byte first.

  2. H.C.A. = Heat Cost Allocator

  3. Media from “Gas Mode2” to “H.C.A. Mode2” are defined additionally to EN1434-3 for some existing meters with CI-Field 73h (intentionally mode1), which transmit the multibyte records with high byte first in contrast to the CI-Field. The master must know that these media codes mean mode 2 or high byte first. Further use of these codes for “pseudo media” is not allowed for new developments.

8.3.2 Table of Physical Units
Unit   MSB..LSB Hex code share Byte 7/8 Unit   MSB..LSB Hex code share Byte 7/8  
h,m,s   000000 00 MJ/h   100000 20  
D,M,Y   000001 01 MJ/h * 10 100001 21  
Wh   000010 02 MJ/h * 100 100010 22  
Wh * 10 000011 03 GJ/h   100011 23  
Wh * 100 000100 04 GJ/h * 10 100100 24  
kWh   000101 05 GJ/h * 100 100101 25  
kWh * 10 000110 06 ml   100110 26  
kWh * 100 000111 07 ml * 10 100111 27  
MWh   001000 08 ml * 100 101000 28  
MWh * 10 001001 09 l   101001 29  
MWh * 100 001010 0A l * 10 101010 2A  
kJ   001011 0B l * 100 101011 2B  
kJ * 10 001100 0C m3   101100 2C  
kJ * 100 001101 0D m3 * 10 101101 2D  
MJ   001110 0E m3 * 100 101110 2E  
MJ * 10 001111 0F ml/h   101111 2F  
MJ * 100 010000 10 ml/h * 10 110000 30  
GJ     010001 11 ml/h * 100 110001 31
GJ * 10 010010 12 l/h   110010 32  
GJ * 100 010011 13 l/h * 10 110011 33  
W   010100 14 l/h * 100 110100 34  
W * 10 010101 15 m3/h   110101 35  
W * 100 010110 16 m3/h * 10 110110 36  
kW   010111 17 m3/h * 100 110111 37  
kW * 10 011000 18 °C * 10-3 111000 38  
kW * 100 011001 19 units for HCA 111001 39  
MW   011010 1A reserved   111010 3A  
MW * 10 011011 1B reserved   111011 3B  
MW * 100 011100 1C reserved   111100 3C  
kJ/h   011101 1D reserved   111101 3D  
kJ/h * 10 011110 1E same but historic 111110 3E  
kJ/h * 100 011111 1F without units 111111 3F  

8.4 Tables for Variable Data Structure

8.4.1 Measured Medium Variable Structure
Medium Code bin. Bit 7 .. 0 Code hex.
Other 0000 0000 00
Oil 0000 0001 01
Electricity 0000 0010 02
Gas 0000 0011 03
Heat (Volume measured at return temperature: outlet) 0000 0100 04
Steam 0000 0101 05
Hot Water 0000 0110 06
Water 0000 0111 07
Heat Cost Allocator. 0000 1000 08
Compressed Air 0000 1001 09
Cooling load meter (Volume measured at return temperature: outlet) § 0000 1010 0A
Cooling load meter (Volume measured at flow temperature: inlet) § 0000 1011 0B
Heat (Volume measured at flow temperature: inlet) 0000 1100 0C
Heat / Cooling load meter § 0000 1101 OD
Bus / System 0000 1110 0E
Unknown Medium 0000 1111 0F
Reserved ………. 10 to 15
Cold Water 0001 0110 16
Dual Water 0001 0111 17
Pressure 0001 1000 18
A/D Converter 0001 1001 19
Reserved ………. 20 to FF
8.4.2 Data Field Codes
Length in Bit Code Meaning Code Meaning
0 0000 No data 1000 Selection for Readout
8 0001 8 Bit Integer 1001 2 digit BCD
16 0010 16 Bit Integer 1010 4 digit BCD
24 0011 24 Bit Integer 1011 6 digit BCD
32 0100 32 Bit Integer 1100 8 digit BCD
32 / N 0101 32 Bit Real 1101 variable length
48 0110 48 Bit Integer 1110 12 digit BCD
64 0111 64 Bit Integer 1111 Special Functions
Variable Length:

With data field = 1101b several data types with variable length can be used. The length of the data is given with the first byte of data, which is here called LVAR.

LVAR = 00h .. BFh : ASCII string with LVAR characters
LVAR = C0h .. CFh : positive BCD number with (LVAR - C0h) · 2 digits
LVAR = D0h .. DFH : negative BCD number with (LVAR - D0h) · 2 digits
LVAR = E0h .. EFh : binary number with (LVAR - E0h) bytes
LVAR = F0h .. FAh : floating point number with (LVAR - F0h) bytes [to be defined]
LVAR = FBh .. FFh : Reserved
Special Functions (data field = 1111b):
DIF Function
0Fh Start of manufacturer specific data structures to end of user data
1Fh Same meaning as DIF = 0Fh + More records follow in next telegram
2Fh Idle Filler (not to be interpreted), following byte = DIF
3Fh..6Fh Reserved
7Fh Global readout request (all storage#, units, tariffs, function fields)
8.4.3 Codes for Value Information Field (VIF)

The first block of the table contains integral values, the second typically averaged values, the third typically instantaneous values and the fourth block contains parameters (E: extension bit).

Coding Description Range Coding Range
E000 0nnn Energy 10(nnn-3) Wh 0.001Wh to 10000Wh
E000 1nnn Energy 10(nnn) J 0.001kJ to 10000kJ
E001 0nnn Volume 10(nnn-6) m3 0.001l to 10000l
E001 1nnn Mass 10(nnn-3) kg 0.001kg to 10000kg
E010 00nn On Time nn = 00 seconds
nn = 01 minutes
nn = 10 hours
nn = 11 days
 
E010 01nn Operating Time coded like OnTime  
E010 1nnn Power 10(nnn-3) W 0.001W to 10000W
E011 0nnn Power 10(nnn) J/h 0.001kJ/h to 10000kJ/h
E011 1nnn Volume Flow 10(nnn-6) m3/h 0.001l/h to 10000l/h
E100 0nnn Volume Flow ext. 10(nnn-7) m3/min 0.0001l/min to 1000l/min
E100 1nnn Volume Flow ext. 10(nnn-9) m3/s 0.001ml/s to 10000ml/s
E101 0nnn Mass flow 10(nnn-3) kg/h 0.001kg/h to 10000kg/h
E101 10nn Flow Temperature 10(nn-3) °C 0.001°C to 1°C
E101 11nn Return Temperature 10(nn-3) °C 0.001°C to 1°C
E110 00nn Temperature Difference 10(nn-3) K 1mK to 1000mK
E110 01nn External Temperature 10(nn-3) °C 0.001°C to 1°C
E110 10nn Pressure 10(nn-3) bar 1mbar to 1000mbar
E110 110n Time Point n = 0 date
n = 1 time & date
data type G
data type F
data type F
E110 1110 Units for H.C.A.   dimensionless
E110 1111 Reserved    
E111 00nn Averaging Duration coded like OnTime  
E111 01nn Actuality Duration coded like OnTime  
E111 1000 Fabrication No    
E111 1001 (Enhanced) Identification   see chapter 6.4.2 §
E111 1010 Bus Address   data type C (x=8)
VIF-Codes for special purposes:
Coding Description Purpose
1111 1011 Extension of VIF-codes true VIF is given in the first VIFE and is coded using table 8.4.4 b) (128 new VIF-Codes)
E111 1100 VIF in following string (length in first byte) allows user definable VIF (in plain ASCII-String) *
1111 1101 Extension of VIF-codes true VIF is given in the first VIFE and is coded using table 8.4.4 a) (128 new VIF-Codes)
E111 1110 Any VIF used for readout selection of all VIF (see chapter 6.4.3 )
E111 1111 Manufacturer Specific VIFE and data of this block are manufacturer specific

Note:

8.4.4 Extension of primary VIF-Codes

If the VIF contains an extension indicator (VIF = $FD or $FB) the true VIF is contained in the first VIFE.

a) Codes used with extension indicator $FD
Coding Description Group
E000 00nn Credit of 10nn-3 of the nominal local legal currency units Currency Units
E000 01nn Debit of 10nn-3 of the nominal local legal currency units  
E000 1000 Access Number (transmission count)  
E000 1001 Medium (as in fixed header)  
E000 1010 Manufacturer (as in fixed header)  
E000 1011 Parameter set identification Enhanced Identification
E000 1100 Model / Version  
E000 1101 Hardware version #  
E000 1110 Firmware version #  
E000 1111 Software version #  
E001 0000 Customer location  
E001 0001 Customer  
E001 0010 Access Code User  
E001 0011 Access Code Operator Implementation of all
E001 0100 Access Code System Operator TC294 WG1 requirements
E001 0101 Access Code Developer (improved selection ..)
E001 0110 Password  
E001 0111 Error flags (binary)  
E001 1000 Error mask  
E001 1001 Reserved  
E001 1010 Digital Output (binary)  
E001 1011 Digital Input (binary)  
E001 1100 Baudrate [Baud]  
E001 1101 response delay time [bittimes]  
E001 1110 Retry  
E001 1111 Reserved  
Coding Description Group
E010 0000 First storage # for cyclic storage  
E010 0001 Last storage # for cyclic storage  
E010 0010 Size of storage block  
E010 0011 Reserved  
E010 01nn Storage interval [sec(s)..day(s)] ¹ a Enhanced storage
E010 1000 Storage interval month(s) management
E010 1001 Storage interval year(s)  
E010 1010 Reserved  
E010 1011 Reserved  
E010 11nn Duration since last readout [sec(s)..day(s)] ¹  
E011 0000 Start (date/time) of tariff ²  
E011 00nn Duration of tariff (nn=01 ..11: min to days)  
E011 01nn Period of tariff [sec(s) to day(s)] ¹  
E011 1000 Period of tariff months(s) Enhanced tariff
E011 1001 Period of tariff year(s) management
E011 1010 dimensionless / no VIF  
E011 1011 Reserved  
E011 11xx Reserved  
E100 nnnn 10nnnn-9 Volts electrical units
E101 nnnn 10nnnn-12 A  
Coding Description Group
E110 0000 Reset counter  
E110 0001 Cumulation counter  
E110 0010 Control signal  
E110 0011 Day of week  
E110 0100 Week number  
E110 0101 Time point of day change  
E110 0110 State of parameter activation  
E110 0111 Special supplier information  
E110 10pp Duration since last cumulation [hour(s)..years(s)]Ž  
E110 11pp Operating time battery [hour(s)..years(s)]Ž  
E111 0000 Date and time of battery change  
E111 0001 to E111 1111 Reserved  

Notes:

b) Codes used with extension indicator $FB
Coding Description Range Coding Range
E000 000n Energy 10(n-1) MWh 0.1MWh to 1MWh
E000 001n Reserved    
E000 01nn Reserved    
E000 100n Energy 10(n-1) GJ 0.1GJ to 1GJ
E000 101n Reserved    
E000 11nn Reserved    
E001 000n Volume 10(n+2) m3 100m3 to 1000m3
E001 001n Reserved    
E001 01nn Reserved    
E001 100n Mass 10(n+2) t 100t to 1000t
E001 1010 to E010 0000 Reserved    
E010 0001 Volume § 0,1 feet^3  
E010 0010 Volume § 0,1 american gallon  
E010 0011 Volume 1 american gallon  
E010 0100 Volume flow § 0,001 american gallon/min  
E010 0101 Volume flow 1 american gallon/min  
E010 0110 Volume flow 1 american gallon/h  
E010 0111 Reserved    
E010 100n Power 10(n-1) MW 0.1MW to 1MW
E010 101n Reserved    
E010 11nn Reserved    
E011 000n Power 10(n-1) GJ/h 0.1GJ/h to 1GJ/h
E011 0010 to E101 0111 Reserved    
E101 10nn Flow Temperature 10(nn-3) °F 0.001°F to 1°F
E101 11nn Return Temperature 10(nn-3) °F 0.001°F to 1°F
E110 00nn Temperature Difference 10(nn-3) °F 0.001°F to 1°F
E110 01nn External Temperature 10(nn-3) °F 0.001°F to 1°F
E110 1nnn Reserved    
E111 00nn Cold / Warm Temperature Limit 10(nn-3) °F 0.001°F to 1°F
E111 01nn Cold / Warm Temperature Limit 10(nn-3) °C 0.001°C to 1°C
E111 1nnn cumul. count max power § 10(nnn-3) W 0.001W to 10000W
8.4.5 Codes for Value Information Field Extension (VIFE)

The following values for VIFE are defined for an enhancement of VIF other than $FD and $FB:

VIFE-Code Description
E00x xxxx Reserved for object actions (master to slave): see table on page 75 or for error codes (slave to master): see table on page 74
E010 0000 per second
E010 0001 per minute
E010 0010 per hour
E010 0011 per day
E010 0100 per week
E010 0101 per month
E010 0110 per year
E010 0111 per revolution / measurement
E010 100p increment per input pulse on input channel #p
E010 101p increment per output pulse on output channel #p
E010 1100 per liter
E010 1101 per m3
E010 1110 per kg
E010 1111 per K (Kelvin)
E011 0000 per kWh
E011 0001 per GJ
E011 0010 per kW
E011 0011 per (Kl) (Kelvinliter)
E011 0100 per V (Volt)
E011 0101 per A (Ampere)
E011 0110 multiplied by sek
E011 0111 multiplied by sek / V
E011 1000 multiplied by sek / A
E011 1001 start date(/time) of ¹ ²
E011 1010 VIF contains uncorrected unit instead of corrected unit
E011 1011 Accumulation only if positive contributions
E011 1100 Accumulation of abs value only if negative contributions
E011 1101 to E011 1111 Reserved
VIFE-Code Description
E100 u000 u=1: upper, u=0: lower limit value
E100 u001 # of exceeds of lower u=0) / upper (U=1) limit
E100 uf1b Date (/time) of: b=0: begin, b=1: end of, f=0: first, f=1: last, ² u=0: lower, u=1: upper limit exceed
E101 ufnn Duration of limit exceed (u,f: as above, nn=duration)
E110 0fnn Duration of ¹ (f: as above, nn=duration)
E110 1x0x Reserved
E110 1f1b Date (/time) of ¹ ² (f,b: as above)
E111 0nnn Multiplicative correction factor: 10nnn-6
E111 10nn Additive correction constant: 10nn-3 · unit of VIF (offset)
E111 1100 Reserved
E111 1101 Multiplicative correction factor: 103
E111 1110 future value
E111 1111 next VIFE’s and data of this block are maufacturer specific

Notes:

VIFE-Codes for reports of record errors (slave to master):
VIFE-Code Type of Record Error Error Group
E000 0000 None  
E000 0001 Too many DIFE  
E000 0010 Storage number not implemented  
E000 0011 Unit number not implemented  
E000 0100 Tariff number not implemented DIF Errors
E000 0101 Function not implemented  
E000 0110 Data class not implemented  
E000 0111 Data size not implemented  
E000 1000 to E000 1010 Reserved  
E000 1011 Too many VIFE  
E000 1100 Illegal VIF-Group  
E000 1101 Illegal VIF-Exponent VIF Errors
E000 1110 VIF/DIF mismatch  
E000 1111 Unimplemented action  
E001 0000 to E001 0100 Reserved  
E001 0101 No data available (undefined value)  
E001 0110 Data overflow  
E001 0111 Data underflow  
E001 1000 Data error Data Errors
E001 1001 to E001 1011 Reserved  
E001 1100 Premature end of record  
E001 1101 to E001 1111 Reserved Other Errors
VIFE-Codes for object actions (master to slave):
VIFE-Code Action Explanation
E000 0000 Write (Replace) replace old with new data
E000 0001 Add Value add data to old data
E000 0010 Subtract Value subtract data from old data
E000 0011 OR (Set Bits) data OR old data
E000 0100 AND data AND old data
E000 0101 XOR (Toggle Bits) data XOR old data
E000 0110 AND NOT (Clear Bits) NOT data AND old data
E000 0111 Clear set data to zero
E000 1000 Add Entry create a new data record
E000 1001 Delete Entry delete an existing data record
E000 1010 Reserved  
E000 1011 Freeze Data freeze data to storage no.
E000 1100 Add to Readout-List add data record to RSP_UD
E000 1101 Delete from Readout-List delete data record from RSP_UD
E000 111x Reserved  
E001 xxxx Reserved  

Note:

8.5 References