This project introduces how to model industrial equipment in ThingWorx Foundation. NOTE: This guide’s content aligns with ThingWorx 9.3. The estimated time to complete this guide is 30 minutes.
Step 1: Learning Path Overview
This guide explains the steps to get started modeling industrial equipment in ThingWorx Foundation and is part of the Connect and Monitor Industrial Plant Equipment Learning Path. You can use this guide independent from the full Learning Path. Other guides are available for more complete Data Model Introduction. When using this guide as part of the Industrial Plant Learning Path, you should already have ThingWorx Kepware Server installed and sending data to ThingWorx Foundation. In the next guide in the Learning Path, we'll use Foundation's Mashup Builder to construct a GUI that displays information and from ThingWorx Kepware Server.
We hope you enjoy this Learning Path.
Step 2: Create Thing Shape
Thing Shapes are components that contain Properties and Services. In Java programming terms, they are similar to an interface.
In this section, you will build Thing Shapes for an electric motor.
Start on the Browse folder icon tab of ThingWorx Composer.
Under the Modeling section of the left-hand navigation panel, hover over Thing Shapes, then click the + button.
Type MotorShape in the Name field.
If Project is not already set, click the + in the Project text box and select the PTCDefaultProject.
Click the Properties and Alerts tab at the top of your Thing Shape.
Click + Add.
Enter the Property name from the first row of the table below into the Name field of the Thing Shape.
4. Select the appropriate Base Type from the drop-down menu.
5. Check Persistent and/or Logged according to the table.
NOTE: When Persistent is selected, the Property value will be retained when a Thing is saved. Properties that are not persisted will be reset to the default after every Save of the parent Thing. When Logged is selected, every Property value change will be automatically logged to a specified Value Stream.
6. Click ✓+ button.
TIP: When adding multiple Properties at once, click Done and Add after each, once you've entered a Name, selected a Base Type and any other criteria. If adding a single Property, click Done.
7. Repeat steps 2 through 5 for the other Properties in the the table.
8. Click the done ✓ Button. You'll see that these Properties have been created for the Motor Thing Shape.
9. Click Save.
Step 3: Create Thing Template
You can create reusable building blocks called Thing Templates in ThingWorx to maintain scalability and flexibility of your application development. With Thing Templates, you define a set of similar objects by specifying the Properties (characteristics) and Services (behaviors) that are common for all the objects. In Java programming terms, a Thing Template is like an abstract class and can be created by extending other Thing Templates. Once a Thing Template is defined and saved in ThingWorx Foundation Server, you can replicate multiple Things to model a complete set without duplicating effort. In this step, you will create a Thing Template that defines Properties for a pump. This pump Template could be used to create multiple Things that each represent a specific pump used in an industrial facility.
Start on the Browse folder icon tab on the far left of ThingWorx Composer.
Under the Modeling section of the left-hand navigation panel, hover over Thing Templates and click the + button.
Type PumpTemplate in the Name field.
NOTE: Thing Template names are case-sensitive.
4. If Project is not already set, click the + in the Project text box and select the PTCDefaultProject.
5. In the Base Thing Template box, click + to choose GenericThing as the Template.
6. In the Implemented Shapes field, click the + to select the MotorShape Thing Shape.
7. Click Save.
In this step, you will specify the Properties that represent the characteristics of a Pump. Some Properties like the location may never change (static), while other Properties like power and temperature information may change every few seconds (dynamic).
Select the Properties and Alerts tab under Thing Template: PumpTemplate.
Click the Edit button if the Template is not already open for editing, then click + Add next to My Properties.
Enter the Property name in the Name field copied from a row of the table below.
4. Select the Base Type of the Property from the drop down menu.
5. Check the appropriate Persistent and Logged check box.
NOTE: When Persistent is selected, the Property value will be retained when the parent Thing is saved. Properties that are not persisted will be reset to the default during a system restart and whenever the Thing is saved. When Logged is selected, every Property value change will be automatically logged to a specified Value Stream.
6. Click the ✓+ button.
TIP: When adding multiple Properties at once, click Check+ after each, once you've entered a Name, selected a Base Type and any other criteria. If adding a single Property, click Check button.
7. Repeat steps 3 through 6 for each of the Properties in the rows of the table.
8. After entering the final Property, click the ✓ button.
9. Click Save.
You should see the following Properties in your Composer.
In the next guide of this Learning Path, we will create a single Thing based on this Template to represent a specific Pump.
Step 4: Next Steps
Congratulations! You've successfully completed the Create Industrial Equipment Model tutorial, and learned how to:
Use Composer to create Thing Shapes and Thing Templates