Community Tip - Did you get called away in the middle of writing a post? Don't worry you can find your unfinished post later in the Drafts section of your profile page. X
This project will introduce you to methods for creating the data model that you have designed and are ready to implement. Following the steps in this guide, you will implement the Data Model you've already designed. After having insight into your desired Data Model, this guide will provide instructions and examples on how to build out your application using the ThingWorx platform.
We will teach you how to utilize the ThingWorx platform to implement your fully functional IoT application. NOTE: This guide’s content aligns with ThingWorx 9.3. The estimated time to complete ALL 3 parts of this guide is 60 minutes. All content is relevant but there are additional tools and design patterns you should be aware. Please go to this link for more details.
Download the completed files for this tutorial: DataModelEntities.xml.
The DataModelEntities.xml file provided to you contains a completed example of the completed data model implementation. Utilize this file to see a finished example and return to it as a reference if you become stuck during this guide and need some extra help or clarification. Keep in mind, this download uses the exact names for entities used in this tutorial. If you would like to import this example and also create entities on your own, change the names of the entities you create.
This guide will implement the scenario shown in the Data Model Design guide. Let's revisit our Smart Factory example scenario.
Name | Description |
Operations | User to keep the line running and make sure that it’s producing quality products |
Maintenance | User to keep machines up and running so that the operator can crank out products |
Management | User in charge of dispatching production orders and making sure the quotas are being met |
Conveyor Belts | Thing on factory line to pass items along to the next stage |
Pneumatic Gate | Thing on factory line |
Robotic Arm | Thing on factory line |
Quality Check Camera | Final Thing on factory line to ensure quality |
In order to add this to our solution, we will want to build a "connector" between ThingWorx and the existing system. These connectors will be Things as well.
Required Functionality
Description | |
1 | File Maintenance Request |
2 | Get quality data from assets on their line |
3 | Get performance data for the whole line |
4 | Get a prioritized list of production orders for their line |
5 | Create Maintenance Requests |
Required Information
Description | |
1 | Individual asset performance metrics |
2 | Full line performance metrics |
3 | Product quality readings |
Required Functionality
Description | |
1 | Get granular data values from all assets |
2 | Get a list of maintenance requests |
3 | Update maintenance requests |
4 | Set triggers for automatic maintenance request generation |
5 | Automatically create maintenance requests when triggers have been activated |
Required Information
Description | |
1 | Granular details for each asset: In order to better understand healthy asset behavior |
2 | Current alert status for each asset: to know if there is something going wrong with an asset |
3 | When the last maintenance was performed on an asset |
4 | When the next maintenance is scheduled for an asset |
5 | Maintenance request info: Creation date, due date, progress notes |
Required Functionality
Description | |
1 | Create production orders |
2 | Update production orders |
3 | Cancel Production orders |
4 | Access line productivity data |
5 | Elevate maintenance request priority |
Required Information
Description | |
1 | Production line productivity levels (OEE) |
2 | List of open Maintenance requests |
This matrix represents all of the overlapping Components that are shared by multiple types of Things in our system:
This matrix represents the unique Components to each type of Thing:
After prioritizing and grouping common functionality and information, we came up with the list below for the first Thing Template to create, LineAsset with five Properties, one Event, and one Subscription. The breakdown for the LineAsset Thing Template is as follows:
Follow the below instruction to create this Entity and get the implementation phase of your development cycle going.
Let's build out our Properties.
3. In the name field, enter LineAsset and set the Project (ie, PTCDefaultProject).
4. For the Base Thing Template field, select GenericThing.
5. Click Save.
6. Switch to the Properties and Alerts tab.
7. Click the plus button to add a new Property.
The Properties for the LineAsset Thing Template are as follows:
Name | Base Type | Aspects | Data Change Type |
State | String | Persistent and Logged | ALWAYS |
SerialNumber | String | Persistent, Read Only, and Logged | NEVER |
LastMaintenance | DATETIME | Persistent and Logged | VALUE |
NextMaintenance | DATETIME | Persistent and Logged | VALUE |
PowerConsumption | NUMBER, Min Value: 0 | Persistent and Logged | ALWAYS |
Follow the next steps for all the properties shown in our template property table.
Your properties should match the below configurations.
Your Event should match the below configurations.
Your Subscription should match the below configurations.
We have left the Subscription code empty. Think of a way to handle Error Events coming from your line asset and implement it in this section.
Click here to view Part 2 of this guide.