This example is intended to show you how to use this application using a sinus variable.
You will create a tag in the Simulation UI, connect the tag with IIH Essentials, display the tag via browser and finally visualize the tag via Node-RED.
If you are interested in how the application example works in the implementation guide you can find more details.
To follow this application example, you must carry out the following steps:
To start the Docker container, follow these steps:
NOTE: Linux is used for this application example
- Go to your Linux system.
- Open the console in the directory in which the application should be stored
- Clone the application example using the following command and then change the working directory:
git clone https://github.com/industrial-edge/iih-essentials-development-kit-getting-started.git
cd ./iih-essentials-development-kit-getting-started
This downloaded GitHub-Repository contains:
- Docs: Here you will find the user documentation of the application example and more implementation details to understand the way it works
- Node-RED flow for the visualization of the data
- docker-compose.example.yml: An example docker compose file that can be used to run this application example which specifies the services, addresses, communication, etc.
- Start the containers by executing:
docker-compose up
All service images are downloaded from Docker Hub and launched as defined in the docker-compose.yml
file.
To create a tag, follow these steps:
-
Open a browser.
-
To access the Simulation UI, enter the following address: http://localhost:4519
-
Add a simulation group with following configuration and create it
- Period: 1 minute
- Cycle: 1 second
- Add a new simulation variable to the created group
- set the name to "Sinus"
- type should be "Int"
- add a simulation with following configuration
- choose "sinus"
- Period: 1 minute
- Amplitude: 20
- Zeropoint: 0
- click on "Save"
- click on "Create"
To connect the tag to the IIH Essentials, follow these steps:
- Open a browser.
- To access the IIH Essentials UI, enter the following address: http://localhost:4203
- Go to connectors and configure the connector to get the data from the simulation
If configured correctly, it should look like this:
- Create a new asset with following configuration and add it
- Name: Example Asset
- Create a Variable with following configuration and add it
- Connector: Simulation Connector
- Choose the created Tag "New Simulation Group/Sinus"
If the simulation variable has been successfully connected to the IIH Essentials, you can see the current value of the variable.
-
Create a folder in the same path where your docker compose file is located and run the following command to make sure you have the right permission.
mkdir export sudo chown -R 1000:1000 ./export
-
Open a browser.
-
Access Node-RED To start Node-RED, enter the following address: http://localhost:1880
-
Install the
node-red-dashboard
if it's not installed yetTo install the node-red-dashboard, open "Manage palette" in the menu. In the tab "Install" search for
node-red-dashboard
and install it -
If the flow is missing import the Flow
To do so, open "Import" in the menu. Select the file, that should be imported, and click on "Import" The Flow contains following nodes:
-
Deploy the flow and access the dashboard by accessing
http://localhost:1880/ui
-
Adjust the
From
andTo
variables based on your needs or leave it as it is for current date. -
Go back to your flow and double click on the
IIH Essentials Read Variables
sub-flow. Make sure the "Variable names" match your variable inside of IIH Essentials.
NOTE: If you multiple variables, you can write them all in the "Variable names" setting sparated by commas without spaces.
-
Activate the inject buttons as described in the picture below.
-
Go back to the dashboard. You shoul be able to see your data visualized.