Preparing data historian exports for IoT platforms
Data historians such as those used in factories, utilities and water plants hold years of tag values recorded at fixed intervals. Cloud IoT services expect that data in a different shape: one message per reading, with a device identifier, an ISO timestamp and a value, usually as JSON or CSV. The historian can export its tags, but the export format rarely matches what the cloud service can ingest, and the volume is often tens of gigabytes.
TextPipe sits between the two. It reads the historian export as a stream, rewrites each record into the layout that the target platform needs, and writes the result in files of a size that the loader accepts. Nothing is loaded into memory, so a ten-year archive is processed the same way as a single day.
Sample input and output
A historian CSV export contains one reading per line:
TagName,Timestamp,Value,Quality
PUMP01.FLOW,14/03/2024 02:11:09,152.4,192
PUMP01.FLOW,14/03/2024 02:11:19,153.1,192
Filters that reorder the date to year-month-day, wrap each record in braces and add field names produce one JSON object per line:
{"device":"PUMP01","metric":"FLOW","time":"2024-03-14T02:11:09","value":152.4}
A further filter can drop readings whose quality code shows a bad sensor value, so that the cloud store only receives trustworthy data.
Typical settings
- Date and time reformatting: rewrite local formats into ISO 8601, and shift a fixed offset if the historian stores local time.
- Tag name splitting: separate a tag such as PUMP01.FLOW into a device and a metric.
- Quality filtering: remove or flag readings with a quality code that marks them as bad or uncertain.
- Chunking: split the output into files of a fixed number of lines for upload limits.
Practical applications
Operations teams use this to back-fill a new IoT dashboard with history so that trend charts are not empty on the first day. Engineers use it to hand a clean data set to analysts who work in Python or a business intelligence tool. With the Pro edition the same filter list runs from the command line on a schedule, so that each night's export is converted and uploaded automatically.
Common pitfalls
- Check whether the historian exports dates as day-month or month-day before reformatting.
- Decimal commas in regional exports must be converted to decimal points for JSON.
- Test the filter list on a small sample and compare it with the platform's schema before converting the full archive.
Related pages
See the SCADA case study for an industrial data example and the systems integration solutions page for related connection tasks. For delimited input read about CSV processing, and for very large exports see splitting CSV files.