M-Bus read data

 

The function block enables the access to the data of m-bus devices. Learn about how data is being provided in the chapter „Data determination“.

In the parameter dialog, available devices and data records are provided. On the first line in the function block, a possible combination of producer/product and/or medium is outlined. In the second line, the unit of the value is shown at the Output Value (if it has been configured in the device).

Function blocks, which are incompatible during the change between run mode and before downloading, are depicted red as an error.They can be identified in the browser.

Providing and identifying data during runtime can result in different states, which are described in the paragraph „State messages“.

Signals

Name I/O Type(s) Function
State O UCHAR Status of the request
Value O UCHAR, WORD, LONG, LONGLONG, FLOAT, DYNTEXT Output signal

Parametrization

The parametrization can only be conducted in edit mode!

Reading the M-Bus information can be effected in a loaded project during parametrization or over the Tools menu (see chapter „Read configuration“).If a configuration is loaded from the system, it will be stored in the project directory. A function block can be assigned a data record from the provided data. Subsequently, the function block updates the type of its data output (incompatible connections will be deleted).

Data determination

Devices, which support M-Bus, and in which the usage of M-Bus is enabled in the configuration (characteristic of the runtime system), will start a device scan over the interface configured by the system. The scan will be executed over the addresses 0-250. Currently only primary addresses will be considered. The scan can take several minutes. The function blocks will send a corresponding status message.

All devices found are administered in an internal list. After the scan, as quick as possible (depending on the amount of data of the devices) and with a break of 10 ms between the devices, the data is updated in the list.

Read configuration

To be able to read a configuration, a connection to a device, which supports an M-Bus connection, has to be built up. For that reason the logon dialog will be called after clicking on the “connect” button.

When the connection is built, the currently identified data about the M-Bus subscribers are shown as an overview.

For updating the data, the button “Force scan” has to be used. This process can take some minutes. The progress is shown in the dialog.

As soon as the scan finishes, the data can be read from the system into the project directory. This can be effected by pressing the button “load”. After that, all modes will be updated.

State messages

Value Beschreibung
0 No errors/no warnings
1 An M-Bus scan is being processed (during initiation of the controller and/or after activation of a scan in the parameter dialog)
2 The M-Bus data inquiry blocks the current access to this data record or device.
3 The necessary internal memory could not be provided.
4 The output format is not considered
5 The request to the configured device could not be made.
6 No answer to a previously inquired device has been received.
100 All necessary information for data acquisition are available.
110 The address cannot be found in the currently valid configuration.
111 The data record is not available.
112 The data type is not supported.
113 The length is not correct.
114 The format is not compatible.
115 An error occurred during the reading process of the configuration of a device.
116 The data type is not compatible