Skip to main content
10-Marble
April 9, 2024
Question

How to save existing Industrial Thing programmatically through Service?

  • April 9, 2024
  • 1 reply
  • 872 views

In my application, I have 100+ Industrial Things remotely binding properties from Kepware.
Every time when I restart Thingworx service, I found all the tags/properties have "Unknown" quality for all 100+ Industrial things in Thingworx.

I need to manually navigate to each thing and need to save the Thing. when I save the Thing, property/tag quality becomes "Good" in that particular Thing in Thingworx.

I want to find a way to do this stuff of Saving the Things through a service, so that one executing a single service will save all the Industrial Things and all the tags/properties will have "Good" quality.

Please suggest any solution or workaround for this.


1 reply

17-Peridot
April 9, 2024

try RestarThing() service.

var remoteThings = Things["YOUR_KEPWAREGATEWAY_TH"].GetIndustrialThings({
	maxItems: 1000 /* NUMBER {"defaultValue":500} */
});
var remoteThingsCount = remoteThings.length;
var r = 0;
for( ; r < remoteThingsCount; r++){
 Things[remoteThings.rows[r].item].RestartThing();
}