We are still figuring out how to best explain the KPI stuff to people, so if you have any questions, feel free to ask.
For the printing press, I'd do something like this:
1. Push all the process values / tags of the PLC to the Unified Namespace for the Historian feature
2. Now create a Node-RED flow that takes some of these tags and publishes /count messages. So every time you produced one additional piece, you send a count message for that asset.
https://umh.docs.umh.app/docs/architecture/datamodel/messages/count/. One example flow can be found here:
https://github.com/united-manufacturing-hub/community-repo/tree/main/Node-RED/flows/count-processing
Another one here:
https://github.com/united-manufacturing-hub/community-repo/tree/main/Node-RED/flows/optical-distance-sensor-for-conveyor-belt-item-counting
3. Once you have the count messages, you can create from there a logic basically saying "if there are count messages coming in, send a /state message. if no count message came in in the past seconds / minutes, then set the machine state to unknown stop (40000). Example:
https://github.com/united-manufacturing-hub/community-repo/tree/main/Node-RED/flows/state
4. you could fine tune this logic by adding logiclike, if no counts are coming in AND a maintenance door is opened, set the machine state to maintenance. Example:
https://github.com/united-manufacturing-hub/community-repo/tree/main/Node-RED/flows/inductive-sensor-door-switch-preventive-maintenance
5. finally, add a shift plan
https://github.com/united-manufacturing-hub/community-repo/tree/main/Node-RED/flows/addShift