Something like this is definitely achievable, for visualization purposes, I’d recommended using the Event Bar Chart object. This can be used to display elapsed time based on event triggers within your project.
To keep time my suggestion would be to use a macro like the example below:
macro_command main()
bool status = false
int ss = 0, mm = 0, hh = 0, tot = 0
// TO-DO - At new day implement change to reset total
// Total time running in seconds
GetData(tot, "Local HMI", "run_tot", 1)
// Get run status
GetData(status, "Local HMI", "Run", 1)
// Check if running
if status then
tot = tot + 1
SetData(tot, "Local HMI", "run_tot", 1)
end if
// Get remainder in seconds
ss = tot mod 60
// Get remainder in minutes
mm = ((tot - ss) / 60) mod 60
// Get hours
hh = ((tot - ss) / 60) / 60
SetData(hh, "Local HMI", "run_hh", 1)
SetData(mm, "Local HMI", "run_mm", 1)
SetData(ss, "Local HMI", "run_ss", 1)
end macro_command
I’ve also attatched a small demo project here: Tracker Demo
You can reference this data a few different ways, like using the Recipe data base for example.
Hope this helps you get going in the right direction. Let us know if you have any more questions!
You can accomplish this by saving the data into RW (Retentive) memory. In the macro you can change the SetData registers to RW so it saves within the HMI’s flash memory. Here is a more comprehensive tutorial of that process on our YouTube channel : link
The best way to call that data in the future would be using the recipe database.
The maximum number of hours is above 24 as within the projects its getting saved to a 32 bit unsigned memory address within the recipe database. Therefore the maximum value for hours is 4,294,967,295 (2^32 - 1).