Learn more about ThingWorx IoT platform and how to use it to build IoT solutions
In this guest post, Andrew Minteer, an expert data scientist and the author of Analytics for the Internet of Things, gives an overview of ThingWorx, the development environment for building IoT solutions.
The company PTC, which has a long history in creating software for the world of machines talking to machines, developed ThingWorx IoT platform. It is an application development environment for building IoT solutions, a software platform that abstracts IoT devices, and related components and services into model-based development objects. You install the software on your own hardware (or using the cloud provider’s virtual instances).
The ThingWorx IoT platform makes it easy to model your devices and data; it has the ability to quickly create dashboards through a web-based application. No code is required. ThingWorx is also extensible to third-party components through its marketplace. This makes it easy to add third-party functionalities without special configuration. It can also integrate with both AWS and Azure IoT hub services.
There are multiple components of ThingWorx IoT platform. ThingWorx Foundation is the center of the IoT platform. It is divided into three areas, as shown below:
- ThingWorx Core
- ThingWorx Connection Services
- ThingWorx Edge
ThingWorx IoT platform: Core
ThingWorx Core is a software platform environment that allows you to design, run, and implement analytics for IoT applications that control and report data from remote devices. These devices could be sensors, consumer electronics, or industrial equipment.
ThingWorx uses a representational object-based design. This means that you create software objects to represent your IoT devices and other assets. The representation includes relevant properties and related data items.
You then use the objects to create applications, which can monitor and manage your IoT devices. You can create dashboards, implement response logic, and integrate third-party applications.
The ThingWorx Core is the hub of your ThingWorx environment. You logically define behavior and relationships between IoT devices or remote assets that are set up in your environment. Once the actual devices have been modeled in the software, they can register and communicate with the Core. You can then collect data and manage the physical devices.
ThingWorx Core includes two main tools for you to create IoT solutions:
- ThingWorx Composer: This is a modeling environment where you set up the remote assets, business logic, data storage, and security.
- ThingWorx Mashup Builder: This is a drag-and-drop tool where you can quickly create dashboards and mobile interfaces without needing to write code. This is where you can do things like showing a location on a map and charting sensor value trends.
ThingWorx Connection Services
ThingWorx Connection Services handle communication and connectivity between the Core and remote assets. Components can handle connectivity over different protocols and with different device clouds. They handle message routing to and from the remote devices and also message translation when required.
Connection Services have connection adapters to link up devices that use AWS IoT SDK or Azure IoT SDK. They link into the cloud providers and allow you to translate the data into ThingWorx.
The Connector Services components have a core connection server and also an adapter. ThingWorx documentation refers to these two combined as a Connector. They are both packaged and installed together.
Each Connector supports a specific protocol where inbound messages are translated into ThingWorx format and sent on to the Core. The reverse occurs for outbound messages from the Core to the remote device.
More useful resources:
Top IoT platform to use for building IoT projects
What is IoT and how does it work?
IoT protocols guide
The third component of ThingWorx Foundation consists of a couple of software products that operate out in the edge of the IoT network. The first one operates as a small server and hub for communication back to the Core component at a centralized system. It is called ThingWorx Websocket-Based Edge MicroServer (WS EMS). The second is a Software Development Kit (SDK) that your developer would install on your IoT device as part of your device software. It is called ThingWorx Edge SDK.
WS EMS is a standalone application that is installed on a remote device. It uses a ThingWorx protocol called AlwaysOn to communicate with the ThingWorx Core. The WS EMS supports several operating systems and has a small footprint. It can work with a large number of devices to provide a way of establishing communication between an edge device and the ThingWorx Core.
Depending on what language your developers are using for your IoT device code, there are several versions of ThingWorx Edge SDKs that allow you to add connectivity to your device. There are SDKs that support C, .NET (C#), and Java languages, along with the ones for the Android and iOS platforms.
The SDK is embedded within the IoT device—one instance of it for each device. All the SDKs have common interfaces and provide secure communication channel to the Core.
ThingWorx IoT platform concepts
This section will discuss the main objects and concepts used on the ThingWorx core to model your environment.
A thing template sets up and defines the base functionality that you build multiple things from. This defines a general category with a common set of properties, services, events, and subscriptions. These will be included in any thing definition that is based upon the template. The thing will inherit from the thing template.
A thing is used to represent an object. It is based on a thing template but will often include additional properties, services, or events unique to the implementation of the more generic base thing defined in the template.
There are several types of a thing:
- Things: This represents a real-world asset, device, or system.
- Remote thing: A remote thing is a special type of thing that represents an asset in a remote location. When using a ThingWorx Edge SDK, the edge devices where your application is running needs to be created in ThingWorx Composer using the RemoteThing template.
- Custom things: Extensions provide custom thing templates that you can use to create custom things to represent your devices.
A property is a variable that represents the behavior of a thing.
Properties have either of the following:
- Remote bindings: Remote bindings support egress. They can be written to the edge device when it connects to ThingWorx. The edge device must know of every property with remote bindings.
- Non-remote bindings: These are not sent to the edge device when written and are not read from the edge device when a value is requested.
A service represents a function that a thing can perform. It can be defined as part of a thing, a thing template, or a thing shape.
An event is triggered from a change in the state or value of a property. It sends data to an object that subscribes to it.
A thing shape is an abstraction of concrete things. Typically, the thing shape is used by a thing template, which itself is used for thing definitions.
Data shapes define the structure of tables in ThingWorx, which represent informational data structures or the output of ThingWorx services. They are composed of field definitions.
Here are some types of data shapes:
- Data table structures: These are storage tables that have a primary key to support indexing
- Stream structures: These can access data continuously
- Value stream structures: Data stored from a property bound to a thing
- Event data: This stores data linked to events
The term, entities, is the general term in ThingWorx IoT platform for all kind of objects that you can create. They include things, thing templates, thing shapes, and data shapes. You can also import entities into ThingWorx.
If you enjoyed reading this article, you should explore Analytics for the Internet of Things, an end-to-end guide that will help you extract actionable intelligence from the flood of IoT data. The book follows a practical approach to combine the power of analytics and IoT to help you get effective results quickly.