Capula's OSISoft Pi to PTC Thingworx Connector

Changing the Thingworx server details

If the location or the server name changes for your PTC Thingworx server, you can modify the configuration file to ensure the Connector is using the correct details. For instructions about how to modify the configuration file refer to https://capulaopus.atlassian.net/wiki/spaces/OPTPTC/pages/1051984068 .

To do this you will need to modify the OSIConnector.config file:

  1. Open the file ‘OSIConnector.config’ in a text editor using administrator permissions.

  2. The file is in JSON format. Locate the section ConnectionSettings and scroll to the bottom to locate the user configurable area just above the ServerCertFileSettings section and modify the required settings.

  3. Save the changes to the configuration file

"rows": [ { "Address": "localhost", "Port": 9091, "Resource": "/Thingworx/WS", "IsSecure": true, "ThingName": "OSIPIThing", "AppKey": "7dxxaad2-bd6f-431f-83xx-xxxxa8783549", "AllowSelfSignedCertificates": false, "DisableCertValidation": false, "ConnectTimeout": 10000, "ConnectRetries": -1, "ReconnectInterval": 60, "MaxMessageSize": 64000, "MessageTimeout": 10000, "OfflineMsgQueueSize": 16384, "OfflineMsgStoreDir": "/opt/thingworx", "MaxMessages": 500, "IdlePingRate": 45, "MessageChunkSize": 8192, "MessageFrameSize": 8192, "AutoReconnect": true, "ForceConnectOnReadProperty": false, "ForceConnectOnWriteProperty": false, "ForceConnectOnInvokeService": false, "PongTimeout": 10000, "StaleMsgCleanupRate": 50000, "StreamBlockSize": 256, "MaxConnectDelay": 10000, "SocketReadTimeout": 10, "ThrowOnOfflineMesssageSave": false, "ClientName": "OSIPIGateway", "MessageStoreConfiguration": "ALL", "DisableEncryption": true } ]

Updating the Thingworx server details

To modify the Thingworx server details, it is a case of modifying the following lines in the ConnectionSettings section:

  • Address

  • Port

  • AppKey

  • DisableEncryption

Where these are:

  • Address: IP or DNS name of the ThingWorx server - i.e, 127.0.0.1 or localhost

  • Port: Thingworx server port - i.e, 80 or 443

  • AppKey: Application key (KeyID) used for security when connecting to ThingWorx. This is the authentication token. Refer to the API Key section for instructions

  • DisableEncryption: By default SSL encryption on the PTC Thingworx server is assumed. If you are not using SSL, click Disable Encryption and make sure the port is using a corresponding unencrypted port. - i.e, Port 80 instead of port 443

After you have saved the changes, the Connector service will need to be restarted for the changes to take effect, refer to https://capulaopus.atlassian.net/wiki/spaces/OPTPTC/pages/1049624880 .

Full list of settings that can be changed

Name

Description

Default Value

Name

Description

Default Value

Address

Address IP or DNS name of the ThingWorx server. Supports String values.

 

127.0.0.1

 

Port

ThingWorx server port.

Supports Integer values.

 

443

IsSecure

Only secure HTTPS connections are supported.

This setting must be set to true. Supports Boolean values

(0 or 1).

 

true (1)

 

ThingName

The name of the Thing in

ThingWorx that will be used.

Supports String values.

 

OSIPIThing

AppKey

Application key (KeyID) used for security when connecting to ThingWorx. This is the authentication token. Supports

String values.

 

xxxxxxxx-xxxxxxxx-

xxxxxxxxxxxxxxxx

 

AllowSelfSigned-

Certificates

 

Set to true to accept self-signed certificates. Supports

Boolean values.

 

false (0)

 

DisableCertValidation

 

Supports Boolean values. If

true, the TLS library will not validate the server certificate.

 

false (0)

 

ConnectTimeout

Time to wait for the WebSocket connection to be established.

Measured in milliseconds.

 

10000

 

ConnectRetries

Number of retries used to 3 establish a web socket connection. An error is reported after the retries are exhausted.

 

3

ReconnectInterval

Connection retry interval. Supports integer values. Measured in seconds.

 

60

 

MaxMessageSize

The maximum size of a complete message whether it is broken up as a multipart message or not. Messages larger than this will be rejected. Measured in bytes.

 

64000

 

MessageTimeout

Time to wait for a response to a message from the server. Measured in milliseconds. Supports integer values.

 

10000

 

OfflineMsgQueue

Size Offline message queue max size (number of bytes). Supports integer values.

 

16384

 

OfflineMsgStoreDir

Offline message storage file.

Supports string values.

 

/opt/ThingWorx

MaxMessages

Maximum number of unhandled messages in the message queue. Supports integer values.

500

 

DisableEncryption

If you are using SSL, set to false, otherwise set to true.

false

 

isWritePermissionsDisabled

To disable permission to write data to AF server set to true.

false

Capula © 2020