9 Replies Latest reply on Jan 16, 2018 4:29 PM by nagrawal-2 RSS
    nagrawal-2 Explorer

    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

      • Re: Bind tags of IndustrialGateway Thing to predefined properties of ThingTemplate
        pchung Collaborator

        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'

        • Re: Bind tags of IndustrialGateway Thing to predefined properties of ThingTemplate
          tsaifee-2 Explorer

          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?

            • Re: Bind tags of IndustrialGateway Thing to predefined properties of ThingTemplate
              nagrawal-2 Explorer

              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

              • Re: Bind tags of IndustrialGateway Thing to predefined properties of ThingTemplate
                pchung Collaborator

                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.