Skip to main content

ThingWorx concepts

Section

Description

ThingWorx connector

The FairCom Edge ThingWorx connector connects FairCom Edge to the ThingWorx IoT platform, which allows developers to model complex applications and dashboards.

Support for multiple ThingWorx things

The ThingWorx connector can map a FairCom Edge table column to multiple things on the ThingWorx platform. This provides more flexibility in how FairCom Edge data is viewed and grouped in ThingWorx.

Automatic reconnection to ThingWorx

When the FairCom Edge server loses its connection to the ThingWorx platform, the FairCom Edge server automatically attempts to reconnect.

Figure 1. Connect Edge to ThingWorx
Connect Edge to ThingWorx


The FairCom Edge ThingWorx connector connects FairCom Edge to the ThingWorx IoT platform, which allows developers to model complex applications and dashboards. FairCom Edge provides full SQL and navigational access to your data persisted on the edge with very little change to your ThingWorx project.

As opposed to other ThingWorx persistence solutions (such as JDBC, ADO, SQL), which connect to databases in the cloud, FairCom Edge persists data on the edge/locally as well as in the cloud.

With FairCom Edge integration, it is easy to update a model in the ThingWorx platform with new data as it arrives in FairCom Edge. No matter how your data is persisted on the edge (such as through FairCom Navigational APIs, SQL APIs, MQTT, or OPC UA), this data is automatically updated in the platform with the desired frequency, from near real-time to a predefined frequency such as once per hour.

The ThingWorx connector is easy and intuitive. You can quickly add FairCom Edge to existing ThingWorx applications to locally persist data in the factory and automatically send it to ThingWorx.

This feature is designed for developers of ThingWorx applications. It requires minimum experience with ThingWorx Foundation and databases. The connector provides an easy way to map edge-persisted data to the properties of a thing.

FairCom Edge maps time series tables into ThingWorx. A time series table is one in which new data values are stored by inserting new records/rows into the table, rather than by editing existing rows in the table.

For example, imagine a device with several sensors. Every minute, those sensors are sampled and their values are stored in a FairCom Edge table as one new row, often with a timestamp. This allows the table to track the sensors' values over time. When a table column is mapped into ThingWorx, ThingWorx receives the data from the last row inserted into the table.

FairCom Edge collects data from MQTT and OPC UA at high speed from local devices. FairCom Edge's ThingWorx connector uploads these newly-inserted records directly into ThingWorx. Integrations with FairCom Edge can also update and delete records from Edge tables, but the ThingWorx connector only sends the latest inserts to ThingWorx.

ThingWorx update rate

Since FairCom Edge tables can accept new records so quickly, it is possible to insert records into FairCom Edge tables far faster than the new values can be accepted by ThingWorx. In order to prevent ThingWorx from falling behind, FairCom Edge provides an UpdateRateInSeconds control to let you control how this speed mismatch is handled.

When a new record is inserted into a FairCom Edge table:
  • UpdateRateInSeconds set to 0

    FairCom Edge sends as many updates to ThingWorx as possible, but skips records as necessary to keep ThingWorx from falling behind.

  • UdateRateInSeconds set to an integer > 0

    As a positive integer, UpdateRateInSeconds specifies how often FairCom Edge should update ThingWorx, letting you explicitly set the update rate in order to reduce network traffic.

    Example 1. UpdateRateInSeconds set to 5

    When records are inserted into the FairCom Edge table, a new value will be sent to ThingWorx at most once every five seconds.

    Note

    A provision is made that the ThingWorx value will not be more than five seconds (based on this example) out-of-date — for example, assume that the FairCom Edge table holds 7. Two new records are quickly inserted, with an 8 and then a 9. The 8 is immediately sent to ThingWorx. The 9 is not sent until five seconds elapse, and then the 9 is sent to ThingWorx.



If new records are inserted into the FairCom Edge table while ThingWorx is down or disconnected, only the last record will be sent to ThingWorx when the connection to ThingWorx is re-established. The goal is to give ThingWorx the most recent value as soon as the connection returns

FairCom Edge allows you to set the UpdateRateInSeconds on a per-column/per-property basis.

The ThingWorx connector can map a FairCom Edge table column to multiple things on the ThingWorx platform. This provides more flexibility in how FairCom Edge data is viewed and grouped in ThingWorx.

You can create multiple digital twins that represent, differently, whatever physical objects are producing sensor data. Typically you will have several different types of edge devices, whose data is being concentrated in edge gateways. However, these devices are not necessarily going to be uniquely represented in a single, logical, digital twin, but rather in several twins. The mapping between the digital representation of your physical world can be more complex than simple, single objects.

Example 2. Mapping FairCom Edge data into two ThingWorx things

List each ThingWorx thing ("myThing1" and "myThing2") you wish to map to in the "thingworxThings" array in the config/ctthingworx.json file.

"thingworxThings": [
  {
    "thingName": "myThing1",
    "thingCreator": "FairComThing"
  },
  {
    "thingName": "myThing2",
    "thingCreator": "FairComThing"
  }
]


For additional details about the config/ctthingworx.json file, see the FairCom Edge setup section.

When the FairCom Edge server loses its connection to the ThingWorx platform, due to network issues, server-side issues, or for any other reason, FairCom Edge automatically attempts to reconnect.

Reconnection attempts will continue until
  • FairCom Edge is able to reconnect.

  • The FairCom Edge server is shut down.