Collection interval, buffering, and time-series storage structure.
Most requests to view PLC data on the web converge to "read via Modbus, put it in a DB, and graph it." The problem is designing the polling cycle and storage structure.
1-second polling is usually excessive. It is better to first observe the cycle of value changes.
| Data | Recommended interval | Reason |
|---|---|---|
| Temperature and pressure | 5–10 seconds | No sudden physical changes |
| Motor current | 1 second | early overload detection |
| counters and production quantities | 10–30 seconds | Cumulative value, so no loss |
If you put all samples into a relational DB, it grows quickly. In practice, it is better to separate the latest value (current value table) and history (time series) per tag.
-- Keep one row per tag for current values
CREATE TABLE tag_current (
tag_id TEXT PRIMARY KEY,
value REAL, quality INTEGER, ts TEXT
);
-- A time index is required for history
CREATE INDEX idx_tag_ts ON tag_history(tag_id, ts);
The dashboard does not need to refresh every second. Separating the screen refresh cycle from the collection cycle greatly reduces the load.
If you tell us your site conditions, we will review a configuration that can be applied.
Technical Inquiry →