How-To Guides
Analytics Guides

Use the Change of Value KPI

6min

The Change of Value KPI displays the complete message payload when the current value differs from the previous value. If there is no substantial change, no output is displayed.

User Scenario

Review the following scenario for the change of value KPI processor function. Then, using an input processor, you will simulate PLC data and use this KPI to detect a change of value in the input field.

In an industrial setting, the Change of Value KPI is used to monitor the voltage levels in an electrical grid. The input processor continuously collects voltage data and feeds it to the Change of Value KPI processor. The KPI triggers an output when there is a substantial change in voltage, alerting the operators to potential issues. Otherwise, if things are normal, no output is expected. It allows the engineers to promptly respond to voltage fluctuations, preventing equipment damage and outages.

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: voltage

  • Name: Select S - Random value generator.
  • Value Type: Select float64.
  • Polling Interval: Enter 1.
  • Tag Name: Enter voltage.
  • Min Value: Enter 99.
  • Max Value: Enter 103.

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 Change of Value Processor function:

  1. In Manufacturing Connect 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 the voltage tag.

    Create a Processor dialog box
    Create a Processor dialog box
    
  5. Click Save.
  6. Click Add processor again and select the Change of Value processor. The following information defines this function:
    • Map Field Name: Enter the field you want to observe like value or timestamp, depending entirely on the input message you are sending to this KPI.
    • Delta of Tolerance: Enter a delta of 1 if you want to allow ignoring a change of +/- 1 from your previous value. If you enter delta as 0, even the smallest change will be detected by this KPI.
    • 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.

      Edit a Processor dialog box
      Edit a Processor dialog box
      
  7. Connect the DataHub Subscribe processor (tag: voltage) to the Change of 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 Change of Value processor to view the output values.

The output displays the message payload when the value field is +/- 1 from your previous value.

Output of Change of Value processor
Output of Change of Value processor