Proposal for future M-Bus Application Layer
1. Introduction
The M-Bus application layer describes a standard especially for meter readout. It can be used with various physical layers and with link layers and network layers which support the transmission of variable length binary transparent telegrams. The first byte of an application layer telegram is the CI-field which distinguishes between various telegram types and application functions. It is also used to distinguish between true application layer communication and management commands for lower layers. The meaning of the remaining bytes of the telegram depends also on the value of the CI-field. This second revision is a compatible enhancement of the sections 6.4 to 6.6 of the original standard EN1434-part 3 (1997). Besides some clarifications and implementation hints it contains optional enhancements especially for complex meters. Due to technical progress some variants (Fixed format and mode 2=high byte first) are no longer recommended for new developments but are still included as a reference.
Note that this standard contains only directions how data should be coded. It is beyond the task of an application layer standard to define which data must be transmitted under what conditions by which types of slaves or which data transmitted to a slave must have which reactions. Therefore adherence to this standard guarantees the coexistance and common communication and readout capability of slaves via a universal master software (covering all optional features), but not yet functional or communication interchangeabilty of meters following this standard. For several meter types and meter classes the company "Fernwärme Wien" and the "AGFW"-group of remote heating users have provided such application descriptions required for full interchangeability. They are accessible via the www-server of the m-bus users group (http://www.m-bus.com).
2. CI-Field
2.1 OverviewMaster to slave
The original EN1434-3 defined two possible data sequences in multibyte records. The bit two (value 4), which is called M bit or Mode bit, in the CI field gives an information about the used byte sequence in multibyte data structures. If the Mode bit is not set (Mode 1), the least significant byte of a multibyte record is transmitted first, otherwise (Mode 2) the most significant byte. The Mode 2 (M=1) is obsolete and should not be used. It is documented here only as a reference for universal master software with support of old meters.
|
Mode 1 |
(Mode 2) |
Application |
|
00h-4Fh |
reserved for DLMS |
|
|
50h |
application reset |
|
|
51h |
(55h) |
data send (master to slave) |
|
52h |
(56h) |
selection of slaves |
|
53h |
reserved |
|
|
54h-58h |
reserved for DLMS |
|
|
59h-5Bh |
reserved |
|
|
5Ch |
synchronize action |
|
|
60h-6Fh |
reserved |
|
|
70h-7Fh |
(74h) |
reserved for answer directionslave to master: report of application errors |
|
71h |
slave to master: report of alarms |
|
|
72h |
(76h) |
slave to master: Variable format data respond |
|
73h |
(77h) |
slave to master: Fixed format data respond |
|
7880h-8Fh |
reserved |
|
|
90h-97h |
manufacturer specific (obsolete) |
|
|
A0h-AFh |
manufacturer specific |
|
|
B0-B7h |
manufacturer specific (obsolete) |
|
|
B8h |
set baudrate to 300 baud |
|
|
B9h |
set baudrate to 600 baud |
|
|
BAh |
set baudrate to 1200 baud |
|
|
BBh |
set baudrate to 2400 baud |
|
|
BCh |
set baudrate to 4800 baud |
|
|
BDh |
set baudrate to 9600 baud |
|
|
BEh |
set baudrate to 19200 baud |
|
|
BFh |
set baudrate to 38400 baud |
|
|
C0h-FFh |
reserved |
Table 1 CI-Field codes used by the master
"Reserved for DLMS" refers to the DLMS PDU´s in A-XDR encoding of the FDIS version of the IEC-DLMS standard. Choosing CI-fields different from these code simplifies the construction of slaves which can have dual application layers for both standards and which then can automatically distinguish between communication according to both standards.
Note that the CI-codes $50, $52/$56, $5C, $70/$74, $71, $A0-$AF and $B8-$BF are optional compatible enhancements of the original standard. Note also that even if the functions of these optional CI-codes are not implemented in a slave the link layer protocol requires a proper link layer acknowledge of SND_UD telegrams containing any of these CI-codes.
2.1.2 A
pplication reset (CI = $50), (optional)With the CI-Code $50 the master can release a reset of the application layer in the slaves. Each slave himself decides which parameters to change - e.g. which data output is default - after it has received such an application reset. This application reset by a SND_UD with CI=$50 is the counterpart to the reset of the data link layer by a SND_NKE.
2.2.1.3 A
pplication reset subcode (optional)It is allowed to use optional parameters after CI = $50. If more bytes follow, the first byte is the application reset subcode. Further bytes are ignored. The application reset subcode defines which telegram function and which subtelegram is requested by the master. The datatype of this parameter is 8 bit binary. The upper 4 bits define the telegram type or telegram application and the lower 4 bits define the number of the subtelegram. The lower four bits may me ignored for slaves which provide only a single telegram for each application. The use of the value zero for the number of the subtelegram means that all telegrams are requested.
Slaves with only one type of telegram may ignore application reset and the added parameters but have to confirm it ($E5).
The following codes can be used for the upper 4 bits of the first parameter:
|
Coding |
Description |
Examples |
|
0000b |
All |
|
|
0001b |
User data |
consumption |
|
0010b |
Simple billing |
actual and fixed date values+dates |
|
0011b |
Enhanced billing |
historic values |
|
0100b |
Multi tariff billing |
|
|
0101b |
Instaneous values |
for regulation |
|
0110b |
Load management values for management |
|
|
0111b |
Reserved |
|
|
1000b |
Installation and startup |
bus adress, fixed dates |
|
1001b |
Testing |
high resolution values |
|
1010b |
Calibration |
|
|
1011b |
Manufacturing |
|
|
1100b |
Development |
|
|
1101b |
Selftest |
|
|
1110b |
Reserved |
|
|
1111b |
Reserved |
Table 2 Coding of the upper four bits of the first parameter after CI = $50
Note that this table has been expanded with optional elements from the original standard.
2.3 Master to slave data send
(51h/55h) (optional)The CI-Field codes 51h(55h) are used to indicate the data send from master to slave:
|
Variable Data Blocks (Records) |
MDH(opt)O |
Opt.Mfg.specific data Opt) |
|
variable number |
1 Byte |
variable number |
Fig. 1 Variable Data Structure master to slave
Note that this structure is identical to the slave to master direction (see chapter 4) with the exception of the fixed header which is omitted in this direction.
2.4 Slave select
(52h/56h) (optional)The CI-Field codes 52h(56h) are used for the management of an optional netwerk layer using secondary adressing (See chapter 9).
2.51.4
Synchronize action (CI = $5C) (optional)This CI-code can be used for synchronizing functions in slaves and masters (e.g. clock synchronization). Special actions or parameter loads may be prepared but their final execution is delayed until the reception of such a special CI-field command.
2.2 Slave to master (answer) codes
The following codes can be used for the direction slave to master:
|
CI M=0 |
CI M=1 |
Application |
|
70h |
(74h) |
report of general application errors |
|
71h |
report of alarm status (See Appendix) |
|
|
72h |
(76h) |
variable data respond |
|
73h |
(77h) |
fixed data respond |
Table 3 CI-Field codes used by the slave
The use of these control information codes is described in the chapters 3 (fixed data respond), 4 (variable data respond), 6.6 (report of general application errors) and 8.1 (report of alarm status).
2.6 Report of application errors (slave to master)
(CI = $70/74) (optional)3 Fixed Data Structure
For details of the report of application errors see chapter 6.
2.7 Report of alarm status (slave to master)
(CI = $71) (optional)For details of the report of alarm status errors see appendix C.
2.8 Fixed and variable data respond (slave to master)
(CI = $72/$76 and $73/$77)In the reply direction (slave to master) with a long frame originally two different data structures were used. The fixed data structure, besides a fixed length, is limited to the transmission of only two counter states of a predetermined length, which have binary or BCD coding. In contrast the variable data structure allows the transmission of more counter states in various codes and further useful information about the data. The number of bytes of the transmitted counter states is also variable with this data structure. Contrary to the fixed structure, the variable structure can also be used in calling direction. For theseis reasons the fixed data structure is not recommended for future developments. For information on this obsolete fixed data structure see appendix D. For new development therefore only the CI-field $72 shall be used. This is a restriction from the original standard.
To identify the fixed data structure, the numbers 73h/77h for the control information field are used. In this way a universal master software can see how it must interpret the data. For further details on the structure of telegrams starting with CI-values of $72/($76) see chapter 3.
2.9 Baudrate switch commands $B8-$BF (optional)
These optional commands can be used by a master to switch the baudrate of a slave.
For details see chapter 9.1.
3 Data Header of variable data respond 4 Variable Data Structure
4.1 Slave to master (answer) direction
The CI-Field codes 72h/(76h) are used to indicate the variable data structure in long frames (RSP_UD). Figure 2 1 shows the way this data is represented:
|
Data Header(Req.) |
Variable Data Blocks (Records) |
MDH(opt)O |
Opt.Mfg.specific data Opt) |
|
12 Byte |
variable number |
1 Byte |
variable number |
Fig. 12 Variable Data Structure in Answer Direction
3.14.1.1 Structure of Data Header
The first twelve bytes of the user data consist of a block with a fixed length and structure (see fig. 32).
|
Ident. Nr. |
Manufr. |
Version |
Device typeMedium |
Access No. |
Status |
Signature |
|
4 Byte |
2 Byte |
1 Byte |
1 Byte |
1 Byte |
1 Byte |
2 Byte |
Fig. 23 Fixed Data HeaderBlock
3.24.1.2 Identification number
The Identification Number is either a fixed fabrication number or a customer number changable by the customer, coded with 8 BCD packed digits (4 Byte), and which thus runs from 00000000 to 99999999. It can be preset at fabrication time with a unique number, but could be changeable afterwards, especially if in addition an unique and not changeable fabrication number (DIF = $0C, VIF = $78, see chapter 6.7.3) is provided.
34.1.3 Manufacturer identification
The field manufacturer is coded unsigned binary with 2 bytes. This manufacturer ID is calculated from the ASCII code of EN 61107 manufacturer ID (three uppercase letters) with the following formula:
IEC 870 Man. ID = [ASCII(1st letter) - 64] · 32 · 32
+ [ASCII(2nd letter) - 64] · 32
+ [ASCII(3rd letter) - 64]
Note that currently the flag association administers these three letter manufacturers ID of EN61107. For details see appendix X.
34.1.4 Version identification
The field version specifies the generation or version of the meter and depends on the manufacturer. It can be used to make sure, that within each version number the identification # is unique.
34.1.5 Medium Device type identification
The medium device byte is coded as follows:
|
Device type (previously called medium)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 |
|
WarmHot Water (30°C-90°C) |
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 component |
0000 1110 |
0E |
|
Unknown Medium |
0000 1111 |
0F |
|
Reserved |
.......... |
10 to 145 |
|
Hot water (>=90°C) |
0001 0101 |
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 |
Table 3 Device type identification
Note that this table has been expanded with optional elements from the original standard.
3.4.1.6 Access number
The Access Number has unsigned binary coding, and is increased (modulo 256) by one before or after each RSP_UD from the slave. Since it can also be used to enable private end users to detect an unwanted overfrequently readout of its consumption meters, it should not be resettable by any bus communication.
34.1.7 Status byte
|
Bit |
Meaning with Bit set |
Significance with Bit not set |
|
0,1 |
See table 5Fig.4 |
See table 5Fig.4 |
|
2 |
Power low |
Not power low |
|
3 |
Permanent error |
No permanent error |
|
4 |
Temporary error |
No temporary error |
|
5 |
Specific to manufacturer |
Specific to manufacturer |
|
6 |
Specific to manufacturer |
Specific to manufacturer |
|
7 |
Specific to manufacturer |
Specific to manufacturer |
Table 4 Fig. 3 Coding of the Status Field
|
Status bit 1 bit 0 |
Application status |
|
0 0 |
No Error |
|
0 1 |
Application Busy |
|
1 0 |
Any Application Error |
|
1 1 |
Reserved |
Table 5 Fig. 4 Application Errors coded with the Status-Field
Note that more detailed error signalling can be provided by application telegrams starting with CI=$70 and/or using data records signalling even more detailed error information.
3.8 Signature field
The Signature is reserved for optional encryptation of the application data. If no encryptation is used its value shall be 00 00 h.
3.8.1 Functions
Data privacy for consumption meters values
Detecting simulated meter transmission
Preventing later playback of old meter values
3.8.2 Structure of encrypted telegrams
a) The first 12-byte block containing the ID-number,
the manufacturer etc. is always unencrypted.
The last word of this block is the signature word.
If the following data are unencrypted, this
signature word contains a zero.
b) If the transmission contains encrypted data,
the high byte of this signature word contains a code for
the encryptation method. The code 0 signals no
encryptation. Currently only the encryptation codes 2 or 3
(see below) are defined. The other codes are
reserved. The number of encrypted bytes is contained
in the low byte of the signature word.
The content of this signature word is currently defined
as zero, corresponding consistently to no encrypted data.
c) The encrypted data follow directly after the
signature word, thus forming the beginning of the
DIF/VIF-structured part of the telegram.
3.8.3 Partial Encryption
a) If the number of encrypted bytes is less than the
remaining data of the telegram, unencrypted data may
follow after the encrypted data. They must start at a
record boundary, i.e. the first byte after the encrypted
data will be interpreted as a DIF.
b) If a partially encrypted telegram must contain encrypted
manufacturer specific data a record with a suitable length
DIF (possibly a variable length string DIF) and a VIF=
$7F (manufacturer specific data record) must be used
instead of the usual MDH-DIF=$0F. This is required to
enable after decryptation standard DIF/VIF-decoding of a previously partially encrypted telegram containing
encrypted manufacturer specific data .
3.8.4 Encryptation methods
a) Encryptation according to the DES (data encryptation
standard) as described in ANSI X3.92-1981
b) Cipher Block Chaining (CBC)-method as described in
ANSI X3.106-1983 with an initial initialization vector
of zero: (Encryptation Method Code=2). In this case
the data records should contain the current date
before the meter reading.
Note that in this case the data after the date record,
i.e.especially the encrypted meter reading data
change once per day even if their data content itself is
constant. This prevents an undetectable later playback of
stored encrypted meter readings by a hacker.
c) The "Initialization Vector IV" with length 64 bits of this
standard may alternatively be defined by the the first 6
bytes of the identification header in mode 1 sequence,
i.e. identification number in in the lowest 4 bytes
followed by the manufacturer ID in the two next higher
bytes and finally by the current date coded as in record
structure "G" for the two highest bytes.
In this case the encryptation method is coded as "3".
Note that in this case all encrypted data change once
per day even if the data content itself is constant.
This prevents an undetectable later playback of any
stored encrypted data by a hacker.
d) To simplify the verification of correct decoding and to
prevent an undetected change in the identification of the
not encrypted header, the encrypted part of the telegram
must contain at least together with the appropriate application
layer coding (DIF and VIF) again the same identification
number as in the unencrypted header.
e) Due to the mathematical nature of the DES-algorithm
the encrypted length contained in the low byte of the
signature word must be an integer multiple of 8 if
the high byte signals DES-encryptation.
Unused bytes in the last 8-byte block must be filled
with appropriatly structured dummy data records to
achieve the required record boundary at the end of the
encrypted data. One or several bytes containing the filler
DIF=$2F are suggested to fill such gaps.
f) The application of certain encryptation methods might be
prohibited by local laws.
4.1.8 Signature field
The Signature remains reserved for future encryptation applications, and until then is allocated the value 00 00 h.
|
Variable Data Blocks (Records) |
MDH(opt)O |
Opt.Mfg.specific data Opt) |
|
variable number |
1 Byte |
variable number |
Fig. 5 Variable Data Structure in Answer Direction
Note that this structure is identical to the slave to master direction with the exception of the fixed header which is omitted in this direction.
4.3 Variable Data Blocks (Records)
The data, together with information regarding coding, length and the type of data is transmitted in data records in arbitrary sequence. As many records can be transferred as there is room for within the maximum total data length of 234255 Bytes, and taking account of the C, A, and CI fields, and the data header. This limits the total telegram length to 255 bytes. This restriction is required to enable gateways to other link- and application layers. e upper limit for characters in the variable data blocks is thus 240 byte. A maximum total telegram length of 255 bytes (234 bytes for variable data blocks) is recommended to simplify gateways and the integration in other link layers . The manufacturer data header (MDH) is made up by the character 0Fh or 1Fh and indicates the beginning of the manufacturer specific part of the user data and should be omitted, if there are no manufacturer specific data.
|
DIF |
DIFE |
VIF |
VIFE |
Data |
|
1 Byte |
0-10 (1 Byte each) |
1 Byte |
0-10 (1 Byte each) |
0-N Byte |
|
Data Information Block DIB |
Value Information Block VIB |
|||
|
Data Record Header DRH |
||||
Fig. 46 Structure of a Data Record (transmitted from left to right)
Each data record contains one value (data) with its description (DRH)as shown in figure 20, a data record, which consists of a data record header (DRH) and the actual data. The DRH in turn consists of the DIB (data information block) to describe the length, type and coding of the data, and the VIB (value information block) to give the value of the unit and the multiplier.
4.3.1 Data Information Block (DIB)
The DIB contains at least one byte (DIF, data information field), and can be extended by a maximum of ten DIFE's (data information field extensions).
4.3.2 Data Information Field (DIF)
The following information is contained in a DIF:
|
Bit 7 |
6 |
5 |
4 |
3 |
2 |
1 |
0 |
|
|
Extension Bit |
LSB of storage number |
Function Field |
Data Field : Length and coding of data |
|||||
Fig. 57 Coding of the Data Information Field (DIF)
4.3.3 Data Field
The data field shows how the data from the master must be interpreted in respect of length and coding. The following table contains the possible coding of the data field:
|
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 |
Table 46 Coding of the data field
Note that this table has been expanded with optional elements from the original standard.
For a detailed description of data types refer to appendix A8.2 " Coding of data records"
(e.g. BCD = Type A, Integer = Type B, Real = Type H).
Variable Length:
With data field = `1101b` several data types with variable length can be used. The length of the data is given after the DRH with the first byte of real data, which is here called LVAR (e.g. LVAR = 02h: ASCII string with two characters follows).
LVAR = 00h .. BFh : Text string according to ISI/IEC 646 with LVAR characters
LVAR = C0h .. C9h : positive BCD number with (LVAR - C0h) · 2 digits
LVAR = D0h .. D9H : negative BCD number with (LVAR - D0h) · 2 digits
LVAR = F8h : floating point number according to IEEE 754
Others LVAR values : Reserved
Like all multibyte fields in mode 1 the last character and in mode 2 the first character is transmitted first.
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 of next record |
|
3Fh..6Fh |
Reserved |
|
7Fh |
Global readout request (all storage#, units, tariffs, function fields) |
Table 7: DIF-coding for special functions
Note that this table has been expanded with optional elements from the original standard.
If data follows after DIF=$0F or $1F these are manufacturer specific unstructured data. The number of bytes in these manufacturer specific data can be calculated from the link layer information on the total length of the application layer telegram. The DIF 1Fh signals a request from the slave to the master to readout the slave once again. The master must readout the slave until there is no DIF=1Fh inside the respond telegram (multi telegram readout) or use an application reset.
4.3.4 Function field
The function field gives the type of data as follows:
|
Code |
Description |
Code |
Description |
|
00b |
Instantaneous value |
01b |
Maximum value |
|
10b |
Minimum value |
11b |
Value during error state |
Table 8: Function Field
4.3.5 Storage number
The Bit 6 of the DIF serves as the LSB of the storage number of the data concerned, and the slave can in this way indicate and transmit various stored metering values or historical values of metering data. This bit is the least significant bit of the storage number and allows therefore the storage numbers 0 and 1 to be coded. If storage numbers higher than "1" are needed, following (optional) DIFE´s contain the higher bits. The storage number 0 signals an actual value. Note that a each storage number is associated with a given timepoint. So all data records with the same storage number refer to the value of the associated variable at this (common) timepoint for this storage number. It is recommended, that a time/date record with this storage number is included somewhere to signal this timepoint. Normally (but not necessarily) higher storage numbers indicate an older timepoint. A sequential block of storage numbers can be associated with a sequence of equidistantly spaced time points (profile). Such a block can be described by its starting time, by the time spacing, by the first storage number of such a block and by the length of such a block. The coding for such a block description in contrast to an individual time/date record for each individula storage number is given in the appendix.
4.3.6 Extension Bit
The extension bit (MSB) signals that more detailed or extended descriptions (data field extension=DIFE)-bytes follow.
4.3.7 Data field extension byte(s) (DIFE)
Each DIFE (maximum ten) contains again an extension bit to show whether a further DIFE is being sent. Besides giving the next most significant bits of the storage number, DIFE´s allow the transmission of informations about the tariff and the subunit of the device from which the data come. In this way, exactly as with the storage number, the next most significant bit or bits will be transmitted. The figure 8 which follows shows the structure of a DIFE:
|
Bit 7 |
6 |
5 |
4 |
3 |
2 |
1 |
0 |
|
|
Extension Bit |
(Device) Unit |
Tariff |
Storage Number |
|||||
Fig. 58 Coding of the Data Information Field Extension (DIFE)
With the maximum of ten DIFE´s which are provided, there are 41 bits for the storage number, 20 bits for the tariff, and 10 bits for the subunit of the meter. There is no application conceivable in which this immense number of bits could all be used.
4.3.8 Tariff information
For each (unique) value type designation given by the following value information block (VIB) at each unique time point (given by the storage number) of each unique function (given by the function field) there might exist still various different data, measured or accumulated under different conditions. Such conditions could be time of day, various value ranges of the variable (i.e. separate storage of positive accumulatad values and negative accumulated values) itself or of other signals or variables or various averaging durations. Such variables which could not be distinguished otherwise are made different by assigning them different values of the tariff variable in their data information block. Note that this includes but is not necessarily restricted to various tariffs in a monetary sense. It is at the distinction of the manufacturer to describe for each tariff (except 0) what is different for each tariff number. Again as with the storage numbers all variables with the same tariff information share the same tariff associating condition.
4.93.8 Subunit information
A slave component may consist of several functionally and logically independent subunits of the same or of different functionallity. Such a device may either use several different primary and/or secondary adresses. Such it is from a link layer and an application layer view just several independent devices which share a common physical layer interface. This is recommended for devices which represent a physical collection of several truely independent (often similar or idential) devices. For devices which share common information and values and have logical connections an approach with a common link layer (i.e.a single address) is reccomended. The various subunits can include their specific information into a common telegram and have them differentiated by the individual subunit number in the subunit-datafield of their records.
54.4 V
alue Information Block (VIB)After a DIF (with the the exception of $xF) or a DIFE without a set extension bit there follows the VIB (value information block). This consists at least of the VIF (value information field) and can be expanded with a maximum of 10 extensions (VIFE). The VIF and also the VIFE's show with a set MSB that a VIFE will follow. In the value information field VIF the other seven bits give the unit and the multiplier of the transmitted value.
|
Bit 7 |
6 |
5 |
4 |
3 |
2 |
1 |
0 |
|
Extension Bit |
Unit and multiplier (value) |
||||||
Fig. 69 Coding of the Value Information Field (VIF)
There are five types of coding depending on the VIF:
a)1. Primary VIF: E000 0000b .. E111 1011b
The unit and multiplier is taken from the table for primary VIF (Table 9chapter 8.4.3).
b)2. Plain-text VIF: E111 1100b
In case of VIF = 7Ch / FCh the true VIF is represented by the following ASCII string with the length given in the first byte. Please note that the byte order of the characters after the length byte depends on the used byte sequence. Since only the "LSB first mode" (M=1) of multibyte data transmission is recommended, the rightmost character is transmitted first. This plain text VIF allows the user to code units that are not included in the VIF tables..
c)3. Linear VIF-Extension: FDh and FBh
In case of VIF = FDh and VIF = FBh the true VIF is given by the next byte (i.e. the first VIFE) and the coding is taken from the tables 11 respectively table 12 for secondary VIF (chapter 8.4.4). This extends the available VIF´s by another 256256 codes.
d)4. Any VIF: 7Eh / FEh
This VIF-Code can be used in direction master to slave for readout selection of all VIF´s. See chapter 6.4.3.
e)5. Manufacturer specific: 7Fh / FFh
In this case the remainder of this data record including VIFE´s has manufacturer specific coding.
5.1 Primary VIF´s (main table)
The first section of the main table contains integral values, the second typically averaged values, the third typically instantaneous values and the fourth block contains parameters (E: extension bit).
4.4.1 Primary VIF´s (main table)
|
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 appendix E2chapter 6.4.2 § |
|
|
E111 1010 |
Bus Address |
data type C (x=8) |
Table 9: Primary VIF-codes
Note that this table has been expanded with optional elements from the original standard.
54.4.2 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 108.4.4 b) (128 new VIF-Codes) |
|
E111 1100 |
VIF in following string (length in first byte) |
allows user definable VIF´s (in plain ASCII-String) * |
|
1111 1101 |
Extension of VIF-codes |
true VIF is given in the first VIFE and is coded using table 118.4.4 a) (128 new VIF-Codes) |
|
E111 1110 |
Any VIF |
used for readout selection of all VIF´s (see chapter 9.26.4.3 ) |
|
E111 1111 |
Manufacturer Specific |
VIFE´s and data of this block are manufacturer specific |
Table 10: Special VIF-Codes
Note that this table has been expanded with optional elements from the original standard.
Note:
* Coding the VIF in an ASCII-String in combination with the data in an ASCII-String (datafield in DIF = 1101 b) allows the representation of data in a free user defined form.
54.4.3 MainFirst VIFE-Code Extension table (following VIF=$FD for primary VIF)
|
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 |
Device typeMedium (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) (Device type specific) |
|
|
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 |
|
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)] |
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 |
|
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 |
Table 11: Main VIFE-code extension table
Note that this optional table has been added to the original standard.
Notes:
nn = 00 second(s)
01 minute(s)
10 hour(s)
11 day(s)
The information about usage of data type F (date and time) or data type G (date) can be derived from the datafield (0010b: type G / 0100: type F).
pp = 00 hour(s)
01 day(s)
10 month(s)
11 year(s)
54.4.4 Alternate VIFE-Code Extension table (following VIF=$FB for primary VIF)
|
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) m³ |
|
|
E001 001n |
Reserved |
||
|
E001 01nn |
Reserved |
||
|
E001 100n |
Mass |
10 (n+2) t |
100t to 1000t |
|
E001 1010-E010 0000 |
Reserved |
||
|
E010 0001 |
Volume |
0,1 feet^3 |
|
|
E010 0010 |
Volume |
0,1 am.gallon |
|
|
E010 0011 |
Volume |
1 am.gallon |
|
|
E010 0100 |
Volume flow |
0,001 am.gallon/min |
|
|
E010 0101 |
Volume flow |
1 am.gallon/min |
|
|
E010 0110 |
Volume flow |
1 am.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/hto 1GJ/h |
|
E011 0010-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 Differ. |
10 (nn-3) °F |
0.001°F to 1°F |
|
E110 01nn |
Flow Temperature |
10 (nn-3) °F |
0.001°F to 1°F |
|
E110 1nnn |
Reserved |
||
|
E111 00nn |
Cold/Warm Temp. Lim. |
10 (nn-3) °F |
0.001°F to 1°F |
|
E111 01nn |
Cold/Warm Temp. Lim. |
10 (nn-3) °C |
0.001°C to 1°C |
|
E111 1nnn |
Cum.Count Max.power |
10 (nnn-3) W |
0.001W to 10000W |
Table 12: Alternate extended VIF-code Table
Note that this optional table has been added to the original standard.
54.4.5 Combinable (Orthogonal) VIFE-Code Extension table (Following primary VIF)
|
VIFE-Code |
Description |
|
E00x xxxx |
Reserved for object actions (master to slave): see chapter 6.3 and table 16table on page 75 or for error codes (slave to master): see chapter 7 and table 17table 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 (K*l) (Kelvin*liter) |
|
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 for value (not unit): 103 |
|
E111 1110 |
future value |
|
E111 1111 |
next VIFE's and data of this block are maufacturer specific |
Table 13: Combinable (orthogonal) VIFE-Table
Note that this optional table has been added to the original standard.
Notes:
"Date(/time) of" or "Duration of" relates to the information which the whole data record header contains.
The information about usage of data type F (date and time) or data type G (date) can be derived from the datafield (0010b: type G / 0100: type F).
65 Application Layer Status and error reporting
The data link layer reports only communication errors by means of omittingleaving out the acknowledgement $E5 or a via a negative acknowledgement. It is not allowed to report errors of the application layer (which can occur for example in data writing) via the link layer. The slave can transmit an $E5 after a SND_UD to indicate that it has received the telegram, but can´t respond with data. There are three different techniques for reporting application errors:
65.1 Status Field
One possible solution is to use the reserved 2 lowest bits of the Status field in the variable data structure for the application layer status (see Table 6).:
Fig. 5 Application Errors coded with the Status-Field
65.2 General Application Layer Errors
For reporting general application errors a slave can use a RSP_UD telegram with CI=$70 and zero, one or several data bytes, which then describes the type of error:
|
68h |
04h |
04h |
68h |
08h |
PAdr |
70h |
DATA |
CS |
16h |
Fig. 6 Telegram for reporting general application errors
The following values for DATA are defined:
|
0 |
Unspecified error: also if data field is missing |
|
1 |
Unimplemented CI-Field |
|
2 |
Buffer too long, truncated |
|
3 |
Too many records |
|
4 |
Premature end of record |
|
5 |
More than 10 DIFE´s |
|
6 |
More than 10 VIFE´s |
|
7 |
Reserved |
|
8 |
Application too busy for handling readout request |
|
9 |
Too many readouts (for slaves with limited readouts per time) |
|
10..255 |
Reserved |
Table 5 15 Codes for general application errors
Note that this optional table has been added to the original standard.
65.3 Record Errors
To report errors belonging to a special record the slave can use this data record header with a VIFE containing one of the following values to code the type of application error, which has been occured.
|
VIFE-Code |
Type of Record Error |
Error Group |
|
E000 0000 |
None |
|
|
E000 0001 |
Too many DIFE´s |
|
|
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´s |
|
|
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 |
Table 6 16: Codes for record errors (E = extension bit)
Note that this optional table has been added to the original standard.
In case of record errors the data maybe invalid. The slave has some options to transmit the data:
·
datafield = 0000b: no data·
datafield = 0000b: no data and idle filler (DIF=$2F): fill telegram record up to the normal length·
other datafield: dummy data of correct length·
other datafield: unsafe or estimated dataThe fundamental idea of an object is the encapsulation of data and methods or actions for the data. In case of writing data to a slave the master software can pack data and information about the action, which the slave shall do with this data, in one data record. This variable data record with actions is now called an object. Following any VIF including a VIF=$FD or VIF=$FB with the true value information in the first VIFE another (usually the last) VIFE can be added which contains a code signalling object actions according to the following table.
Action: (E: extension bit)
|
VIFE-Code binary |
Action |
Explanation |
|
E000 0000 |
Write (Replace) |
replace old with new data |