F&B Bottling line showcase
Overview
The "F&B Bottling Line Showcase” is a Mendix app to showcase the capabilities of Mendix on Edge, built around the use case of a bottling line. In order to properly run the app, you need a (virtual) Siemens Industrial Edge device. The Mendix app utilizes two available Marketplace components developed for Siemens Industrial Edge (the Industrial Edge Device API Connector and the Industrial Edge IIH Essentials Connector) to connect to the Edge device and get the IIH Essentials data to display it on a dashboard, simulating a bottling line whilst displaying the number of bottles produced, total energy consumption and tank levels.
Documentation
Usages
The F&B Bottling Line Showcase can be used to showcase the capabilities of Mendix on Edge. It could also be used as an example implementation of various Mendix modules developed for the Siemens Industrial Edge (more specifically, the IIH Essentials Connector and the Device API Connector).
Prerequisites
In order to run the app, you need a (virtual) Siemens Industrial Edge device. If you want to follow this manual, make sure you have the following apps installed on your Edge device:
- Databus
- Flow Creator
- IIH Essentials
To run the app locally in Studio Pro, ensure the following dependencies are installed from the Marketplace:
- Mendix Version 10.12.3 or higher
You can also run the app directly on your Edge device. For that, find this app in the Siemens Industrial Edge Catalog.
Instructions
Step 1: Download the project
- Find the Bottling Line app on the Mendix marketplace
Step 2: Configuring Studio Pro
- Since you are not running your app directly on the Edge, you are connecting your app to an external Edge device. This means you need a certificate. Please follow these steps:
- Go to your Edge Device’s UI by entering it’s IP address in your browser
- Click ‘Settings’ and then ‘System’
- Click ‘Download Edge Device Certificate Chain’
- Go back to Studio Pro and click ‘Settings’
- At ‘Certificates’, upload the certificate you just downloaded
- Next, make sure you have an encryption key set up for Encryption.EncryptionKey. This should be any string of 32 characters
- Tip: when running locally, you can go to Settings > Configurations > Constants to set up these values. If you ever wish to deploy your app to the Edge however, this configuration will not be available
Step 3: Configuring the Mendix app through the app’s frontend
- Log in as MxAdmin
- Go to ‘Device Management’
- Set up a main device under ‘This Device’. Since you will connect to this device, you can mock up the credentials
- Now, set up a device under ‘External Devices’. This will be the device you will connect to, so make sure the username, password and device IP-address match
- Click the slider to connect to the device
- Next, go to ‘Select IIH Device’ and select the device you just configured
Step 4: Setting up IIH Essentials
The dashboard was built to display the data of specifically named variables, belonging to a specific asset structure. It uses the IIH Connector module to obtain the data via REST calls. In order to have matching assets and variables in IIH, it is important to upload the provided back-up document to IIH Essentials (JSON_IIHEssentials_BackupConfig), which you can find in the _USE_ME folder of Studio Pro. Please copy the content of the json snippet as text, and save it as an actual json file since the IIH Essentials expects json format. To upload the json file to IIH Essentials, follow the steps below:
- Open IIH Essentials
- Click ‘Settings’ and then ‘Backup and restore’
- Under ‘Data recovery’, upload the json file
Step 5: Setting up Databus
Databus is a MQTT broker that is used for publishing the data points to specific topics. If you haven’t set up a connection between Databus and IIH Essentials yet, please follow these instructions.
Step 6: Setting up Flow Creator
IIH Essentials itself receives the data by subscribing to topics where the data is published via the Databus. The data generation part is done by Flow Creator. Please use the provided json file (JSON_BottlingLineFlowCreator), to be found in the _USE_ME folder in Studio Pro, and import it to Flow Creator. Like with the IIH backup file, make sure to copy the text of the json snippet, and save it as an actual .json file.
For more comprehensive instructions on importing json files to Flow Creator, please consult this learning path. It’s about importing a simulation file specific to that learning path, but the same principles apply. Here’s a quick summary:
- After logging in to Flow Creator, click the hamburger menu on the top right
- Click import and upload the JSON
- A structure showing variables and flows should now be visible in your Flow Creator canvas
- Click the block representing the mqtt out node ‘ie/m/j/simatic/v1/s7c1simulation/dp’. It’s to the right of the ‘inject’ block
- Now click the pencil icon and open the security tab
- For username and password, please use the same username and password you have used to set up the connection between the Databus and IIH Essentials
- Click Update
- Click Deploy (top right)
- Next, hit ‘inject’ (the square in front of the block, is a button)
Step 7: View the app
Log in as Line Operator and view the dashboard. Use the Admin user role to set up alerts.