Total Up time and Down Time

Hello all,

I am new to Ignition so any help rendered would be greatly appreciated!

I have a boolean tag from that goes from 0 to 1 for when the machine is active, 0 would indicate that the machine is not running. I would like to calculate the total up time and down time for a period of 24 hours and then log it to the database.

This data would then need to be displayed graphically in a menu - sorting by the date to display the total up and down times for the selected date.

I am currently using an hour meter to log the up time in a table. Is there a way to store the uptime for 24 hours then start the hour meter again on another row in the table?

How would I then get these values from the table and display them?

What is the best approach you would recommend to tackle this project?

Thank you,
Lanutoshi

I would setup tag history on the tag(s) and then you can use Duration On/Off aggregates in a tag history query. Using this method you can query any interval, not just 24 hours.
https://docs.inductiveautomation.com/display/DOC81/system.tag.queryTagHistory

5 Likes

Thank you for the input! I will look into this.

I don’t have much experience with scripting either, where would you suggest I start?

I know this can be time consuming, but spend the time watching the videos and taking the challenge quizzes.
The link above has details and an example script for tag history.

3 Likes