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 docid\ nm1lqfefya dsiffitity 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 docid\ h5heqicxrcy3nch9kbg9i 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 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 the tag1 click save 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 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 click save 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 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 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 on the analytics canvas, click save the configured analytics flows should look like the following step 3b configure inputs maximum processor 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 click save 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 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 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 on the analytics canvas, click save the configured analytics flows should look like the following step 3c configure inputs minimum processor 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 click save 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 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 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 on the analytics canvas, click save the configured analytics flows should look like the following step 3d configure inputs sum processor 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 click save 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 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 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 on the analytics canvas, click save the configured analytics flows should look like the following 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 view inputs maximum output the maximum function finds the largest of three defined tag values view inputs minimum output the minimum function finds the lowest of three defined tag values view inputs summation output the summation function calculates the total of three defined tag values