Historical Tag Data - Binding & Using String Data

Struggling to do the below in Perspective, but it seems like it should be straightforward...

Get machine run status from tag
Get MES run status from tag
Graph these over given time intervals
Use status durations over given time intervals for calculations

Data format:

  • MES Run Status: UDT Memory Tag with a string value - "R" for run, etc. Updated on change and stored in historian.

  • Machine Run Status: OPC Tag with a string value - "0A000" for auto, etc. Updated on change and stored in historian.

  • 13 digit timestamps

The binding below produces a table with the information I want.


image

I am stuck here - I can't figure out how to take this information and use it to populate graphs or use it for calculations. I have used a roundabout inefficient way to get something like this, but the way I'm doing it is not feasible for scaling and likely uses too many resources.

Looking for any guidance - if code is the solution, I'd need an explanation of how to implement it, as I've been going mostly code-free (aside from some CSS bits and expressions)