Use the Online and Offline Percentage KPI
The Online and Offline Percentage KPI is a raw number indicating how long a sensor was functional and how long it was offline.
Review the following scenario for the online and offline KPI processor. Then, using an input processor, you will simulate PLC data and use this KPI to have more detailed knowledge of the time.
At a busy automotive manufacturing plant, the production line relies on a critical sensor to monitor engine performance. The maintenance team uses the online and offline percentage KPI to track the sensor's functionality. For instance, if the sensor was operational for 550 minutes but offline for 25 minutes during a specific shift, the team analyzes this data to optimize maintenance schedules and ensure continuous production efficiency.
Follow the steps to Connect a Device and configure the following parameters:
- Device Type: Simulator
- Driver Name: Generator
- Enable Alias Topics: Select the checkbox.
After connecting the device, add the following tag. See Add Tags to learn more.
- Name: Select S - Random value generator.
- Value Type: Select float64.
- Polling Interval: Enter 1.
- Tag Name: Enter tag1.
You can now create the analytics flows using data from the device and tag you previously created.
To create an analytics flow with the Online and Offline Processor functions:
- In Litmus Edge, navigate to Analytics.
On the analytics canvas, click Add processor. The Create a processor dialog box displays.
- Select DataHub Subscribe.
In the Topic field, click the Search icon, select the device you previously created, and then select the alias topic for tag1.
- Click Save.
- Click Add processor again and select the Online and Offline Percentage processor. The following information defines this function:
- Unit: Time units for displaying online/offline status.
- resetOnStatus: If you enable this parameter, the KPI will reset every time the status changes from ON or OFF.
- Device Reset: Enable this parameter to reset everything when the device changes.
- Time Interval: If the tag publishes at the expected interval, it is better to disable this timer by entering 0 in the field.
Click Save.
- Connect the DataHub Subscribe processor (tag: tag1) to the Online and Offline Percentage processor with a wire and use the events connection.
- On the analytics canvas, click Save.
The configured analytics flows should look like the following:
Click the View icon in the Online and Offline Percentage processor to view the output values.
The output shows the offline and online durations along with the timestamp indicating when the device was last offline. It also provides the total time elapsed since the KPI was initiated.