How-To Guides
Analytics Guides

Use the Inputs Processor Function

17min

You can use multiple inputs to create time-series functions and calculate Key Performance Indicators (KPIs). Multiple inputs are to be provided with the value type connection, and then the respective functions are calculated.

Understanding Different Inputs Functions

Use one of the following functions for your inputs:

  • Inputs Average: Calculate the average of the inputs in the Flow.
  • Inputs Maximum: Find the maximum value between the inputs in the Flow.
  • Inputs Minimum: Find the minimum value between the inputs in the Flow.
  • Inputs Sum: Add all the input values in the Flow.

User Scenario

Review the following scenario for the inputs processor function. Then, you will simulate PLC data and calculate KPIs using multiple inputs processor functions.

In a production facility, several PLCs use multiple sensors to monitor parameters such as temperature, pressure, and speed.

  • You can calculate the average temperature of various sections of the production line using the Inputs Average function.
  • You can track the highest pressure with the Inputs Maximum function.
  • You can track machine downtime by using the Inputs Minimum function.
  • You can aggregate total production output over a specified period using the Inputs Sum function.

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 tags. See Add Tags to learn more. Each tag will be used for simulating the different Inputs processor outputs mentioned above.

Tag 1: tag1

  • Name: Select S - Random value generator
  • Value Type: Select int64
  • Polling Interval: Enter 5
  • Tag Name: Enter tag1
  • Min_value: Enter 49.
  • Max_value: Enter 49.

Tag 2: tag2

  • Name: Select S - Random value generator
  • Value Type: Select int64
  • Polling Interval: Enter 5
  • Tag Name: Enter tag2
  • Min_value: Enter 50.
  • Max_value: Enter 50.

Tag 3: tag3

  • Name: Select S - Random value generator
  • Value Type: Select int64
  • Polling Interval: Enter 5
  • Tag Name: Enter tag3
  • Min_value: Enter 51.
  • Max_value: Enter 51.

Step 3: Create Analytics Flows

You can now create the analytics flows using data from the device and tags you previously created. Follow the appropriate step out of 3a, 3b, 3c, or 3d based on the Inputs Processor Function you want to use.

To create an analytics flow with the Inputs Processor function:

  1. 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 tag1.

    Create a Processor dialog box
    Create a Processor dialog box
    
  5. Click Save.
  6. Repeat steps 2-5 to add another DataHub Subscribe node. Select the alias topic for the tag2 and tag3 respectively.

Step 3a: Configure Inputs Average Processor

  1. Click Add processor again and select Inputs Average. The following information defines this function:
    • Field Name: Select the field name for which you want to apply the function. The field name must be available in all the inputs. For example, value or downtime.
    • Processing Type: Select unsigned from the drop-down list.
  2. Click Save.

    Inputs Average dialog box
    Inputs Average dialog box
    
  3. Connect the DataHub Subscribe processor (tag: tag1) to the Inputs Average processor with a wire and enter the definition of Avg_tag1 for the values connection.
  4. Connect the DataHub Subscribe processor (tag: tag2) to the Inputs Average processor with a wire and enter a definition of Avg_tag2 for the values connection.
  5. Connect the DataHub Subscribe processor (tag: tag3) to the Inputs Average processor with a wire and enter a definition of Avg_tag3 for the values connection.
  6. On the analytics canvas, click Save.

The configured analytics flows should look like the following:

Completed Inputs Average flow canvas
Completed Inputs Average flow canvas


Step 3b: Configure Inputs Maximum Processor

  1. Click Add processor again and select Inputs Maximum. The following information defines this function:
    • Field Name: Select the field name for which you want to apply the function. The field name must be available in all the inputs. For example, value or downtime.
    • Processing Type: Select unsigned from the drop-down list.
  2. Click Save.

    Inputs Maximum dialog box
    Inputs Maximum dialog box
    
  3. Connect the DataHub Subscribe processor (tag: tag1) to the Inputs Maximum processor with a wire and enter the definition of Max_tag1 for the values connection.
  4. Connect the DataHub Subscribe processor (tag: tag2) to the Inputs Maximum processor with a wire and enter a definition of Max_tag2 for the values connection.
  5. Connect the DataHub Subscribe processor (tag: tag3) to the Inputs Maximum processor with a wire and enter a definition of Max_tag3 for the values connection.
  6. On the analytics canvas, click Save.

The configured analytics flows should look like the following:

Completed Inputs Maximum flow canvas
Completed Inputs Maximum flow canvas


Step 3c: Configure Inputs Minimum Processor

  1. Click Add processor again and select Inputs Minimum. The following information defines this function:
    • Field Name: Select the field name for which you want to apply the function. The field name must be available in all the inputs. For example, value or downtime.
    • Processing Type: Select unsigned from the drop-down list.
  2. Click Save.

    Inputs Minimum dialog box
    Inputs Minimum dialog box
    
  3. Connect the DataHub Subscribe processor (tag: tag1) to the Inputs Minimum processor with a wire and enter the definition of Min_tag1 for the values connection.
  4. Connect the DataHub Subscribe processor (tag: tag2) to the Inputs Minimum processor with a wire and enter a definition of Min_tag2 for the values connection.
  5. Connect the DataHub Subscribe processor (tag: tag3) to the Inputs Minimum processor with a wire and enter a definition of Min_tag3 for the values connection.
  6. On the analytics canvas, click Save.

The configured analytics flows should look like the following:

Completed Inputs Minimum flow canvas
Completed Inputs Minimum flow canvas


Step 3d: Configure Inputs Sum Processor

  1. Click Add processor again and select Inputs Sum. The following information defines this function:
    • Field Name: Select the field name for which you want to apply the function. The field name must be available in all the inputs. For example, value or downtime.
    • Processing Type: Select unsigned from the drop-down list.
  2. Click Save.

    Inputs Sum dialog box
    Inputs Sum dialog box
    
  3. Connect the DataHub Subscribe processor (tag: tag1) to the Inputs Sum processor with a wire and enter the definition of Sum_tag1 for the values connection.
  4. Connect the DataHub Subscribe processor (tag: tag2) to the Inputs Sum processor with a wire and enter a definition of Sum_tag2 for the values connection.
  5. Connect the DataHub Subscribe processor (tag: tag3) to the Inputs Sum processor with a wire and enter a definition of Sum_tag3 for the values connection.
  6. On the analytics canvas, click Save.

The configured analytics flows should look like the following:

Completed Inputs Sum flow canvas
Completed Inputs Sum flow canvas


Step 4: View Output of Processor

Click the View icon in the Inputs processor to view the output values.

View Inputs Average Output

The average function calculates the average of three defined tag values.

Average of inputs value
Average of inputs value


View Inputs Maximum Output

The maximum function finds the largest of three defined tag values.

Maximum of all inputs
Maximum of all inputs


View Inputs Minimum Output

The minimum function finds the lowest of three defined tag values.

Minimum of inputs value
Minimum of inputs value


View Inputs Summation Output

The summation function calculates the total of three defined tag values.

Summation of inputs value
Summation of inputs value