<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Adding VirtualThing after threadpool is started in ThingWorx Developers</title>
    <link>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Adding-VirtualThing-after-threadpool-is-started/m-p/847934#M60730</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am creating an application with the .net sdk that will run virtual things in a process. But I would also like to connect some virtual thing at any moment in the process.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Example: I start my application with thing1 and thing2. Then a few hours later I want to add thing3.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How would I be able to do so? Is it possible?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;François Lévesque&lt;/P&gt;</description>
    <pubDate>Fri, 06 Jan 2023 18:12:48 GMT</pubDate>
    <dc:creator>FL_10545404</dc:creator>
    <dc:date>2023-01-06T18:12:48Z</dc:date>
    <item>
      <title>Adding VirtualThing after threadpool is started</title>
      <link>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Adding-VirtualThing-after-threadpool-is-started/m-p/847934#M60730</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am creating an application with the .net sdk that will run virtual things in a process. But I would also like to connect some virtual thing at any moment in the process.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Example: I start my application with thing1 and thing2. Then a few hours later I want to add thing3.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How would I be able to do so? Is it possible?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;François Lévesque&lt;/P&gt;</description>
      <pubDate>Fri, 06 Jan 2023 18:12:48 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Adding-VirtualThing-after-threadpool-is-started/m-p/847934#M60730</guid>
      <dc:creator>FL_10545404</dc:creator>
      <dc:date>2023-01-06T18:12:48Z</dc:date>
    </item>
    <item>
      <title>Re: Adding VirtualThing after threadpool is started</title>
      <link>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Adding-VirtualThing-after-threadpool-is-started/m-p/848231#M60754</link>
      <description>&lt;P&gt;You have a full set of services available that you could invoke after connection. So it is certainly possible to do things like auto create based on a trigger, or 'self-registration' there have been several threads on this, quite a long time ago, hopefully you can find it using a search.&lt;/P&gt;</description>
      <pubDate>Mon, 09 Jan 2023 15:05:40 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Adding-VirtualThing-after-threadpool-is-started/m-p/848231#M60754</guid>
      <dc:creator>PaiChung</dc:creator>
      <dc:date>2023-01-09T15:05:40Z</dc:date>
    </item>
    <item>
      <title>Re: Adding VirtualThing after threadpool is started</title>
      <link>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Adding-VirtualThing-after-threadpool-is-started/m-p/848307#M60763</link>
      <description>&lt;P&gt;I've been searching all day for a post that would give me what I am looking for and I found nothing. Would it be possible to point me in the right direction please. Since I am new to the sdk and ThingWorx.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;</description>
      <pubDate>Mon, 09 Jan 2023 21:07:03 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Adding-VirtualThing-after-threadpool-is-started/m-p/848307#M60763</guid>
      <dc:creator>FL_10545404</dc:creator>
      <dc:date>2023-01-09T21:07:03Z</dc:date>
    </item>
    <item>
      <title>Re: Adding VirtualThing after threadpool is started</title>
      <link>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Adding-VirtualThing-after-threadpool-is-started/m-p/848760#M60785</link>
      <description>&lt;P&gt;Hope these articles, have some content that can help you along.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.ptc.com/t5/ThingWorx-Developers/sample-code-for-automatic-VirtualThing-discovery-and-binding/m-p/522152" target="_blank"&gt;https://community.ptc.com/t5/ThingWorx-Developers/sample-code-for-automatic-VirtualThing-discovery-and-binding/m-p/522152&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.ptc.com/t5/ThingWorx-Developers/How-to-create-Things-Properties-via-Rest-API/m-p/504978" target="_blank"&gt;https://community.ptc.com/t5/ThingWorx-Developers/How-to-create-Things-Properties-via-Rest-API/m-p/504978&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.ptc.com/t5/ThingWorx-Developers/Create-missing-Things-via-404-s/m-p/771301" target="_blank"&gt;https://community.ptc.com/t5/ThingWorx-Developers/Create-missing-Things-via-404-s/m-p/771301&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.ptc.com/t5/ThingWorx-Developers/HowTo-create-a-RemoteThing-and-simulate-a-device/m-p/512874" target="_blank"&gt;https://community.ptc.com/t5/ThingWorx-Developers/HowTo-create-a-RemoteThing-and-simulate-a-device/m-p/512874&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.ptc.com/t5/ThingWorx-Developers/how-to-check-if-a-remotething-is-bound/m-p/529896" target="_blank"&gt;https://community.ptc.com/t5/ThingWorx-Developers/how-to-check-if-a-remotething-is-bound/m-p/529896&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jan 2023 13:14:27 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Adding-VirtualThing-after-threadpool-is-started/m-p/848760#M60785</guid>
      <dc:creator>PaiChung</dc:creator>
      <dc:date>2023-01-11T13:14:27Z</dc:date>
    </item>
    <item>
      <title>Re: Adding VirtualThing after threadpool is started</title>
      <link>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Adding-VirtualThing-after-threadpool-is-started/m-p/848783#M60787</link>
      <description>&lt;P&gt;So I've read the content and I think I did not explain my self clearly. I will try to do so.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I do not need to create things with the sdk.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to bindThings after I started a process with some Things in it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I've tried to do so is create a Thing that will manage the insertion of other Things.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But when I bind things they do not connect in ThingWorx web platform.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can I bind things after I have started my process and what do I need to do?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Frank&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jan 2023 14:50:04 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Adding-VirtualThing-after-threadpool-is-started/m-p/848783#M60787</guid>
      <dc:creator>FL_10545404</dc:creator>
      <dc:date>2023-01-11T14:50:04Z</dc:date>
    </item>
    <item>
      <title>Re: Adding VirtualThing after threadpool is started</title>
      <link>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Adding-VirtualThing-after-threadpool-is-started/m-p/848785#M60788</link>
      <description>&lt;P&gt;When you say bind, you are using devices and RemoteThings?&lt;/P&gt;
&lt;P&gt;I think your explanation lacks a lot of context unfortunately.&lt;/P&gt;
&lt;P&gt;But I would say that if something needs to be bound, as something is in progress, and that process needs the bound items,&lt;/P&gt;
&lt;P&gt;you will likely run into a lot of latency/timing issues.&lt;/P&gt;
&lt;P&gt;You probably want to carefully outline each step that is being taken and then create some sort of asynchronous approach that allows it to work.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jan 2023 15:02:27 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Adding-VirtualThing-after-threadpool-is-started/m-p/848785#M60788</guid>
      <dc:creator>PaiChung</dc:creator>
      <dc:date>2023-01-11T15:02:27Z</dc:date>
    </item>
    <item>
      <title>Re: Adding VirtualThing after threadpool is started</title>
      <link>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Adding-VirtualThing-after-threadpool-is-started/m-p/849014#M60805</link>
      <description>&lt;P&gt;I think the question is related to the creation of a new instance - in context of the SteamSensor Example - of a new &lt;SPAN&gt;SteamThing&amp;nbsp;&lt;/SPAN&gt;in the already running application.&lt;/P&gt;&lt;P&gt;&lt;A href="https://support.ptc.com/help/thingworx/edge_sdk_dotnet/en/#page/dotnet_sdk/c_dotnet_sdk_reference_virtualthing_class.html#wwID0E3BIM" target="_blank"&gt;https://support.ptc.com/help/thingworx/edge_sdk_dotnet/en/#page/dotnet_sdk/c_dotnet_sdk_reference_virtualthing_class.html#wwID0E3BIM&lt;/A&gt;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;SteamSensorClient client = createClient(host, appKey);

/* (done in createClient call)
	// Create two Virtual Things 
	SteamThing sensor1 = new SteamThing("SteamSensor1", "1st Floor Steam Sensor", null, client);
	SteamThing sensor2 = new SteamThing("SteamSensor2", "2nd Floor Steam Sensor", "SN0002", client);

	// Bind the Virtual Things
	client.bindThing(sensor1);
	client.bindThing(sensor2);
*/

// Wait for the SteamSensorClient to connect, then process its associated things.
// As long as the client has not been shutdown, continue
while (!client.isShutdown())
{
	// Only process the Virtual Things if the client is connected
	if (client.isConnected())
	{
		ThreadPool.QueueUserWorkItem(client.runClient);
	}
	
	// Question: Can we here also create new SteamThings and bind it to the client?
	
	// Suspend processing at the scan rate interval
	Thread.Sleep(scanRate);
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I did not yet do it like this. I cannot answer this question.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Jan 2023 12:10:51 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Adding-VirtualThing-after-threadpool-is-started/m-p/849014#M60805</guid>
      <dc:creator>nmutter</dc:creator>
      <dc:date>2023-01-12T12:10:51Z</dc:date>
    </item>
    <item>
      <title>Re: Adding VirtualThing after threadpool is started</title>
      <link>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Adding-VirtualThing-after-threadpool-is-started/m-p/849086#M60810</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks for this answer it was actually what we were about to try.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The real reason it was not working was because I was assigning Identifiers to my things and those remotethings did not have an identifier.&lt;/P&gt;</description>
      <pubDate>Thu, 12 Jan 2023 19:05:39 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Adding-VirtualThing-after-threadpool-is-started/m-p/849086#M60810</guid>
      <dc:creator>FL_10545404</dc:creator>
      <dc:date>2023-01-12T19:05:39Z</dc:date>
    </item>
  </channel>
</rss>

