Hi Ahmed,
I think you are on the right track! You should be able to use the TimeSeries widget using a microflow datasource, in which you retrieve data from an external server and set a refresh of the chart on every 1 or 2 seconds.
Make sure the datasource-microflow returns a list of all the datapoints, and you set both the x-axis value and sort value:
If that's OK, can you show the result of that microflow (for example a screenshot of the Variables-window when breaking on the datasource-microflow)?
Kind regards,
Johan
The app displays list of robot’s information…
Robot Entity are defined in Mendix: Name, entity-id and property-set-name. (Last two, values are copied-paste from MindSphere)
There is an HTTP server running that fetching data from MindSphere time series service. (The internal implementation does the login to MindSphere)
Robot Overview, displays Robot Persistent Entity
I added Time Series Chart
Note: Entity NativeModule.TimeSummary is not persistent
Here is the Microflow for fetching data from the HTTP server
Example of returned data from the server while debugging:
Example of data printed in the server log:
{'time_stamp': 100, 'actual_robot_voltage': 0.0, 'safety_mode': 4, 'tool_temperature': 46.0, 'runtime_state': 4, 'actual_main_voltage': 45.76015090942383, 'tool_mode': 255, '_time': '2019-09-26T16:28:28.28Z', 'actual_momentum': 0.0, 'robot_mode': 3}
And here how the chart looks like!!!
Note: the x-axis starts from May 2000 to Jan 2001 and I can’t change it!! Although _time (x-axis) from the server are 2019…
Hi Ahmed,
Thank you for the detailed explanation; you really are so close!
I was able to reconstruct the Mar, May 2000 x-axis: when the returned list of datapoints is empty. Can you check which variable you return in the UR_IOT_Latest_GET datasource microflow? And using a breakpoint: wat the values are?
How do you get your list? Creating one like below? Or retrieving over association? Keep in mind: following an association from persistent to non-persistent will return an empty list.
Kind Regards,
Johan Flikweert
You are right w.r.t. the List is empty...I fixed it now and added: ‘Add to list...’ and the debugger now show the list has one element.
However, the graph still does not show anything since I am sending every time list of one element.
I am now trying to figure out how to keep the data coming from the server in some Transient List so I send list + new item to the chart.
Any help?
thanks again
I would suggest you put the widget in a non-persistent container like this:
Associate the container with the datapoint entity, such that you can return a list of datapoints by retrieving over association in your datasource microflow:
To also remove “old” datapoints, you should make some custom logic to delete these from the list.
Good luck!