Customizing Presentation > Customizing Controls Advisor > Customizing the Calculation of Remote Server Status
Customizing the Calculation of Remote Server Status
The status displayed for a server in Controls Advisor is determined by a combination of two factors:
Is the server connected?
If connected, is the data flow sufficiently quick?
The resulting status displays in the Status column on the main Controls Advisor page, and on the server details page:
Green icon showing the server is connected and the data flow is quick—The server is connected, and the data flow is quick.
Yellow icon showing the server is connected but data flow is slow or nonexistent—The server is connected, but the data flow is slow or nonexistent.
Red icon showing the server is not connected—The server is not connected.
Both factors of the server status calculation can be customized.
Customizing the Calculation of Remote Server Status for KEPServerEX Server Types
A server is considered to be a KEPServerEX server if it was:
Created in Controls Advisor with a selected Connection Type of KEPServerEX or Legacy and Non-Kepware OPC servers (aggregator server)
Discovered from a connected aggregator server
To customize the calculation of status for a KEPServerEX server:
1. In ThingWorx Composer, create a new resource provider Thing for KEPServerEX connections. This can be done by duplicating the existing resource provider Thing for KEPServerEX, PTC.Factory.KepServerResourceProvider.
a. Ensure that this Thing implements the PTC.Factory.KepServerResourceProviderThingTemplate Thing Template.
b. Under Services, click Override service icon to override the following services, and add your logic as custom Javascript:
CalculateServerStatus—Determines whether the server is connected.
CalculateIsConnectionHealthy—Determines whether the data flow is sufficiently quick.
Ensure that the customized services work as expected.
c. Click Save and Continue to save the customized service.
d. Click Save to save the Thing Template.
2. Open the PTC.Factory.C_LaunchPointConfigurationThing_[ReleaseVersion].
a. Under Configuration, find the RemoteConnectionSettings configuration table.
b. Edit the row for the KEPServerEX ConnectionType. In the ResourceProviderName column, enter the name of the resource provider Thing created in step 1.
c. Click Save.
* 
For servers discovered from a connected aggregator server that display a Connection Type of OPC Server in Controls Advisor, the data flow speed calculation can be customized by applying a remote binding to the Server Status property.
1. In Controls Advisor, select the OPC server, and click Edit server icon.
2. On the Edit Connection window, click Select tag icon, and select a remote tag.
3. Click OK.
Customizing the Calculation of Status for Other Server Types
To customize the calculation of status for other server types:
1. In ThingWorx Composer, create a resource provider Thing Template for the server type. For example, MyServerTypeResourceProviderThingTemplate.
a. For Base Thing Template, select GenericThing.
b. For Implemented Shapes, select PTC.SCA.SCO.RemoteConnectionResourceProviderThingShape.
c. Under Services, click Override service icon to override the following services, and add your logic as custom Javascript:
CalculateServerStatus—Determines whether the server is connected.
CalculateIsConnectionHealthy—Determines whether the data flow is sufficiently quick.
Ensure that the customized services work as expected.
d. Click Save and Continue to save the customized service.
e. Click Save to save the Thing Template.
2. Create a resource provider Thing for the server type. For example, MyServerTypeResourceProviderThing.
a. For Base Thing Template, select the resource provider Thing Template created in step 1.
b. Click Save.
3. Create a Thing Template for the server type. For example, MyServerTypeThingTemplate. This Thing Template will be used to create a Remote Thing for this server type.
a. For Base Thing Template, select RemoteThing.
b. For Implemented Shapes, select PTC.SCA.SCO.RemoteConnectionThingShape.
c. Click Save.
4. Open the PTC.Factory.C_LaunchPointConfigurationThing_[ReleaseVersion]. Under Configuration, add a new row for the server type to the RemoteConnectionSettings configuration table.
a. For ConnectionType, provide a name for the server type. For example, MyServerType.
b. For ResourceProviderName, enter the name of the resource provider Thing created in step 2. For example, MyServerTypeResourceProviderThing.
c. For RemoteConnectionThingTemplateName, enter the name of the server type Thing Template created in step 3. For example, MyServerTypeThingTemplate.
d. Click Save.
Was this helpful?