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

how to show time by using timers and schedulers?

Ru
14-Alexandrite
14-Alexandrite

how to show time by using timers and schedulers?

hii,

i want to show the time by using timers and schedulers. For eg.

1) i have one program which starts from 10am to 11am. So, if there are 1hr or half an hour or 15 min remaining to        start the program how i show it by using timers and schedulers? 

2) when the program is started i want to show or display "ON".

3) When the program is end i want to show or display "OFF".

please suggest the procedure or solution for the same.

please refer the below screenshot for an example

122_0-1609133902791.png

 

 

3 REPLIES 3
odukiya
16-Pearl
(To:Ru)

Hello @Ru 

 

Please refer following community post to resolve your query and get more info for timers and schedulers:

https://community.ptc.com/t5/IoT-Tech-Tips/Timers-and-Schedulers-Best-Practices/td-p/537812

 

Let me know if you still face any challenges.

 

Thanks

Om Dukiya

Ru
14-Alexandrite
14-Alexandrite
(To:odukiya)

hi @odukiya ,

i want the output like "1hr:30min:15sec" remaining to start the program. but when i am displaying the getproperty of thing "SchedularThing" is shows true i don't want output like this. so please suggest the another eg. which is helpful for my query.

Ashritha
15-Moonstone
(To:Ru)

Above requirement  does not require schedulers/timers since it involved only the mashup related data update

  1. Create Property in thing or use data table to get the start and end time of the Program. Create a service to find the difference of current time and start time and show the minutes count in the mashup. Trigger this service in mashup using refresh widget according to your requirement. Ex : If the time needs to decrement minutes, then set refresh time as 60 seconds
  2. Write a service to handle following conditions
    1. if the current time is  within start and end time , result : ON
    2. if current time is greater than or equal to end time ; result : OFF
Announcements


Top Tags