Skip to main content
1-Visitor
Apr 4, 2018 10:11 AM UTC
Solved

Using an event to trigger a service

I am looking to transfer property values from one thing to another thing at a defined time interval, say every 10 seconds using a service. Is there a way I can use an event to trigger this service every 10 seconds.

PaiChungAnswer
22-Sapphire I
Apr 4, 2018 11:47 AM UTC

What is the use case?

For example, if it is one - one then I would use local bindings and it automatically does it any time the value changes.

You can also use the DataChange event, that means that each time the value changes the event fires, and then you can use a Subscription to write over the value.

Finally what you are asking for can be done with a Timer, you set up a timer for your interval and then you create a subscription to the timer event and add the code to transfer the value.

1 reply

PaiChung22-Sapphire IAnswer
22-Sapphire I
Apr 4, 2018 11:47 AM UTC

What is the use case?

For example, if it is one - one then I would use local bindings and it automatically does it any time the value changes.

You can also use the DataChange event, that means that each time the value changes the event fires, and then you can use a Subscription to write over the value.

Finally what you are asking for can be done with a Timer, you set up a timer for your interval and then you create a subscription to the timer event and add the code to transfer the value.

Translate