Community Tip - Visit the PTCooler (the community lounge) to get to know your fellow community members and check out some of Dale's Friday Humor posts! X
Configuration
Services
How can we use scheduler for Industrial Things and their properties?
Do i need to create Service in Scheduler thing and after that assign to Industrial thing? or any other way.
Please suggest me i am bit confused while using this scheduler.
I follow all the steps and I create one scheduler but please suggest how do I apply scheduler ,how to set up scheduler and how to display??
How to set up scheduler: This is what is explained above
How to display: There is no other view than what you have in the Composer when you edit the scheduler thing. Not sure what you want to display.
How do I apply scheduler: Create a subscription to the scheduler's "ScheduledEvent". The code in the subscription is executed everytime the scheduler fires the event.
Thanks for your reply , I want to show before program starting status as "Start in hh:mm:ss" and if program is start then I want to show status is "ON" and if that program is finish it will show program status is "OFF" for daily basis for these refer below attachment and please suggest
how do I used scheduler or Timer with above condition and how to write subscription code ??
To my knowing you can't query a timer or scheduler when it is running next.
You can subscribe to a timer or scheduler like to any other thing, using the subscriber's thing subscription tab. Subscriptions are a central feature of Thingworx, so if you are not familiar with them I suggest you go through your training material to understand the capabilities.
For your use case, I suggest to have two properties "nextStartTime" and "minutesToStart" on your program thing. nextStartTime being a datetime field with, well, the time when the program should start. minutesToStart is for the numbers of minutes left before the program starts next time.
Then you subscribe to a timer running once every minute. In that subscription, you compute the minutesToStart (basically the time between now and nextStartTime). If minutesToStart<=0 you run your program service and compute the nextStartTime and minutesToStart.
In your mashup, you simply display minutesToStart.