M-Bus Driver
SCADA SOFT AG, 2002
M-Bus Driver
(VPIWNMB)
Version 1.0 M-Bus Driver
M-Bus Driver
Scada Soft, 2002
Table Of Contents
1. Overview....................................................................................................... 2
1.1 PLC / Protocol ......................................................................................... 2
1.2 Characteristics ........................................................................................ 2
1.3 Current Version ....................................................................................... 2
1.4 Version history ........................................................................................ 2
1.5 Contact................................................................................................... 2
2. Driver Installation .......................................................................................... 3
3. Tag Definition ................................................................................................ 4
4. Supported Variables ....................................................................................... 5
4.1 Data Types ............................................................................................. 5
4.2 Tag Address............................................................................................ 5
5. Notes & Application tips ................................................................................. 8
5.1 Choosing tag sample rate ........................................................................ 8
5.2 Timeout/Error handling............................................................................ 8
5.3 Selecting Baud Rate ................................................................................ 8
5.4 Secondary Addressing ............................................................................. 8
5.5 Int-File (vpimbs01.int) ............................................................................. 8
6. Tested environment ....................................................................................... 9
7. MBUS.exe [dev [com]] ................................................................................... 9
Version 1.0 Page 1
M-Bus Driver
SCADA SOFT AG, 2002
1. Overview
This driver allows Wizcon to read variables of M-Bus Slaves using a Serial to M-Bus gateway.
Using this driver, it is possible to address up to 250 devices per M-Bus Network and read all
variables, which are transmitted by default by a device responding to a REQ_UD2 message
from the master (Wizcon).
All data received from the device is then parsed and the data which is needed for tag
operation is stored in an internal memory block of the driver. Subsequent reads to the same
device will then be served from this internal buffer, until the shoertest sampling period of all
tags, which access this device, has expired. After that, the device is polled again and the data
is stored again in the internal memory block.
Writing to devices is not supported.
1.1 PLC / Protocol
The driver will connect to various M-Bus field devices using an M-Bus to RS232 Gateway.
1.2 Characteristics
Block definitions for all tags which access the same device is not necessary. The driver will
automatically define blocks for each device internally, which will be sampled at the interval
defined by the tag that holds the shortest sampling period in that block. As this process does
not require user interference and strictly internal, block definitions will not be visible in Wizcon
and block definition in Wizcon is not supported.
1.3 Current Version
1.0 – Final Release
1.4 Version history
1.0 – Final Release
1.5 Contact
Scada Soft AG
Wiesengasse 20
8222 Beringen
Switzerland
Tel: +41-52-687 20 20
Fax: +41-52-687 20 29
support@scada.ch
http://www.scada.ch
Version 1.0 Page 2
M-Bus Driver
SCADA SOFT AG, 2002
2. Driver Installation
To add the driver, please use the “Communication Drivers” dialogue in the Wizcon studio.
After you press “add”, Wizcon will start the communication driver setup wizard, which will
guide you through the driver installation.
First, choose “M-Bus” which is the communication driver needed for M-Bus communications.
After you have selected the driver, a screen will prompt you for a specific name of the driver
and checking the supported features. Please enter a name for the driver and make sure that
Read and Sample tags outside of blocks are checked and write is unchecked.
Version 1.0 Page 3
M-Bus Driver
SCADA SOFT AG, 2002
Since this driver builds blocks automatically according to the number of tags, which access the
same device, you are not required to define any blocks in the next dialogue. Please press
“finish” and restart Wizcon to complete driver installation.
3. Tag Definition
To add a tag, simply right-click on “add tag” so that the add tag dialogue appears. The tag
must be configured as follows in order to work with the driver:
• PLC tag using the driver specified in step 2 of the driver configuration
• Data type according to the type of value to be read
• Sample: as needed. Please see section “notes” on sampling time.
The driver will conduct a basic conversion of the received data according to the rules provided
by the device (i.e. multiplying the received value with the provided factor). Range and scaling
parameters in the tag definition can be applied at your discretion.
The tag address consists of the desired device’s primary address and the VIF/VIFE and
DIF/DIFE fields that should be read. Detailed information is included in the chapter
“supported variables”
Version 1.0 Page 4
M-Bus Driver
SCADA SOFT AG, 2002
4. Supported Variables
4.1 Data Types
The driver will support all variables, that can be identified by a DIF/VIF or DIFE/VIFE pair. We
also support the “Multi telegram resonse” as descibed in EN1434-3, Chapter 5.1.1. The
support of manufacturer specific data fields and structures is limited to 254 characters and no
translation or conversion will be made.
4.2 Tag Address
Decimal mode:
Decimal mode allows the user to read specific data by an order number (the user may select
the nth data block in a datagram) or copy raw data to a string.
To select a data block, the user has to sepcify device ID, value number and data type in the
address field, separated by commas (,). The data will be converted from the source type
(specified by the user) to the gate type. If source and destination type do not mach, a loss of
precision is possible (for example, when converting floating point data to integer).
To copy raw data, the user has to specify a device ID, separated by comma from the range
(from and to values, separated by a dash (-)). The data will be converted to hexadecimal
values and stored in a string tag. Since Wizcon 8.2 only allows a string length of 255, the
maximum number of copied digits is 127 (each data byte will be represented by 2 characters
in the destination string).
Addressing for the two modes is as follows:
DEV,VAL,TYPE
Version 1.0 Page 5
M-Bus Driver
SCADA SOFT AG, 2002
Field Meaning
DEV Device ID, specifies the device which has
to be read in decimal notation. Value
ranges from 0 to 255.
, Separator, as is.
VAL Selects the value from the datagram.
Value ranges from 1 to 255. 3, for
example, will select the 3rd value in the
datagram.
, Separator, as is.
TYPE Because automatic detection of the data
type is only possible using DIF/VIF
combinations, the user has to specify the
source data type in this mode. Possible
data types are:
int16: 16 bit integer (signed)
uint16: 16 bit integer (unsigned)
int32: 32 bit integer (signed)
uint32: 32 bit integer (unsigned)
bcd: binary coded decimal
real: 32 bit floating point (float)
string: ASCII string
date: ASCI string (min. 10 Chars)
datetime: ASCI string (min. 15 Chars)
If source type and gate type do not
match, the driver will convert the source
type to the gate type, which might result
in data loss.
DEV,START-END
Field Meaning
DEV Device ID, specifies the device which has
to be read in decimal notation. Value
ranges from 0 to 255.
, Separator, as is.
START Specifies the beginning of the raw data
which should be copied.
- Separator, as is.
END Specifies the end of the raw data which
should be copied.
Please note that the gate type for raw data has to be of type string and should be at least as
big as the data block which is to be copied. The driver will also check if START is smaller than
END and that the block size does not exceed 127.
Device status
Version 1.0 Page 6
M-Bus Driver
SCADA SOFT AG, 2002
Additionally, the driver may provide some device specific status data. Addressing is as follows:
DEV,INFO
Device denotes the desired device ID (in decimal), and INFO may be one of the following
information fields:
MAN Manufacturer (string)
IDN Identification number (string)
VER Version (string)
STA Status (uint16)
MED Medium (uint16)
ACC Access counter (string)
SIG Signature (string)
Version 1.0 Page 7
M-Bus Driver
SCADA SOFT AG, 2002
5. Notes & Application tips
5.1 Choosing tag sample rate
Maxmimum tag sampling rate depends on several factors which should be considered when
designing your M-Bus application. If, for example, there are 250 devices connected to a 2400
Baud network, and every device sends the specified maximum of 250 data bytes, it will take
the network 208 seconds to transmit this information. Sampling time should therefore not be
set to less than 240 seconds. Otherwise, the master will not succeed in polling all slaves in the
time available.
It is, however, possible to vary the sampling time if less information has to be transmitted or
there are less slaves connected. But because there is also the possibility of transmission
errors, it is not recommended to select faster sampling times unless absolutely needed.
5.2 Timeout/Error handling
The timing parameters have to be defined in the Init file. The following parameter is
supported:
• Number of repetition times (repeat = 3)
After changing these values, Wizcon has to be restarted.
5.3 Selecting Baud Rate
The Driver does not support different baud rates for individual slaves. Therefore, the entire M-
Bus network has to operate at the same baud rate. Different baud rates can only be
accomplished on separate interfaces.
5.4 Secondary Addressing
The driver does only support M-Bus primary addressing. It is therefore the responsibility of
the user to configure all slaves accordingly.
5.5 Int-File (vpimbs01.int)
The following options are supported:
[Driver]
repeat = number
interval = number
[License]
code = ABCDEFGH-IJKLMNOP-QRSTUV
[Debug]
level = number
In the driver section you may define how many times the driver will try to read the device and
the overall interval for reading from device in seconds. In the code line from the license
section you must enter your license code.
The debugging level is optional and may have any value between 0 (zero) and 99. In
production mode the debug level should be set to zero.
Version 1.0 Page 8
M-Bus Driver
SCADA SOFT AG, 2002
6. Tested environment
Operating system: Microsoft Windows 2000 SP3
Wizcon: Version 8.1 + 8.2
Devices:
Aquametro: AMBUS ZS-5 (Master), AMBUS CALEC MB (Heat Meter)
ABB: Delta Meter
ELKO: EIZ-EDWS7390, EIZ-EDWA7390
Relay: M-BUSPW3 (M-Bus Pegelwandler)
GMC: U1189 (Drehstrohmzähler)
7. MBUS.exe [dev [com]]
This commandline program reads the RSP_UD telegram from device dev (default: 1) on port
com (default: COM1). The output is written to a file called debug.log in the current directory.
Example: mbus 1 com2 gives the following output:
ColdStart: Function#= -842150451, VPI#= -842150451, Parmsize= -
842150451
Initializing device structures...
Done.
Scan program options...
Done.
Scan mbus devices...
Done.
get telegram from dev 1.
Telegram is Short
Start 0x10
C-Field 0x7b
A-Field 0x01 1
CRC 0x7c 124
End 0x16
--> buffer [|00010000|01111011|00000001|01111100|00010110| [.{.|.]]
--> written 5 bytes
write time: 0.01000 seconds
read time: 0.54000 seconds
total: 114 byte(s) read (68)
Telegram is Data
Start 0x68
Length1 0x6c 108 (105 Data + 3 Controlbytes)
Length2 0x6c 108 (dito)
Start 0x68
C-Field 0x08
A-Field 0x01 1
CI-Field 0x72
Data[ 1] 0x13 0x89 0x02 0x04 0xb4 0x05 0x80 0x04
Data[ 9] 0xd2 0x10 0xff 0xff 0x04 0x06 0xd8 0x00
Data[ 17] 0x00 0x00 0x04 0x14 0x7f 0x08 0x00 0x00
Data[ 25] 0x42 0x6c 0x1e 0x06 0x44 0x06 0xd8 0x00
Data[ 33] 0x00 0x00 0x82 0x01 0x6c 0xff 0xfc 0x84
Data[ 41] 0x01 0x06 0x00 0x00 0x00 0x00 0x03 0x22
Version 1.0 Page 9
M-Bus Driver
SCADA SOFT AG, 2002
Data[ 49] 0x02 0x12 0x00 0x05 0x2e 0x00 0x00 0x00
Data[ 57] 0x00 0x05 0x3e 0x00 0x00 0x00 0x00 0x05
Data[ 65] 0x5b 0xb4 0xf4 0xa9 0x41 0x55 0x5b 0x02
Data[ 73] 0x13 0x34 0x43 0x05 0x5f 0xcc 0xff 0xa9
Data[ 81] 0x41 0x55 0x5f 0xfa 0x2f 0x3e 0x43 0x05
Data[ 89] 0x63 0x00 0x80 0xb1 0xbb 0x55 0x63 0x0c
Data[ 97] 0x1a 0x2c 0x43 0x04 0x6d 0x2c 0x0b 0x57
Data[105] 0x0b
CRC 0x23 35
End 0x16
--> Control: 08 00001000
- Reply direction
- ACD not set
- DFC not set
Telegram type RSP_UD
--> ControlInfo: 72 01110010
% 72 variable data structure, LSB first
Ident: 04028913
Data length: 105
Manufacturer: AMT
Version: 128
Medium: 4
Access: 210
Status: 16
012 DIF: [0x04] [0 0 0 4] Instantaneous value, 32 bit integer
013 VIF: [0x06] Value = 06 --> Energy = 10(3) Wh
--> 1 buffer [|11011000|00000000|00000000|00000000| [....]] 3 ...
216
=====================================================================
==
018 DIF: [0x04] [0 0 0 4] Instantaneous value, 32 bit integer
019 VIF: [0x14] Value = 14 --> Volume = 10(-2) m3
--> 2 buffer [|01111111|00001000|00000000|00000000| [....]] 3 ...
2175
=====================================================================
==
024 DIF: [0x42] [0 1 0 2] (LSB storage) Instantaneous value, 16 bit
integer
025 VIF: [0x6c] Value = 6c --> Date
--> 3 buffer [|00011110|00000110| [..]] 3 ... 30.6.1900
Storage No: 1
=====================================================================
==
028 DIF: [0x44] [0 1 0 4] (LSB storage) Instantaneous value, 32 bit
integer
029 VIF: [0x06] Value = 06 --> Energy = 10(3) Wh
--> 4 buffer [|11011000|00000000|00000000|00000000| [....]] 3 ...
216
Storage No: 1
=====================================================================
==
Version 1.0 Page 10
M-Bus Driver
SCADA SOFT AG, 2002
034 DIF: [0x82] [1 0 0 2] (has extension) Instantaneous value, 16
bit integer
035 DIFE: [0x01] [0 0 0 1] 1 Tariff = 0, Storage = 1
036 VIF: [0x6c] Value = 6c --> Date
--> 5 buffer [|11111111|11111100| [..]] 3 ... 31.12.2027
Storage No: 2
=====================================================================
==
039 DIF: [0x84] [1 0 0 4] (has extension) Instantaneous value, 32
bit integer
040 DIFE: [0x01] [0 0 0 1] 1 Tariff = 0, Storage = 1
041 VIF: [0x06] Value = 06 --> Energy = 10(3) Wh
--> 6 buffer [|00000000|00000000|00000000|00000000| [....]] 3 ... 0
Storage No: 2
=====================================================================
==
046 DIF: [0x03] [0 0 0 3] Instantaneous value, 24 bit integer
047 VIF: [0x22] Value = 22 --> On time = hours
--> 7 buffer [|00000010|00010010|00000000| [...]] 3 ... 4610
=====================================================================
==
051 DIF: [0x05] [0 0 0 5] Instantaneous value, 32 bit real
052 VIF: [0x2e] Value = 2e --> Power = 10(3) W
--> 8 buffer [|00000000|00000000|00000000|00000000| [....]] 3 ...
0.000000
=====================================================================
==
057 DIF: [0x05] [0 0 0 5] Instantaneous value, 32 bit real
058 VIF: [0x3e] Value = 3e --> Volume flow = 10(0) m3/h
--> 9 buffer [|00000000|00000000|00000000|00000000| [....]] 3 ...
0.000000
=====================================================================
==
063 DIF: [0x05] [0 0 0 5] Instantaneous value, 32 bit real
064 VIF: [0x5b] Value = 5b --> Flow temperature = 10(0) °C
--> 10 buffer [|10110100|11110100|10101001|01000001| [...A]] 3 ...
21.244484
=====================================================================
==
069 DIF: [0x55] [0 1 1 5] (LSB storage) maximum value, 32 bit real
070 VIF: [0x5b] Value = 5b --> Flow temperature = 10(0) °C
--> 11 buffer [|00000010|00010011|00110100|01000011| [..4C]] 3 ...
180.074249
Storage No: 1
=====================================================================
==
075 DIF: [0x05] [0 0 0 5] Instantaneous value, 32 bit real
076 VIF: [0x5f] Value = 5f --> Return temperature = 10(0) °C
--> 12 buffer [|11001100|11111111|10101001|01000001| [...A]] 3 ...
21.249901
Version 1.0 Page 11
M-Bus Driver
SCADA SOFT AG, 2002
=====================================================================
==
081 DIF: [0x55] [0 1 1 5] (LSB storage) maximum value, 32 bit real
082 VIF: [0x5f] Value = 5f --> Return temperature = 10(0) °C
--> 13 buffer [|11111010|00101111|00111110|01000011| [./>C]] 3 ...
190.187408
Storage No: 1
=====================================================================
==
087 DIF: [0x05] [0 0 0 5] Instantaneous value, 32 bit real
088 VIF: [0x63] Value = 63 --> Temperature difference = 10(0) K
--> 14 buffer [|00000000|10000000|10110001|10111011| [....]] 3 ... -
0.005417
=====================================================================
==
093 DIF: [0x55] [0 1 1 5] (LSB storage) maximum value, 32 bit real
094 VIF: [0x63] Value = 63 --> Temperature difference = 10(0) K
--> 15 buffer [|00001100|00011010|00101100|01000011| [..,C]] 3 ...
172.101746
Storage No: 1
=====================================================================
==
099 DIF: [0x04] [0 0 0 4] Instantaneous value, 32 bit integer
100 VIF: [0x6d] Value = 6d --> Date'n'time
--> 16 buffer [|00101100|00001011|01010111|00001011| [,.W.]] 3 ...
23.11.2002 11.44
=====================================================================
==
Values: 16
read analyse: 0.00000 seconds
Done.
0.61000 seconds (1000)
All brand names and trade marks are copyrighted by their respective owners.
Version 1.0 Page 12