- Installation
Download or clone the repository source code to your workstation.
- Trough terminal:
git clone https://github.com/industrial-edge/pingpong-csharp.git
- Trough VSCode:
CTRL+↑ SHIFT+P or F1 to open VSCode's command pallette and typegit clone
:
- Navigate into
src
and find the file namedDockerfile.example
. TheDockerfile.example
is an example Dockerfile that can be used to build the docker image(s) of the service(s) that runs in this application example. If you choose to use these, rename them toDockerfile
before proceeding - Open a console in the root folder (where the
docker-compose
file is) - Use the
docker compose build
(replaces the olderdocker-compose build
) command to build the docker image of the service which is specified in the docker-compose.yml file. - These Docker images can now be used to build your app with the Industrial Edge App Publisher
docker images
can be used to check for the images
For the PingPong application the databus must provide two topics to publish and subscribe to.
- Open the Industrial Edge Management web interface
- Go to "Data Connections" > Databus
- Select the corresponding Industrial Edge Device
- Create a new user with username and password and give the user publish and subscribe permission
- Create two topics for the PingPong application
- Deploy the databus configuration and wait for the job to be finished successfully
The following parameter must be configured for the PingPong application:
- "MQTT_USER": username of the databus user
- "MQTT_PASSWORD": password of the databus user
- "MQTT_IP": name of the databus service name - serve as DNS resolution (ie_databus / ie-databus (> V1.0))
- "TOPIC_1": databus topic to which the application subscribes to
- "TOPIC_2": databus topic to which the application publishes to
The configuration file has to be named mqtt-config.json
.
Below two ways are described to create the configuration file.
Here a fixed configuration file is created, that can not be modified during the installation of the application. It has to be structured like the following example:
{
"MQTT_USER":"edge",
"MQTT_PASSWORD":"edge",
"MQTT_IP":"ie-databus",
"TOPIC_1":"topic1",
"TOPIC_2":"topic1"
}
This repository already provides that configuration file here.
In this example, the application will authenticate to the databus with the username edge
and password edge
. It will subscribe to topic1
and will publish to topic2
.
Here the system app IE Configuration Service is used to create an UI for the configuration of the application. The UI is based on a JSON Forms file, that is integrated as a configuration template via the Publisher. By using this configuration during the installation, the user can fill out the parameter individual.
First the system app IE Configuration Service must be installed on the IEM.
Then a JSON Forms file must be created, consisting of an UI schema and a data schema. Please see this getting started to learn more about JSON Forms. The file should look like this:
This repository already provides that JSON Forms configuration file here.
Please refer to Uploading App to IEM on how to upload the app to the IEM. In the Industrial Edge App Publisher, use the docker-compose.yml
file of this application example when building the docker image.
An application can provide several configurations, that can be selected during installation.
If no configuration is used (e.g. if the application is deployed as a standalone application), the application will use the corresponding environmental variables specified in the docker-compose.yml
file.
- Open the Industrial Edge Management web interface
- Go to "Applications" > "My Projects"
- Open the PingPong application
- Click on "Configurations" > "Add Configuration"
- Enter a name and description
- Enter
./cfg-data
as host path - Enter a template name and description
- Browse for the
mqtt-config.json
file created here - Click "Add"
- Open the Industrial Edge App Publisher
- Open the PingPong application
- Click on "Configurations" > "Add Configuration"
- Enter a name and description
- Enter
./cfg-data
as host path - Enter a template name and description
- Browse for the
mqtt-config.json
file created here - Activate "Json Schema"
- Click "Add"
- Open the Industrial Edge Management web interface
- Go to "Applications" > "My Projects"
- Open the PingPong application
- Click on the install button on the right of the version you want to deploy
- Under "Schema Configurations" select the above created UI configuration and fill the parameter
OR
- Under "Other Configurations" select the above created file configuration
- Select the corresponing Industrial Edge Device
- Click "Install Now" and wait for the job to be finished successfully
When the PingPong application is deployed and running on the Industrial Edge Device, it can be tested using the Simatic Flow Creator.