Hi all,
I need advices how to manage a situation. We have bacNET multistate objects to collect. Data Acquisition and display perspective views was alright and customer was satisfied.
Now, customer would like to have data analysis on duration by state. Issue is that the tag historian durationOn is for boolean. Just take an example of a fan with a multistate : 0=off; 1=On Speed1; 2= On Speed2; 3=Maintenance mode. Customer wants to know duration of reach state.
The tag is currently an OPC tag (Short datatype) but nothing was really done to make this duration computation easy.
I'm thinking on 2 ways to answer customer request:
1 / Trying to create custom aggregate scripts but I'm wondering if this agregate functions are available on Datasource report module; And I'm not sure how to do it.
2/ Split the multistate on several boolean tags (Expression). Then, I'm wondering if there is a way to evaluate the expression on past historian data to rebuild the booleans tags on the same period than Multistate tags ?
Thanks in advance for your feedbacks.
Essentially, you need two analytic features, not available in the Ignition historian, to achieve this:
lead() over (partition by tag_id, order by t_stamp)
to obtain the end timestamp of any particular interval, and
group by stateValue
to keep each state together for summation or other analysis.
The common solution is to not use the tag historian, but to use a custom DB table to record your state changes. Then you can directly use SQL with the given phrases to extract the information you need.
An alternate solution is to use the historian and retrieve the states "As Stored, Tall format" and then script the equivalent to the SQL. (If you go this route, you may find some expression functions in my Integration Toolkit helpful.)
2 Likes
Phil,
Are you speaking about this kit ? Ignition Exchange | Inductive Automation
Or ??
Thx.
Hi all,
Finally and for information. We managed with TagHistorian query with an interval of X minutes and the closest value aggregation mode.
Then we added a subgroup on a table grouped by statevalue. Duration = count * X interval minutes.
This is working pretty well specially cause on our project the multistate value is not changing so often on period.
Thanks for your feedbacks that allowing me to drive to the correct direction.