This tutorial demonstrates the basics of installing and using the FairCom Edge ThingWorx AlwaysOn Connector.
This tutorial assumes an existing ThingWorx platform is available. It will connect to ThingWorx using the ThingWorx AlwaysOn protocol (https://developer.thingworx.com/sdks).
FairCom Edge requires the creation and configuration of a FairCom Edge "thing" in ThingWorx. Refer to the ThingWorx website for more information about using ThingWorx.
You will need to install and start the FairCom Edge server, as described in Download and Installation in the FairCom Edge Developer's Guide.
The following PLUGIN keyword has been added to the FairCom Edge ctsrvr.cfg file, which is located in the /config folder:
PLUGIN ctthingworx;./thingworx/libctthingworx.so
The following directory has been added to the FairCom Edge Configuration File under the /server folder:
libctthingworx.so - plug-in dynamic library (Linux only)
ctThingWorx.dll - plug-in dynamic library (Windows only)
fccert.pem - self-signed certificate for SSL
ctreeEDGE_entities.xml - required platform entities for the plug-in
FairCom Edge also adds a new configuration file to the /config folder: ctthingworx.json. This file is used to configure the ThingWorx AlwaysOn plug-in.
The ThingWorx plug-in can map a FairCom Edge instance to multiple "things" on the ThingWorx platform making it possible for a business to create a digital twin for each of its customers and map a subset of data in FairCom Edge to each customer.
As shown in the following example, Mike’s car can be associated with two Things, the location where service is provided (Car Dealer) and with the Digital Twin of Mike’s car.
This release has a new powerful persistent data store. FairCom Edge’s Store & Forward solution is critical for ensuring data integrity across an application. In a complex IIoT scenario (think factory floor, smart city, etc.), being able to rely 100% on communication links is not realistic. When some level of outage occurs, being able to safely secure the message is a must. The Store & Forward concept provides the peace of mind that the information needed by the next component in the IIoT ecosystem will be available once the communication link is reestablished. Store & Forward maintains a record of the last message received. Once communication is reestablished, any messages that haven’t been delivered will automatically be sent. This brings an unsurpassed level of data integrity to the ThingWorx platform.
Store & Forward configuration is done in the ThingWorx GUI for each table.
FairCom Edge provides two ways for mapping FairCom Edge fields into ThingWorx:
Current Values
This is exactly the same as the existing functionality in V3 of the ctThingWorx plug-in. The new steps to configure this mode are shown below:
History Values (Store & Forward)
The steps to configure this mode are shown below:
The Store & Forward mechanism allows subscribing multiple times to the same instance. Although each table in a FairCom Edge instance has one Store & Forward instance, each ThingWorx thing mapped to the table is a new subscriber for the existing Store & Forward instance.
To support this representation, a class has been created to represent a "thing" subscribing to an existing Store & Forward instance (which is represented by class CTTWTableStoreAndForward): CTTWTableStoreAndForwardSubscription
The CTTWTableStoreAndForward class now has a list of subscribers (CTTWTableStoreAndForwardSubscription instances) under a hash table with the "thing name" as the key.
The Store & Forward parameters are defined on a Thing/Table level in the ThingWorx platform, so it has been moved from the CTTWTableStoreAndForward to CTTWTableStoreAndForwardSubscription. So, each subscriber can define its own rules for the Store & Forward.
When the FairCom Edge instance loses its connection to the ThingWorx platform (because of the network, device outage, or any other reason), the FairCom Edge server instance automatically reconnects. Note that, after 3 reconnection attempts with an interval of 5 seconds between each, these reconnection attempts will cease.