Siemens S7 Protocol Adapter
This section presents the capabilities and configuration options of the Siemens S7 Protocol Adapter, which translates the Siemens S7 communication protocol into objects understandable by the Gateway Agent.
For a step-by-step guide on how to install the Siemens S7 Protocol Adapter, see the Installation Guide.
Two-bytes Header in the String Data Type
According to Step7 specification, the string data type can occupy up to 256 bytes of memory and is constructed with a two-bytes header, followed by actual characters.
The header consists of:
maximum length of the string (1 byte) - total buffer length.
actual length of the string encoded (1 byte).
When reading the parameters that have the string data type, the two-bytes header is skipped. It means that the reading of such data from memory at a particular offset (start parameter) is actually the reading of string characters from memory starting at offset + 2.
Endianness Conversion
All integer data type read from a PLC is converted from Big Endian to Little Endian, by default.
Today SNAP7 supports S7-1500 only with optimized data blocks (little endian encoded) access turned off, so the adapter doesn't support the mixed endianness.
Configuring the Siemens S7 Protocol Adapter
There are two configuration files of the Siemens S7 Protocol Adapter:
Deployment configuration file - Configuration of the MQTT connection, PMQ connection and health monitoring.
Application configuration file - Configuration of connections, global adapter properties and device data (measurements, alerts, configuration parameters and metadata).
When you modify the Siemens S7 Protocol Adapter configuration, restart the adapter to apply the changes by means of the following command:
systemctl restart gwa-step7-adapter-c
The adapter configuration is then updated.
For an example of the Siemens S7 Protocol Adapter configuration files, see here.
Deployment Configuration File
The deployment configuration file of the Siemens S7 Protocol Adapter is located at:
/etc/relayr/gwa-step7-adapter-c/gwa-step7-adapter-config.json
To modify the file, edit it in a text editor.
The following configuration settings are available:
transport
- Communication channel used by the adapter. Available options:mqtt
orpmq
. By default,mqtt
.mqtt_connection
- Connection settings of the MQTT message broker:
Configuration Setting | Description | Default Value |
---|---|---|
host | IP address of the MQTT message broker. | localhost |
port | Port number for connecting to the MQTT broker. | 1883 |
keepalive | Keepalive value of the MQTT connection. | 20 |
max_inflight_messages | Maximum number of QoS 1 or 2 messages that can be in the process of being transmitted simultaneously. This includes messages currently going through handshakes and messages that are being retried. If set to 1 , it guarantees an in-order delivery of messages. | 100 |
qos_levels | Quality of Service level for each traffic type. | measurements: 0 , alerts: 1 . configuration: 1 , metadata: 1 |
health_monitor
- Health monitoring settings:
Configuration Setting | Description | Default Value |
---|---|---|
heartbeat_interval | Time interval at which the periodic heartbeat messages are sent, given in seconds. | 60 |
pmq_connection
- Configuration of the High Speed Bus (PMQ) connection. Configure this section to use thepmq
transport
:
Configuration Setting | Description | Default Value |
---|---|---|
output_queues | List of output PMQ queues, where the adapter reports all data, except for health monitoring messages, which are always reported via MQTT. Queue names must begin with / . | ["/step7_out_queue"] |
input_queues | List of PMQ queues to monitor for inbound messages, e.g. configuration update tasks. Queue names must begin with / . | ["/step7_in_queue"] |
message_size | Maximum size of a PMQ message, given in bytes. | 8192 |
message_count | Maximum number of messages in a PMQ queue. | 10 |
For an example of the deployment configuration file, see here.
Application Configuration File
The application configuration file of the Siemens S7 Protocol Adapter is located at:
/etc/relayr/gwa-step7-adapter-c/gwa-step7-adapter-application-config.json
If you have the Configuration Manager installed, it becomes the primary way of editing application configuration files. If you do not have the Configuration Manager, edit the application configuration file in a text editor.
The file consists of the following sections:
Connections - List of connections to devices.
Global Adapter Properties – Configuration of a global sampling interval and custom prefix.
Devices - List of connected devices and their measurements, alerts, configuration parameters and metadata.
For an example of the application configuration file, see here.
Configuring Siemens S7 Connections
Depending on the Siemens S7 mode of communication (rack/slot method or TSAP method), you should configure the connections
section of the configuration file in a different way. See the sections below to find out how to configure connections for:
Rack/Slot method - This method specifies the CPU to which the adapter is connected to, by providing the number of the rack (a.k.a. rail) and the number of the slot within the rack.
TSAP method - For more information on the TSAP connection method, see here.
Configuring Rack/Slot Connections
To configure the connections for the rack/slot method, configure the following fields:
Configuration Setting | Description |
---|---|
id | Unique connection identifier, which is then used to identify a device connection. See the Configuring a Device Connection section for more information. |
conn_method | Connection method. Enter "Rack/Slot" to use the rack/slot connection. |
host | PLC IP address. |
port | PLC port. By default, 102 . |
rack | Rack number. By default, 0 . |
slot | Slot number. By default, 2 for the S7-300 series, set it to 1 for the S7-1200 series. |
skip_device_info | Set it to true if you want to connect the S7 adapter to the Siemens LOGO! drivers, which do not support some of the adapter's functions. Those functions are then disabled and the communication with the adapter is not interrupted. The default value is false . |
Example:
"connections": [
{
"id" : "dev",
"conn_method" : "Rack/Slot",
"host" : "127.0.0.1",
"port" : 102,
"rack" : 0,
"slot" : 2
}
],
Configuring TSAP Connections
To configure the connections for the TSAP method, configure the following fields:
Configuration Setting | Description |
---|---|
id | Unique connection identifier, which is then used to identify a device connection. See the Configuring a Device Connection section for more information. |
conn_method | Connection method. Enter "TSAP" to use the TSAP connection. |
host | PLC IP address. |
port | PLC port (default value: 102). |
local_tsap | TSAP of the adapter, specified as an integer in the configuration file (default value: 768 for the S7-200 series). Consult the data sheet of your device for the specification. |
remote_tsap | TSAP of the PLC, specified as an integer in the configuration file (default value: 512 for the S7-200 series). Consult the data sheet of your device for the specification. |
skip_device_info | Set it to true if you want to connect the S7 adapter to the Siemens LOGO! drivers, which do not support some of the adapter's functions. Those functions are then disabled and the communication with the adapter is not interrupted. The default value is false . |
Example:
"connections": [
{
"id" : "dev1",
"conn_method" : "TSAP",
"host" : "127.0.0.1",
"port" : 102,
"local_tsap" : 768,
"remote_tsap" : 512
}
],
Global Adapter Properties
You can configure the following global settings that refer to the whole Protocol Adapter configuration:
Configuring Sampling Interval
The sampling interval determines how often the Agent gathers data from devices. It is a global setting that refers to retrieving data from all the connected devices.
The interval value is defined in milliseconds, e.g.:
"sampling_interval" : 4000
Optionally, you can also define a local sampling interval for each object defined in the devices
section of the configuration file. In such a case, a local sampling interval overrides the global one.
The global sampling interval is set to
4000
and the sampling interval for a temperature measurement object is2000
, so the Agent retrieves data about this temperature object every two seconds.
If you configure a local sampling interval for each object defined in the
devices
section, you do not need to configure a global sampling interval. However, if at least one object has no local sampling interval defined, the global one must be provided. Otherwise, the adapter configuration is invalid.
Configuring Custom Prefix
The custom prefix determines where to report data. If not defined, all data is reported to v1/sb
, by default.
The custom_prefix
option enables setting a different prefix to publish data e.g. to a custom MQTT topic for local data processing, or directly to the Gateway Agent northbound interface.
It is a global setting that refers to all data retrieved from devices.
Example:
"custom_prefix": "v1/nb"
Optionally, you can also define a local custom prefix for each measurement, alert, configuration parameter and metadata configured in the devices section of the configuration file. In such a case, a local custom prefix overrides the global one.
Instead of the
custom_prefix
option, you can also use thecustom_mqtt_prefix
option, which was implemented in the older adapter versions. However, it is recommended to usecustom_prefix
.
Configuring a List of Devices
In the devices
section of the configuration file, you can configure a list of devices. For each device, the following configuration sections are available:
connection - Selecting a device connection.
measurements - List of measurements that can be reported by a device.
data_blocks - Optional section. An array of blocks for data batching.
alerts - List of alerts that can be reported by a device.
configuration - Configuration parameters of a device.
metadata - List of metadata of a device.
The devices
section has the following structure:
"devices" :
[
{
"connection" : { ... },
"measurements" : [ ... ],
"data_blocks": [...],
"alerts" : [ ... ],
"configuration" : [ ... ],
"metadata" : [ ... ]
}
]
Configuring a Device Connection
In the connection.id
field, enter the connection identifier for a given device. Possible ID values are defined in the connections
section of the configuration file. See the Configuring Siemens S7 Connections section for details.
It is mandatory to configure a connection ID for each device.
Here is an example of the device connection configuration:
"devices": [
{
"connection": {
"id": "dev"
},
You can also configure a local connection ID for a specific measurement, alert, configuration parameter and metadata. If defined, the local connection ID overrides the global one, set in the
connection.id
field.
Configuring Measurements
You can define multiple measurements for a device, such as: temperature, humidity, pressure, etc.
To configure a measurement, define the following mandatory settings:
Configuration Setting | Description |
---|---|
id | Measurement identifier. A value provided here must match the measurement ID set in the device model version created in the relayr Cloud. For more information on creating device models and versions in the relayr Cloud, refer to the relayr Cloud API documentation. |
object | Protocol-specific object definition. See the Siemens S7 Object Definition section for details. |
Optionally, you can define the following advanced settings for a measurement:
Configuration Setting | Description |
---|---|
filters.cov | Change of value functionality. If it is set to enabled , measurements are reported by a device only if their value differs from the latest reported value by at least a cov_delta value. |
filters.cov_delta | Delta for the change of value functionality. It specifies the minimum change of value (in relation to the latest reported value) that is required to report the measurement to the Agent. |
sampling_interval | Local sampling interval value, given in milliseconds, that overrides the global sampling interval setting. |
custom_prefix | Prefix of the MQTT topic that the object is reported to. An option to publish data to a custom MQTT topic for a local data processing or directly to the northbound interface. For example, if it is set to analytics for a temperature measurement, all data is published to the topic analytics/{did}/measurements/temperature . It overrides the global custom prefix. |
connection | Local connection ID used for a given measurement. It overrides the global connection set for the device. Possible ID values are defined in the connections section of the configuration file. See the Configuring Siemens S7 Connections section for details. |
complex | Add this configuration section to configure a complex measurement. Specify how many data samples a complex measurement contains and, optionally, a collection_interval . For more information, see the Configuring Complex Measurements section. |
data_block | Identifier of the data block in which you want to include the measurement. See the Data Batching section for more information. |
Here is an example of the measurement configuration:
{
"id" : "temperature",
"object" : { ... },
"sampling_interval" : 4000,
"filters" : {
"cov" : "enabled",
"cov_delta" : 0.04
}
},
In the example presented above, the temperature reading is reported by the device every four seconds (as defined in the
sampling_interval
field). The change of value (cov
) is enabled, and thecov_delta
is set to0.04
. It means that the temperature is reported only if it is different from the latest reported value by at least0.04
.
Data Batching
The Siemens S7 Protocol Adapter supports the batching of measurement data.
Instead of reading each measurement separately, the adapter reads all measurements that belong to a data block at once, which improves the adapter's performance.
You can use the data batching for simple measurements only. This setting is not available for complex measurements.
To configure the data batching, follow these steps:
- Add the
data_blocks
array to the application configuration file in thedevices
section. Include the following settings for each data block:
Configuration Setting | Description |
---|---|
id | Identifier of the data block. |
sampling_interval | Interval at which the adapter reads data from the data block. |
object.memory_area | Memory area for reading data. It can be DB , AB (or Inputs ), EB (or Outputs ), or MB (or Markers )'. |
object.db_number | Data block from which the adapter gathers data. For memory areas other than DB , this field is ignored. |
object.offset | Starting address. |
object.length | Number of bytes to read. |
Example:
"data_blocks": [
{
"object": {
"memory_area": "DB",
"db_number": 2,
"offset": 0,
"length": "4"
},
"id": "db1",
"sampling_interval": 2000
},
]
- In the measurement configuration, configure these settings for measurements you want to include in a data block:
Configuration Setting | Description |
---|---|
id | Measurement identifier. |
data_block | id of the data block to which you want to assign the measurement. |
object.offset | Starting address within the data block. |
object.type | Data type. See the Data Types section for available options. The PLC Status is always sent as a boolean. |
Example:
"measurements": [
{
"id": "Temperature",
"data_block": "db1",
"object": {
"offset": 0,
"type": "SInt"
}
}
]
The data batching is now enabled.
Configuring Complex Measurements
A complex measurement is a batch of measurement data, in which several samples of collected data values are published as a single message.
Complex measurements can be consumed by the Rule Engine and the GWA Analytics for further data processing and can be stored in the Storage Service. The Cloud Adapter supports publishing complex measurements to the relayr Cloud.
You can configure the size of a complex measurement by specifying how many data samples each batch contains. Optionally, you can also specify a collection interval. If specified, the adapter starts collecting data at every collection interval (e.g. 1h) and publishes a complex measurement when a configured number of samples are collected (e.g. 1000). Then, the adapter waits for the next collection interval and starts to acquire data again.
To configure a complex measurement, add the complex
section to the measurement configuration with the following settings:
Configuration Setting | Description |
---|---|
samples | Number of collected data samples in a complex measurement. For complex measurements, this setting is mandatory. |
collection_interval | Optional setting. Time interval, given in seconds, at which the adapter starts to acquire data for a complex measurement. |
Example:
{
"object": {},
"complex":
{
"samples": 10,
"collection_interval": 3600
}
}
If the
collection_interval
is lower than needed to collect the configured number of samples, the adapter collects data continuously. It starts to acquire data immediately after publishing the previous complex measurement.
If sensors stop sending data in the middle of data collection, e.g. due to connectivity problems, the adapter waits until the required number of samples are collected, despite the collection intervals. It publishes a complex measurement that contains data points not evenly distributed in time, e.g. with a 5h gap. Such a complex measurement may be considered as incorrect and may be discarded by the Rule Engine and/or the GWA Analytics, based on the
startTs
andendTs
values.
Complex Measurement Message
The collected data samples of a configured complex measurement are published as a complex measurement message. The Protocol Adapters support acquiring and publishing complex measurements in the time domain, but you can also use complex measurement messages to publish measurements in other domains, e.g. the frequency domain.
Complex measurements in the frequency domain may be reported by the Pico Adapter, or you may use the Rule Engine or the GWA Analytics to calculate them from the time-based measurements.
In a complex measurement message:
startTs
is a moment when data acquisition begins.endTs
is a moment when data acquisition finishes.xStart
is the first value on the X axis. ThexStart
unit depends on the measured value. For measurements in the time domain, it is a timestamp indicating the moment when the first data sample is collected. For measurements in the frequency domain, it is the first frequency on the X axis.xStep
represents a resolution of data on the X axis. For measurements in the time domain,xStep
is a time interval between consecutive data samples, given in milliseconds (you configure this interval in thesampling_interval
setting of the Protocol Adapters' configuration). ThexStep
value allows you to know the precise moment when each data sample was collected. For measurements in the frequency domain,xStep
represents the frequency resolution of data representation on the X axis.yValues
is an array of ordered measurement values.
Example 1: time-based measurement:
v1/sb/{UUID}/complex_measurements/temperature {
“id”:“temperature”,
“startTs”: 1492515087123,
“endTs”: 1492515092123,
“xStart”: 1492515087123,
“xStep”: 1000,
“yValues”: [42, 43, 39, 37, 40, 48, 45, 40, 38, 33, 30, 31...]
}
In this example,
temperature
is a time-based measurement. ThexStart
value is1492515087123
, which shows the moment when the first data sample (42
) was collected. ThexStep
value is1000
, which means that consecutive data samples were collected at the interval of 1000 milliseconds.
Example 2: frequency-based measurement:
v1/sb/{UUID}/complex_measurements/acceleration_xaxis_fft {
“id”:“acceleration_xaxis_fft”,
“startTs”: 1492515087123,
“endTs”: 1492515092123,
“xStart”: 90,
“xStep”: 10,
“yValues”: [3, 12, 48, 579, 644, 689, 711, 647, 78, 644, 669, 112, 638, 652, 617, 48...]
}
In this example,
acceleration_xaxis_fft
is a frequency-based measurement. ThexStart
value is90
, which shows that the first frequency on the X axis is 90 Hz. ThexStep
value is10
, which means that the frequency step on the X axis, between consecutive data samples, is 10 Hz.
Configuring Alerts
In the alerts
configuration section, you can define alerts for the configured devices.
To configure an alert, define the following mandatory settings:
Configuration Setting | Description |
---|---|
id | Alert identifier. A value provided here must match the alert ID of the device model created in the relayr Cloud. For more information on creating device models and versions in the relayr Cloud, refer to the relayr Cloud API documentation. |
measurement_id | Identifier of a measurement associated with the alert. The ID provided here must be configured in the measurements section of the configuration file. See the section above for details. Alternatively, you can configure the object section for an alert. See here for details. |
threshold_set | Threshold value based on which the alert is activated. |
logic_set | Logical relation for alert activation. Possible values are: "<", ">", "==", "">=", "<=". |
message_set | Message sent when the alert is activated. It is a free-form string. |
threshold_clear | Threshold value based on which the alert is cleared. |
logic_clear | Logical relation for clearing the alert. Possible values are: "<", ">", "==", "">=", "<=". |
message_clear | Message displayed when the alert is cleared. It is a free-form string. |
If both the
logic_clear
andlogic_set
conditions are fulfilled at the same time, the alert is set.
Optionally, you can define the following advanced settings for an alert:
Configuration Setting | Description |
---|---|
sampling_interval | Local sampling interval value, given in milliseconds, that overrides the global sampling interval setting. |
custom_prefix | Prefix of the MQTT topic that the object is reported to. An option to publish data to a custom MQTT topic for a local data processing or directly to the northbound interface. For example, if it is set to analytics for a temperature-based alert, all data is published to the topic analytics/{did}/alerts/alert_temp_high . It overrides the global custom prefix. |
connection | Local connection ID used for a given alert. It overrides the global connection set for the device. Possible ID values are defined in the connections section of the configuration file. See the Configuring Siemens S7 Connections section for details. |
Here is an example of the alert configuration:
{
"id" : "alert_temp_high",
"measurement_id" : "temperature",
"threshold_set" : 38.5,
"logic_set" : ">=",
"message_set" : "TEMPERATURE IS TOO HIGH",
"threshold_clear" : 36.5,
"logic_clear" : "<=",
"message_clear" : "ALERT IS CLEAR",
"sampling_interval" : 4000
},
In the example presented above, the alert is activated if the temperature reaches a level defined in the
threshold_set
andlogic_set
fields, that is: if it is greater than or equal to 38.5. The message "TEMPERATURE IS TOO HIGH" is sent to the relayr Cloud when the alert is set.
When the temperature decreases and it is smaller than or equal to 36.5 (as specified in thethreshold_clear
andlogic_clear
fields), the alert is deactivated and the message "ALERT IS CLEAR" is sent to the relayr Cloud when the alert is deactivated.
The value provided in thesampling_interval
field means that the system verifies the alert data every four seconds.
Configuring Configuration Parameters
In the configuration
section, you can define the device configuration parameters.
To define a configuration parameter, define the following mandatory settings:
Configuration Setting | Description |
---|---|
id | Configuration object identifier. |
object | Protocol-specific object definition. See the Siemens S7 Object Definition section for details. |
Optionally, you can define the following advanced settings for a configuration parameter:
Configuration Setting | Description |
---|---|
ro | This setting determines if a given configuration parameter is read-only (if set to true ) or the read/write permissions are granted to it (if set to false ). If no ro value is defined, the object has read/write permissions, by default. |
sampling_interval | Local sampling interval value, given in milliseconds, that overrides the global sampling interval setting. |
custom_prefix | Prefix of the MQTT topic that the object is reported to. An option to publish data to a custom MQTT topic for a local data processing or directly to the northbound interface. For example, if it is set to analytics for a configuration parameter xyz , all data is published to the topic analytics/{did}/configuration/xyz . It overrides the global custom prefix. |
connection | Local connection ID used for a given configuration parameter. It overrides the global connection set for the device. Possible ID values are defined in the connections section of the configuration file. See the Configuring Siemens S7 Connections section for details. |
Here is an example of the configuration settings:
{
"id" : "parameter2045",
"object" : { ... },
"sampling_interval" : 4000,
"ro" : true
},
Configuring Metadata
The metadata
section of the configuration file allows you to define device attributes, such as the device ID, model, version, location, owner's email address, etc.
There are two ways to configure metadata:
Static Metadata - metadata is an
id
andvalue
pair. It is sent only once, at the application startup.Dynamic metadata - metadata has a defined
object
. It is reported not only at the application startup, but also when the metadata value changes.
Static Metadata
Static metadata is configured as an id
and value
pair.
Static metadata is reported only once, at the application startup. To provide support for reporting a changing metadata value, configure dynamic metadata.
To configure the device static metadata, define the following values:
Configuration Setting | Description |
---|---|
id | Metadata identifier. |
value | Metadata value. |
Optionally, you can configure the following metadata settings:
Configuration Setting | Description |
---|---|
custom_prefix | Prefix of the MQTT topic that the object is reported to. An option to publish data to a custom MQTT topic for a local data processing or directly to the northbound interface. For example, if it is set to analytics for metadata serial_number , all data is published to the topic analytics/{did}/metadata/serial_number . It overrides the global custom prefix. |
It is mandatory to define the device ID (
did
) for each device. Thedid
value must match the UUID of the device created in the relayr Cloud.
For more information on creating devices in the Cloud, refer to the relayr Cloud API documentation.
The device
did
cannot contain spaces and plus (+) characters.
Here is an example of the device static metadata:
"metadata": [
{
"id": "did",
"value": "f33c6bah-b31e-4f5a-964h-13a935a8b25f"
}
]
Dynamic Metadata
Dynamic metadata is configured with a protocol-specific object
.
Dynamic metadata is published only if its value changes.
To report a metadata value dynamically, configure the following settings:
Configuration Setting | Description |
---|---|
id | Metadata identifier. |
object | Protocol-specific object definition. See the Siemens S7 Object Definition section for details. |
Optionally, you can configure the following dynamic metadata settings:
Configuration Setting | Description |
---|---|
custom_prefix | Prefix of the MQTT topic that the object is reported to. An option to publish data to a custom MQTT topic for a local data processing or directly to the northbound interface. For example, if it is set to analytics for metadata serial_number , all data is published to the topic analytics/{did}/metadata/serial_number . It overrides the global custom prefix. |
sampling_interval | Local sampling interval value, given in milliseconds, that overrides the global sampling interval. |
connection | Local connection ID used for given metadata. It overrides the global connection set for the device. Possible ID values are defined in the connections section of the configuration file. See the Configuring Siemens S7 Connections section for details. |
Here is an example of the device dynamic metadata:
"metadata": [
{
"id" : "serial_number",
"object" : { ... },
"sampling_interval" : 4000,
"custom_prefix" : "v1/nb"
},
Siemens S7 Object Definition
For each configured measurement, configuration parameter and dynamic metadata, you must add a protocol-specific object
configuration section with the following settings:
Configuration Setting | Description |
---|---|
memory_area | Memory area of the read data. It can be DB , AB (or Inputs ), EB (or Outputs ), MB (or Markers ), or Status . |
db_number | Data block from which the adapter gathers data. For memory areas other than DB , this field is ignored. |
offset | Starting address. |
type | Data type. See below for available options. The PLC Status is always sent as a boolean. |
Example:
"object": {
"memory_area": "DB",
"db_number": 2,
"offset": 1,
"type": "Bit",
"bit": 1
}
To send measurement data in batches, you must use a different
object
format for these measurements and for the data block configuration. See the Data Batching section for more information.
Data Types
The Siemens S7 Protocol Adapter supports the following data types:
Integer types:
USInt
(8-bit unsigned integer)SInt
(8-bit signed integer)UInt
(16-bit unsigned integer)Int
(16-bit signed integer)UDInt
(32-bit unsigned integer)DInt
(32-bit signed integer)LDInt
(64-bit unsigned integer)LInt
(64-bit signed integer)
Floating point types:
Real
(32-bit IEEE 754 value)LReal
(64-bit IEEE 754 value)
Additional types:
String
(variable length ASCII string)
The
String
type requires setting an explicit length. The S7 string header is skipped when reading and thus not parsed. Example:
{
"memory_area": "Markers" ,
"offset": 0,
"type": "String",
"length": 10
}
Bit
(single bit boolean)
The
Bit
type requires setting an explicit bit offset inside the read byte. It defaults to the0-th
bit. Example:
{
"memory_area": "Markers" ,
"offset": 0,
"type": "Bit",
"bit": 7
}
Examples of Configuration Files
Deployment Configuration File
{
"transport": "mqtt",
"mqtt_connection": {
"host": "localhost",
"port": 1883,
"keepalive": 20,
"max_inflight_messages": 100,
"qos_levels": {
"measurements": 0,
"alerts": 1,
"configuration": 1,
"metadata": 1
}
},
"health_monitor": {
"heartbeat_interval": 60
},
"pmq_connection":
{
"input_queues" : ["/step7_in_queue"],
"output_queues" : ["/step7_out_queue"],
"message_size": 8192,
"message_count": 10
}
}
Application Configuration File
{
"connections": [
{
"id": "dev",
"conn_method": "Rack/Slot",
"host": "127.0.0.1",
"port": 102,
"rack": 0,
"slot": 2,
"skip_device_info": false
}
],
"sampling_interval": 20000,
"devices": [
{
"connection": {
"id": "dev"
},
"measurements": [
{
"object": {
"memory_area": "DB",
"db_number": 2,
"offset": 1,
"type": "Bit",
"bit": 1
},
"id": "bool",
"sampling_interval": 2000
},
{
"object": {
"memory_area": "DB",
"db_number": 1,
"offset": 1,
"type": "SInt"
},
"id": "int",
"sampling_interval": 2000
},
{
"object": {
"memory_area": "DB",
"db_number": 1,
"offset": 24,
"type": "string",
"length": 10
},
"id": "string",
"sampling_interval": 2000
},
{
"object": {
"memory_area": "Status"
},
"id": "status",
"sampling_interval": 2000
}
],
"alerts": [],
"configuration": [],
"metadata": [
{
"id": "did",
"value": "some_did"
},
{
"id": "model_id",
"value": "model_id"
},
{
"id": "model_version",
"value": "1"
},
{
"id": "dynamic_metadata",
"object": {
"memory_area": "DB",
"db_number": 1,
"offset": 24,
"type": "string",
"length": 10
},
"sampling_interval" : 3600000
}
]
}
]
}