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 the Community Ranking System, a fun gamification element of the PTC Community. X

Bind tags of IndustrialGateway Thing to predefined properties of ThingTemplate

nagrawal-2
1-Visitor

Bind tags of IndustrialGateway Thing to predefined properties of ThingTemplate

Hi,

I am trying to utilise the Inheritance model of Thingworx and implement it with data coming from Industrial Connectivity.

I have created a ThingTemplate [Battery_Template] with RemoteThing as Base ThingTemplate with properties of my BatteryStorage Entity such as Battery Status, Battery Voltage and Battery Temperature. I also set the binding of all those properties to Remotely, but obviously, I can't choose the Tag at this stage because I haven't defined IndustrialThingShape. I need to create IndustrialGateway thing separately and attach it to my Thing only.

Then I have created a Thing [Ind_Battery] from above ThingTemplate and with IndustrailThingShape as Implemented Thingshape. I have also created a Thing [Ind_Gateway] with IndustrialGateway thingtemplate and connected it with my Industrial Connectivity software. I can see my tags in Ind_Gateway, but whenever I am trying to bind them to the properties in Ind_Battery it didn't allow me. I am not sure how would I achieve it.

I can create a new remote thing and industrial gateway thing for each client but in my case, for Battery Entity all my Clients are going to have the same set of properties so I don't want to repeat same steps.

Regards,

Neetu

ACCEPTED SOLUTION

Accepted Solutions
tsaifee-2
14-Alexandrite
(To:nagrawal-2)

Hello Neetu,

I think the problem is that you are looking for remote properties to bind but actually what you need is local properties.

Using your naming conventions, all Things created from the template [Battery_Template] are actually getting values from inside the Thingworx platform, not from a remote device. The remote value binding has already been taken care of by Thing [Ind_Gateway]. So I think that [Battery_Template] can use GenericThing as the base template (although RemoteThing would also work, as it inherits from GenericThing). [Ind_Battery] can be created as before from [Battery_Template]. Now you can perform a local binding > In New Composer, select Manage Bindings, Local … Search Things … Ind_Gateway … drag and drop the source property to the target property.

Also please note that there are services available if you want to manage property bindings (local or remote) programmatically:

SetRemotePropertyBinding

RemoveRemotePropertyBinding

SetLocalPropertyBinding

RemoveLocalPropertyBinding

These are services defined in template GenericThing so are available on all Things.

There is some discussion of these services around the Community site, for example on these posts:

https://community.thingworx.com/message/5968#5968

https://community.thingworx.com/message/54680#54680

Regarding the Binding=Remote setting on each property, I don’t think you need to use those settings in this scenario, so you can just leave Binding=None.

Does that resolve the problem you were having?

View solution in original post

9 REPLIES 9
PaiChung
22-Sapphire I
(To:nagrawal-2)

If you have a Remote style ThingTemplate that allows binding to the Agent/System then you can predefine them manually or through browse in the ThingTemplate

If that is not an option, you can bring all the tags in with one Remote Style Thing and then use local bindings, this won't be as repeatable unfortunately because the tags would all come in with unique names.

Better to Create Remote Things that represent 'devices' and each of those devices have the same 'tags'

Hi Pai,

Thanks for your response.

I don't get your first option? Can you please elaborate ?

But I did thought about the second one earlier but doing such way wouldn't make much difference.

Regards,

Neetu

PaiChung
22-Sapphire I
(To:nagrawal-2)

A Remote ThingTemplate in the properties section has the Manage bindings option which allows you to browse to a connected RemoteThing and grab the 'tags' Properties exposed either through drag/drop or add/create

Else you can just manually type in the name of the tag/property for it when you go into the edit of the binding info.

has to be a RemoteThingTemplate type.

I guess you don't get my question.

I know that's how you can connect Thing [RemoteThingTemplate] to Thing [IndustrialGateway]. What I am trying to achieve is I defined few properties in my ThingTemplate, then I have created Thing from that ThingTemplate as base and then I am trying to bind the properties of my thingtemplate but it doesn't allow to make such binding at Thing level. I can only set value of those inherited properties.

PaiChung
22-Sapphire I
(To:nagrawal-2)

I haven't looked deeply into the template setup.

But I think ... if you define the Thing as the Device then if you've pre-named or bound the Properties, if they match with the tags of that Device it should just work.

So let's say your industrial gateway has devices 1, 2, 3 and properties Speed and Temperature for each

I would setup a Template with Speed - bound to Speed (either drag drop or manually typed in) and Temperature

then I'd create Things 1, 2, 3 and everything should work, because I believe the Devices are exposed to match by ThingName

tsaifee-2
14-Alexandrite
(To:nagrawal-2)

Hello Neetu,

I think the problem is that you are looking for remote properties to bind but actually what you need is local properties.

Using your naming conventions, all Things created from the template [Battery_Template] are actually getting values from inside the Thingworx platform, not from a remote device. The remote value binding has already been taken care of by Thing [Ind_Gateway]. So I think that [Battery_Template] can use GenericThing as the base template (although RemoteThing would also work, as it inherits from GenericThing). [Ind_Battery] can be created as before from [Battery_Template]. Now you can perform a local binding > In New Composer, select Manage Bindings, Local … Search Things … Ind_Gateway … drag and drop the source property to the target property.

Also please note that there are services available if you want to manage property bindings (local or remote) programmatically:

SetRemotePropertyBinding

RemoveRemotePropertyBinding

SetLocalPropertyBinding

RemoveLocalPropertyBinding

These are services defined in template GenericThing so are available on all Things.

There is some discussion of these services around the Community site, for example on these posts:

https://community.thingworx.com/message/5968#5968

https://community.thingworx.com/message/54680#54680

Regarding the Binding=Remote setting on each property, I don’t think you need to use those settings in this scenario, so you can just leave Binding=None.

Does that resolve the problem you were having?

Thanks Tanveer,

It did resolve my problem. I wasn't using the "ManageBinding" option in my Ind_Battery thing. I was trying to edit the properties (Those inherited from ThingTemplate) and was trying to bind it from there, which didn't allow me to do that way. So what my setup now is :


  • Battery_Template with RemoteThing as Base ThingTemplate with properties of my BatteryStorage Entity such as Battery Status, Battery Voltage, and Battery Temperature. All the properties those need to be bound with Remote Tags should have Binding set to "Remote".
  • A Thing [Ind_Gateway] with IndustrialGateway thingtemplate and connected it with my Industrial Connectivity software
  • A Thing [Ind_Battery] from above ThingTemplate and with IndustrialThingShape as Implemented Thingshape.
  • Then in Ind_Battery I have set the value of IndustrialThing under ThingShape properties to my industrial gateway thing which is in my case Ind_Gateway.
  • Click on Manage Bindings and drag n drop Tags from the Remote section on to their respective properties.

Regards,

Neetu

PaiChung
22-Sapphire I
(To:tsaifee-2)

Although the Thingworx manufacturing app is set up this way. If you want to be able to do a slightly simpler approach and not program all the set binding stuff. You could do it they way I proposed it which is predefined bindings on the Template and having Remote Things that represent devices and are bound back tot he Kepserver vs. grabbing a local binding from the Main Thing within the platform.

In that way, I need to create extra Things, I want to limit my number of things.  The Method I have used above will allow me to have only two Things and one ThingTemplate.

Announcements


Top Tags