I’m looking to record downtime information regarding some equipment in SQL so I can immediately view it in the equipment schedule chart on a vision screen. I have tags that come from PLCs that tell me the up or down status right now.
So the format should look like this: {equipmentID, startTime, endTime}. How to record the endTime is throwing me for a loop. How could I accomplish this via Transaction Groups or scripting?
Thanks,
Cody
In a transaction group you can have a run always expression in the mode of Hour meter and retentive. Set the expression in it to look for when your equipment is stopped or has a bad quality. This will give you a time for how long your equipment has been down. In a triggered expression you can use dateArithmetic(now(),(your run always timer),(what ever units you use in the timer)). This triggered expression would create your start time for the downtime event. For you end time for the downtime event you can use the timestamp for the transaction group.