| What is middleware? |
| |
Middleware is best described as a bridge between two environments. When you have incompatible environments, you need a solution to bridge the gap. Browser based applications cannot see into devices because of browser securities.
In this case of RFCMMS MiddleWare, we want to get the RUNTIME STATUS from a PLC (Program Logic Controller) and use the status information within our browser application. |
| |
 |
| |
| When the middleware detects the output of the PLC is ON, the middleware inserts a new record into MySQL database. When the middleware detects the output is OFF, the middleware updates the previous data it inserted with new data to indicate the input is off. |
| |
| Currently, RFCMMS MiddleWare is designed to track machine runtime. When an input is detected, the middleware inserts a timestamp in the start field of the database table. When the input is turned off, the middleware updates the new record with a timestamp into the end field of the database table. Future versions will have features to read sensors, on/off status and more. |
| |
 |
| |
PLC Program Rung
 |
| |
Database Table Entries
 |
| |
Using timestamps is the best practice for calculating time. Above is the the number of seconds from January 1, 1970, UNIX time. With this method, you simply do the math.
As you can see from the example below, getting your own statistics are easy once you get the data. |
| |
| TimeSpan = (plc_end - plc_start) |
| TimeSpan = (1770484362 - 1770483663) |
| TimeSpan = 699 Seconds |
| |
| To get number of minutes: (699 / 60) = 11.65 |
| |
| To get number of hours: ((699 / 60) / 60) = 0.19 |
| |
| With the data you collect, you can create views of your choice using any HTML editor. (Click image to view full size) |
| |
 |
| |
| RFCMMS MiddleWare Application |
 |
| |