cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Learn all about PTC Community Badges. Engage with PTC and see how many you can earn! X

How to save existing Industrial Thing programmatically through Service?

Rocky_2021
10-Marble

How to save existing Industrial Thing programmatically through Service?

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 1

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();
}

 

Announcements


Top Tags