Tranforming boolean history tags to events

Hi,

I’m using Ignition to log valves opening and closing (boolean) and need to find a way to build a dataset with tagname, timestampopen, timestampclose. How can I transform data from history logging into such format? The goal is to use this in a ribbon (state) chart

O

The easiest way is to use a tag history binding for each valve. Set the query mode to "As Stored". The result will give you a t_stamp and True / False for each row.

Which component are you using for the ribbon?

Thank you for your response.

The only ribbon char I’ve found is this: Ignition Exchange | Inductive Automation

This require columns Tag, TSOpen, TSClose. So I need to modify the result returned from history.

O

You can use a script transform where your historical data is coming in to get the columns the way you need them, define new headers, that kind of thing. I’ve used these built-in dataset functions to do exactly this in the past.

https://www.docs.inductiveautomation.com/docs/8.1/appendix/scripting-functions/system-dataset

When using "As Stored" mode to retrieve events, it is crucial to use "Tall" result format instead of "Wide", as the latter duplicates timestamps across columns, giving the appearance of extra event timestamps. (My Integration Toolkit's groupBy() function is handy for splitting such results by tag.)