I have 1 tag that toggles its value between 1 and 0 , depending on the status of a motor (on/off)
i have this tag to store it’s history
i have a transaction group set up so that when this tag changes from a 1 to a 0 an entry is put into my database with a timestamp and a simple auto-increment as an entry number. AND when it changes back to a 1 again.
there is a status chart that easily shows realtime 1’s and 0’s for the office personel to see how this particular machine is doing on any given day, there is also a historical chart showing similar information with the ability for a date range to be selected to view the status of this device.
What i am being asked to do is:
total the time for the last 24 hours when the status was a 1
if i use the dataset for the historical status chart i will need to find a way to add thousands of timestamps , since every 1000 ms an entry is entered in the dataset
if i use the transaction group i think i would need to use datediff to calculate the time difference between 2 entries , then add up all of the differences in time to get the total uptime for a given period.
I am still a newbie and am having a difficult time figuring this one out, and make it displayed as easy for me and the user.
any ideas anyone??? if screenshots would help, i can do that too