Skip to main content
1-Visitor
June 11, 2019
Solved

Countdown time in thingworx bind to widget

  • June 11, 2019
  • 4 replies
  • 2226 views

Hello,

 

i would like to create like a countdown timer in thingworx. that would count from 180 seconds to 0 basically and to have this binded in a mashup.

 

do you think something like this is possible? if so i would need some help.

 

i was thinking about creating a function that counts only once and appeal it in a for loop or something like this and save the current seconds in properties. 

Best answer by CarlesColl

Refresh Widget has a AutoRefresh bindable property, you just need to bind something to ti (checkbox or alike)

4 replies

1-Visitor
June 11, 2019

If you just need it on the Mashup Side (not server side) you can use a Refresh Widget and an Expression widget.

 

Expression widget with a parameter "value" of type NUMBER and the expression = ((value==undefined)||(value==null))?180:(value-1))

you need to bind the expression widget output to itself (value) and set to not automatically trigger.

 

Then the refresh widget just needs to trigger the expression widget.

 

To show up on the interface, just add a value display or another widget and bind the expression widget output to it.

gabitudor1-VisitorAuthor
1-Visitor
June 11, 2019

thank you! that worked and i also managed to do it in a service. but right now i would like to add a start/stop button so when i press on stop the time would stop from counting down and when i press start the time will continue to go to 0

 

any idea on this one? i am thinking on having a service that would be triggered by the button

1-Visitor
June 11, 2019

Refresh Widget has a AutoRefresh bindable property, you just need to bind something to ti (checkbox or alike)