How-To Guides
Analytics Guides

Use the Uptime and Downtime by Value KPI

6min

You can use the UpTime and DownTime by Value KPI processor to compare your current value with a desired value. The KPI sorts them as either uptime or downtime based on the specified condition ( greater(>), less(<), equal(==) or notEqual(!=) ) and a delta to round off mistakes.

User Scenario

Review the following scenario for the uptime and downtime by Value KPI processor. Then, using an input processor, you will simulate PLC data and use this KPI to have more detailed knowledge of the time.

In a manufacturing plant, the PLC monitors a critical component with an ideal value of 10.5. If the output drops below 5 or deviates by 0.5 value, it signifies potential issues, triggering downtime. For instance, if the output equals 0, it also means downtime. The plant manager can use the Uptime and Downtime KPI processor to analyze these conditions and gain insights into the production line's status. This scenario allows for proactive maintenance and operational decisions, ensuring real-time visibility and minimizing unplanned downtime.

Step 1: Add a Device

Follow the steps to Connect a Device and configure the following parameters:

  • Device Type: Simulator
  • Driver Name: Generator
  • Enable Alias Topics: Select the checkbox.

Step 2: Add Tags

After connecting the device, add the following tag. See Add Tags to learn more.

Tag 1: tag1

  • Name: Select S - Random value generator.
  • Value Type: Select float64.
  • Polling Interval: Enter 1.
  • Tag Name: Enter tag1.
  • Min Value: Enter 0.
  • Max Value: Enter 11.5.

Step 3: Create Analytics Flow

You can now create the analytics flows using data from the device and tag you previously created.

To create an analytics flow with the UpTime and DownTime by Value Processor function:

  1. In Litmus Edge, navigate to Analytics.
  2. On the analytics canvas, click Add processor. The Create a processor dialog box displays.

    The Add processor option
    The Add processor option
    
  3. Select DataHub Subscribe.
  4. In the Topic field, click the Search icon, select the device you previously created, and then select the alias topic for tag1.

    Create a Processor dialog box
    Create a Processor dialog box
    
  5. Click Save.
  6. Click Add processor again and select the UpTime and DownTime by Value processor. The following information defines this function:
    • Unit: Select the time units from the drop-down menu to display the uptime/downtime status. Choose seconds for this user scenario.
    • Condition: Select a condition from the drop-down menu for comparing the current value to the desired value. Choose the less than (<) condition for this user scenario.
    • Desired Value: Enter a desired value to check the current uptime/downtime status. Use 10.5 for this user scenario.
    • Delta of Tolerance: Enter a delta of 0.5 to allow for a tolerance of +/- 0.5 from your desired value. If you input a delta of 0, even the smallest change will be detected by this KPI.
    • TimeInterval: If the tag publishes at the expected interval, it is better to disable this timer by entering 0 in the field.
    • Click Save.

      Edit a Processor dialog box
      Edit a Processor dialog box
      
  7. Connect the DataHub Subscribe processor (tag: tag1) to the UpTime and DownTime by Value processor with a wire and use the events connection.
  8. On the analytics canvas, click Save.

The configured analytics flows should look like the following:

Completed Flows Canvas
Completed Flows Canvas


Step 4: View Output of Processor

Click the View icon in the UpTime and DownTime by Value processor to view the output values.

The output will display the message payload with the uptime and downtime value field, disregarding current values within +/- 0.5 of your desired value.

Output of UpTime and DownTime by Value processor
Output of UpTime and DownTime by Value processor