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

How can I update the thing template's properties or thing shape's properties by C SDK?

Level 1

How can I update the thing template's properties or thing shape's properties by C SDK?

       I  don't  understand  the  thingworx  thing template~~ As  the doc said , ThingWorx things are derived from thing templates.   So, I create a thing with a  template  build by myself . The template own both properties and thing shape with properties.  And , I try  to  update  the  template's  properties  via C SDK function :twApi_PushProperties(TW_THINGTEMPLATES, SDSTemplateName, proplist, -1, FALSE)  to push the properties from my application to the  thingworx platform.


but  there have some erro like blow  when  my program  running :

And  there have nothing post to the template properties :


Can  anyone  tell me the correct way to  update  my  template's properties!!


Tags (2)
4 REPLIES 4

Re: How can I update the thing template's properties or thing shape's properties by C SDK?

yi huang​, Thing Templates provide base functionality with properties, services, events, and subscriptions that Thing instances use in their execution.

When a Thing is created using a ThingTemplate it inherits all its properties, services, events, and subscriptions. So, its basically that Thing's properties, services, events, and subscriptions. So, we need to update the Thing's properties.

Highlighted

Re: How can I update the thing template's properties or thing shape's properties by C SDK?

Have you bind your Thingworx Properties to C EMS ?

Re: How  can I update  the  thing template's properties or  thing shape's  properties by C SDK?

     Hello, Ankit:

     So, you mean that  I can only update the properties define by ThingTemplate  via update the  Thing  created using a ThingTemplate?

In another way,  I  should  Register the properties with  ThingTeplate  entityType  and entityName  , But  update them using a  thing entityType and  entityName? Just like that  process:

1、Initialize the API.

2、register properties define by ThingTemplate . { twApi_RegisterProperty(TW_THINGTEMPLATES, SDSTemplateName, "SerialNumber", TW_STRING, NULL, "ALWAYS", 0, SDSpropertyHandler, NULL)}

3、bind the thing.  {twApi_BindThing(thingName);}

4、connected to server.   {twApi_Connect(CONNECT_TIMEOUT, CONNECT_RETRIES)}

5、start to update  my device properties to the thing in the platform.   {twApi_PushProperties(TW_THING, thingName, proplist, -1, FALSE);}

And I try  above method,there also meet the same  error  in  my first   question(I  forget  to post  picture):

Looking forward to your reply!

Re: How  can I update  the  thing template's properties or  thing shape's  properties by C SDK?

     Hello ,Mayank:

     thank you for reply!

     I am a  new  of  thingworx, so, I  don't know  what you  said  "EMS"?   I  using  C  SDK  in   my  device  and  connected  to the thingworx  platform.

I  know  I  should  bind  a  thing before  connected to server ,  and  I have  done. It  is   work   normally   when  I  build   a  thing using the  platform  own  ThingTemplate  like  RemoteThing  ThingTemplate.  But  there have some  error  when  I  create a  thing  using  ThingTemplate  build by myself.    So,  What is your suggestion?