cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Did you get called away in the middle of writing a post? Don't worry you can find your unfinished post later in the Drafts section of your profile page. X

How to plot a graph with real-time data

ravi2
12-Amethyst

How to plot a graph with real-time data

I want my time-series char widget to display real-time data in the Mashup as soon as the data field property's DataChangeEvent is triggered. I've tried with the following two approaches, but none of them work.

 

1. Using the 'Refresh' widget with interval set to 60 seconds, and

2. Using the GetProperties service, with 'Automatically update values' flag checked, and the 'ServiceInvokeComplete' event bind to 'QueryPropertyHistory' service (which has its return data bound to the chart widget).

 

I've two remotely bound properties in my Remote Thing, one String type and the other Number type, both logged, and an associated Value Stream. The Number type property has 'DataChangeEvent' set as 'Always' and the String type property as 'Value'. The Number type property gets updated every 60 seconds. Upon executing the 'QueryPropertyHistory' service manually in the Composer UI, I find that the returned table does not contain rows spaced 60 seconds apart. Many of the rows are only milliseconds apart, while some rows are few minutes apart. I also checked the 'Application Log' to see the DataChangeEvent firing logs, and they aren't triggered every 60 seconds either.

3 REPLIES 3
rajee
11-Garnet
(To:ravi2)

Hi @ravi2 

 

Give the event of 'refresh' in 'auto refresh widget' to 'get properties' service and if any other service so that, whenever the mashup is refreshed it gets the updated property values.

Hope it helps.

It maybe happening various things.

 

  1. Stream / ValueStream writes are done asyncronously, then you may receive a DataChange event but data isn't written on the stream, that maybe why you don't see right on the data on the QueryPropertyHistory. You may need a delay between DataChange and QueryPropertyHistory
  2. In order to get GetProperties working you need to bind one of the properties that changes binded to a widget (let's add a hidden ValueDisplay widget for instance).
slangley
23-Emerald II
(To:CarlesColl)

Hi @ravi2.

 

If one of the previous responses answered your question, please mark the appropriate one as the Accepted solution for the benefit of others with the same question.

 

Regards.

 

--Sharon

Top Tags