App for extend connection capability to opc-xml da device enabled
- OPC-XML DA CONNECTOR
The opc-xml da connector extend the connectivity of the Siemens Industrial Edge Platform, allowing to retrive data from devices where opc-xml da is the only choice for sending data. It borns mainly for solving the problem of connecting Siemens Simotion Devices with deprecated firmware (v4.4). As connector, the application will provide data in the form of json messages, under custom defined MQTT topic. The storage of collected information could be then manipulated, i.e. with Industrial Edge Flow Creator, for possible long term historicization.
This guide describes how to use and install the opc-xml da connector.
Check the requirements in the Requirements section before proceeding with the installation. Details for the installation procedure can be found in the Installation section.
For details on how to use the Industrial Edge Flow Creator service see the Using section and for all online references on using it see the Documentation section.
The application comes with some Application Examples in the dedicated section.
The Build section shows in detail how this application was built using the Docker environment
- OS: Windows or Linux
- Visual Studio Professionals 2019
- Docker minimum V18.09
- Docker Compose V2.0 - V2.4
- Industrial Edge App Publisher (IEAP) V1.4.3
- Industrial Edge Management (IEM) V1.4.11
- Industrial Edge Device (IED) V1.5.0-21
The opc-xml da application is only compatible with SIEMENS devices that have Industrial Edge functionality enabled.
The edge-grafana application needs 100 MB of RAM to run:
Service Name | Memory Limit |
---|---|
opc-xml da connector | 100 MB |
Note: This limit has been set after testing the connection on a low-medium number of devices,but can be modified according to your needs by acting on the docker-compose file and then on the app configuration in the Edge App Publisher software, creating a custom version of this application.
Below you will find the steps required to download the pre-compiled app or to create and install an edge app from the source code provided here.
You can either import a directly downloadable .app file below, or use the provided source code to build a new app from scratch.
Please refer to the Documentation section for detailed information on Industrial Edge application development.
The edge-grafana application can be downloaded in .app format using this secure Google Drive link:
- Open the Industrial Edge App Publisher software
- Import the
opc-xml-da-connector_0.0.20.app
file using the Import button - The new imported application will appear in the Standalone Applications section
- Open the Industrial Edge App Publisher software
- Go to the Standalone Applications section and create a new application
- Import the docker-compose file using the Import YAML button
- Click on Review and then on Validate & Create.
Below is a brief description on how to publish your application to your IEM.
For more detailed information please see the official Industrial Edge GitHub guide to uploading apps to the IEM and the Documentation section.
- Connect your Industrial Edge App Publisher to your Docker Engine
- Connect your Industrial Edge App Publisher to your Industrial Edge Management
- Create a new Apps project in the connected IEM or select an existing one
- Import the app version created in the Standalone Applications section into the selected IEM project
- Press Start Upload to transfer the application into Industrial Edge Management
To configure this app, two configuration files are needed:
- the config.json
- the mqtt-config.json
both deployed togheter with the app. Below an example of the two configuration files:
#config.json
[
##### First Device ######
{
"ID" : 0,
"IP": "192.168.1.2",
"USER": "simotion",
"PASS": "simotion",
"VARIABLES": [ "unit/Programm.variabile"]
}
##### Second Device ######
{
"ID" : 1,
"IP": "192.168.1.3",
"USER": "simotion",
"PASS": "simotion",
"VARIABLES": [ "unit/Programm.variabile2" ]
}
]
#mqtt-config.json
{
"MQTT_USER":"user",
"MQTT_PASSWORD":"password",
"MQTT_IP":"ie-databus",
"PUB_TOPIC":"ie/opcxml",
"SUB_TOPIC":"topic2"
}
Based on the first configuration above config.json, the app is able to establish the connection with the listed device, searching for the list of variables requested. The browsing of the variable is possible due to the simotion property of making visible the variables requested. Thus, is needed from the user a prerequisite know-how of the data to collect, since browsing of the variables is not yet implemented in the app. With the second configuration mqtt-config.json, the app will create an MQTT CLIENT for the connection with the broker Industrial Edge Databus publishing the required data on the PUB_TOPIC
The edge-grafana application is built from a Docker Alpine image where a version of Grafana is installed with some customizations such as preconfigured datasources provisioning, dedicated settings for operation and the industrialedge-dataservice-datasource plugin.
Refer to the Dockerfile used for building the image.
The creation of docker file can be easily fullfilled thanks to the Add-on present in any of the latest Visual Studio version. For Creating it from the scretch, please look at the code below where the dotnet structure is restored for the publishing of the .dll builded.
FROM mcr.microsoft.com/dotnet/core/runtime:3.1-buster-slim AS base
WORKDIR /app
FROM mcr.microsoft.com/dotnet/core/sdk:3.1-buster AS build
WORKDIR /src
COPY ["opc-xml-da-connector/opc-xml-da-connector.csproj", "opc-xml-da-connector/"]
RUN dotnet restore "opc-xml-da-connector/opc-xml-da-connector.csproj"
COPY . .
WORKDIR "/src/opc-xml-da-connector"
RUN dotnet build "opc-xml-da-connector.csproj" -c Release -o /app/build
FROM build AS publish
RUN dotnet publish "opc-xml-da-connector.csproj" -c Release -o /app/publish
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "opc-xml-da-connector.dll"]
Hence, is important that in the structure of the folder is present the .csproj
file that build the entire solution inside the dotnet image
Below are then presented the structure of the docker-compose.yaml
that needs the definition of the L2 network for establishing correctly the connection to the opc-xml-da server present at simotion side.
version: '2.4'
services:
opc-xml-da-connector:
image: opc-xml-da-connector
build:
context: .
dockerfile: opc-xml-da-connector/Dockerfile
volumes:
- ./cfg-data/:/app/cfg-data/
cap_add:
- NET_ADMIN
networks:
- proxy-redirect
- zzz_layer2_net1
networks:
## Network for accessing INDUSTRIAL EDGE DATABUS ##
proxy-redirect:
external: true
name: proxy-redirect
## Network L2 for accessing OPC-XML-DA DEVICE ##
zzz_layer2_net1:
external: true
name: zzz_layer2_net1
The data will be published to the topic <PUB_TOPIC>/
every 100
milliseconds.
For example, based on the configuration above, the data received for datasource on topic ie/opcxml will be like:
{
"SimotionID" : "0",
"datapointDefinition" : [
{
"Date" : "1992-02-10T22:11:38.08+00.00",
"Value" : "219",
"ItemName" : "unit/Programm.variabile",
"ItemPath" : "SIMOTION"
}
]
}
You can find further documentation and help about Industrial Edge in the following links:
- SIOS - Industrial Edge Flow Creator
- SIOS - DataService Application Manual
- SIOS - Dataservice Development Kit
You can find further documentation and help about Industrial Edge in the following links:
- Industrial Edge Hub
- Industrial Edge Forum
- Industrial Edge landing page
- Industrial Edge GitHub page
- Industrial Edge App Developer Guide
Thanks for your interest in contributing. Anybody is free to report bugs, unclear documentation, and other problems regarding this repository in the Issues section or, even better, is free to propose any changes to this repository using Merge Requests.
Please read the Legal Information.