Skip to content

Configuring MindConnect element using API

AgentManagement API

You can configure MindConnect elements via api calls with public API’s that are offered from MindSphere. To update the data source configuration of AgentManagement api, refer to the endpoint "Data Source Configuration Operations" in Agent Management Service – API Specification.

For more information on how to authenticate and how to get the information related with the MindConnect element from MindSphere, refer to Develop for MindSphere.

This below information will show, how to structure the configuration part for the above api request for specific industrial protocols.

Protocol configurations

You can configure the device to AgentManagement using the below protocol specific configurations that needs to be configured in the api call.

Note

In case the body structure is not as expected, the configuration might be rejected or may lead to corrupt configuration on MindSphere. Always verify the operation from MindConnect Element UI.

The json configuration in body part of the request consists of below key-value pairs. All the documented key-value pairs given below are important. The customData child fields of dataPoints and dataSource items are free formatted fields and should be a valid json. Below is the configuration body:

    {
      "name": "DataSource Name",
      "customData": {
          "protocol": "Name of the protocol",
          "protocolData": { },
          "readCycleInSeconds": "Value"
      },
      "description": "",
      "dataPoints": [
          {
            "id": "a37d9e1fee6b4",
            "name": "DatapointName",
            "description": "-",
            "unit": "Unit",
            "type": "Type",
            "customData": {
                "dataPointData": { }
            }
          }
      ]
    }

Note

The above key-value pairs are important for the body, if missing any key-value pair will result in configuration failure.

Each protocol has it's unique protocolData representing its protocol specific fields and dataPointData field for representing it's unique datapoint configuration. In order to get the successful configuration for each one of the protocol, the free formatted parts of the body needs to be a valid json. Otherwise, the configuration will be failed.

The below given an example of how to configure a datasource with one datapoint for S7 protocol:

Note

  • The below json content can be changed as required, do not depend on it strictly.
  • The free formatted fields "protocolData" and "dataPointData" has a specific configuration to S7 protocol.
    {
        "name": "S7DS",
        "customData": {
            "protocol": "S7",
            "protocolData": {
                "ipAddress": "192.168.0.1",
                "manualRackAndSlot": "Automatic",
                "rackNumber": "0",
                "slotNumber": "2"
            },
            "readCycleInSeconds": "1"
        },
        "description": "",
        "dataPoints": [
            {
                "id": "a37d9e1fee6b4",
                "name": "DatapointName",
                "description": "-",
                "unit": "%",
                "type": "LONG",
                "customData": {
                    "dataPointData": {
                        "address": "DB1.DBWORD0",
                        "hysteresis": "0",
                        "onDataChanged": false,
                        "acquisitionType": "WRITE"
                    }
                }
            }
        ]
    }

Getting Configuration Details of Protocols

To get the configurations details for other protocols such as Modbus, Ethernet IP etc, the API of AgentManagement can be used to get the configuration details. The initial configuration can be done via UI and then using the below API config, it can be extracted and used for API call s and later for structuring.

Note

The json content of each protocol varies and should be extracted after an initial UI configuratio

To get the data source configuration of AgentManagement api, refer to the endpoint "Data Source Configuration Operations" in Agent Management Service – API Specification.

Any questions left?

Ask the community


Except where otherwise noted, content on this site is licensed under the MindSphere Development License Agreement.


Last update: May 19, 2022