Is it possible for a time series to have the time in the data?

Support forum for MegunoLink
Post Reply
mjbb2
Posts: 6
Joined: Tue Nov 14, 2023 2:28 am

Wed Nov 22, 2023 7:02 am

Currently the
{TIMEPLOT|DATA|...
line uses a |T| as a time placeholder which is presumably populated with a timestamp at the time it is parsed within Megunolink.

For slow data rates this isn't a problem, however for intermittently high data rates I have to buffer the data and then feed at a measured rate into Megunolink to avoid overloading it.
As a consequence the applied timestamps don't reflect reality and the lines that have shallower than expected slopes.

I tried to work around this by using an xyplot with a milliseconds time stamp, however the setting that controls the number of points in the plot works on a per series setting, therefore low update plots span the full width of the display, whereas high update plots with the same number of points only appear on the right.
blaketasim
Posts: 4
Joined: Thu Nov 23, 2023 5:14 am

Thu Nov 23, 2023 7:52 pm

I have recently run into the same problem.

I tried to do a time series with a time input but that turned out to be a much bigger headache than it was worth. The issue is you need to return time relative to seconds since unix epoch so the number gets huge. (you have to sync your time with the computer clock for it to run up to date) I think i was also struggling because megulink want's seconds instead of milliseconds and it was just turning into a conversion pain. I think i finally determined that although the time plot scrolling option was nice, the xy plot worked well enough and saved a lot of time.

The perfect scenario is a scrolling xy plot!

Can you group your data series by sampling rate? That's what i do, so i just adjust the number of points the plot holds to span the appropriate size. I've having really good luck returning data every 1ms through an ethernet connection.
admin
Site Admin
Posts: 20
Joined: Mon May 26, 2014 10:53 am

Mon Dec 04, 2023 8:23 am

Hi folks,

You can also use calendar time stamps with time plots by creating and passing a tm structure to SendData. E.g.

Code: Select all

tm TimeStamp;
TimeStamp.tm_year = 2023-1900;
TimeStamp.tm_month = 10; // Jan=0, Feb=1, etc
// etc.
MyPlot.SendData("Series", TimeStamp, 123);
The tm structure doesn't have sub-second resolution though. MegunoLink will parse date-time values with sub-second resolution, though the Arduino library doesn't have a mechanism to generate the message at the moment. Sending something like: *{TIMEPLOT|DATA|Series name|19:26:15.1234|123}* using Serial.print will do the job.

Have a great day
Paul
Post Reply