Download the solution: BottlingLine ML Demo.dbsln
This guide demonstrates how to create a complete IoT solution that collects data from the field, publishes it to an MQTT broker, historizes the data, applies machine learning models, and displays real-time values.
System Overview:
Collects data from field devices (simulated)
Publishes data to MQTT broker
Historizes data to SQLite database
Applies machine learning models to monitor anomalies
Displays real-time values in customizable dashboards
In Solution Center, click to create a new solution
Select Windows platform
Choose Portable layout (allows visualization across different devices)
Enter a solution name
Click Create Solution
Use the GPT Frameworks AI assistant to generate tags for a demo
Copy the generated table
Navigate to Unified Namespace → Tags
Paste the tags into the namespace
Copy these tags for use in the next steps
Navigate to Devices → Protocols
Select “Value Simulator” protocol and “New Channel…”
In Devices → Points, Paste the tags copied from Step 2
The Value Simulator will now generate random values for these tags
Note: The Value Simulator is used for testing purposes to generate field data.
Navigate to Devices → Protocols
Select “MQTT” protocol and “New Channel…”
Select the MQTT channel and create a new node
Configure the Primary Station:
Define broker access (e.g., HiveMQ broker)
Test the connection to verify it's working
Navigate to Points under MQTT
Select the MQTT channel created
Insert rows for all tags
Change all tags to Write mode (for publishing to broker)
Organize by node if desired
Note: For the MQTT, when no address is defined, the system uses the tag name as the MQTT topic.
Navigate to Historian module
Right-click and select Insert Rows
Paste the tags copied earlier
Data will automatically be published to Table1 (default SQLite database)
Navigate to Scripts → Classes
Click the New button
Select Import code from Library
Choose AnomalyML from the library
Click OK to open the code
Make any minor edit to the code and save it
Navigate to Scripts → Expressions
Create a new expression to monitor specific tags:
Expression Configuration:
ObjectName | Expression | Execution |
---|---|---|
Script.Class.MachineLearning.Check(<Tag>) | OnChange |
Where:
<Tag>: The tag you want to monitor with machine learning
Navigate to Displays → Home Display
Use the tree view in Drag Tags to Display to drag and drop tags onto the display
Save the display
Click Runtime → Startup → Run Startup to start the runtime
Observe real-time values changing in the displays
Test different layouts:
Desktop Layout: Full desktop view
Mobile Layout: Optimized for mobile devices (includes scrollbar for multiple objects)
Pad Layout: Tablet-optimized view