Stream live data while keeping the same start time

Hi, I’m logging data to an InfluxDB database (from a twincat system and to a database setup on the same PLC/computer) and want to show that data as well in a graph. A few seconds delay is not a problem. I’m struggling to show a graph that keeps the same start time while extending the graph with more and more logpoints, i.e. the graph gets more and more compressed over time.

How can I do this?

Appreciate any help!

Are you currently streaming the data? If yes, how? MQTT? Websocket?

From InfluxDX to grafana I have only experimented with making a panel so far and connecting to that with http. I’m in need of some guidance as how to continue.

It sounds like you have InfluxDB storing the data, but have not set up any live streaming, correct? Please share what you have done thus far. I presume you know the difference between reading from Influx at a fast rate (e.g. every 5 seconds) vs. live streaming? It’s a lot more work & resources to set up truly live streaming, so if using InfluxDB and having the data refresh every 5 seconds or so is acceptable, I would go with that.

As for your original question, if you want to keep the start time fixed (for example, Sep 12 at midnight), did you try something like this?

Correct. Don’t assume too much though. :slight_smile:

Data refresh every 2-3 seconds would be fine. Both program and database are running on the same quite capable system.

I’m still trying to figure out if grafana is good for our purpose or if I should go for the built-in graphs in beckhoff’s twincat environment.

I tried to set the start time fixed like you show and then use now as the end time. But I couldn’t get the panel to autorefresh then.

Did you select a refresh interval in the upper right corner of Grafana?

I got it to work, not sure what I did different 6 weeks ago. I can use this manually altered link to a grafana panel now: http://localhost:3000/d-solo/mq7tMTNVz/first-dashboard?orgId=1&from=1666870530000&to=now&panelId=6&refresh=5s" width=“450” height=“200” frameborder=“0”