How to save existing Industrial Thing programmatically through Service?
Apr 09, 2024
12:11 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Apr 09, 2024
12:11 PM
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.
Labels:
- Labels:
-
Coding
-
Connectivity
-
Troubleshooting
1 REPLY 1
Apr 09, 2024
12:53 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Apr 09, 2024
12:53 PM
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();
}
