How-To Guides
Analytics Guides

Use the Combination Processor Function

11min
you can use the combination processor function to combine fields from different input processors into a single json string understanding combination types you have the following combination types combine selected fields this option allows you to combine the selected number of fields from different input processors into a single json string combine all fields this option allows you to combine all fields from different input processors into a single json string user scenario review the following scenario for the combination processor function then, you will simulate plc data and create combinations using input processors in your manufacturing plant, various plcs control the production process for assembly lines, robotic arms, conveyor belts, and environmental controls with the combination processor, you can merge the data from multiple or all plcs into a single json string to get a complete view of the plant's operations 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 represent one of the combination types mentioned above tag 1 combine selected fields name select s random value generator value type select int64 polling interval enter 5 tag name enter combine selected fields tag 2 combine all fields name select s random value generator value type select int64 polling interval enter 5 tag name enter combine all fields step 3 create analytics flows you can now create the analytics flows using data from the device and tags you previously created follow the steps for either step 3a or 3b, depending on whether you want to combine selected or all fields to create an analytics flow with the combination 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 combine selected fields tag click save repeat steps 2 5 to add another datahub subscribe node select the alias topic for the combine all fields tag step 3a configure json string for selected fields click add processor again and select combination processor the following information defines this function combination type select combine selected fields from the drop down menu what timestamp to take? select fresh timestamp from the drop down menu fields to combine the fields to combine are defined as wire definition fieldname enter combineselect tagname, combineselect value, combineall tagname, combineall value, with a comma as the separator click save connect the datahub subscribe processor (tag combine selected fields) to the combination processor with a wire and enter the definition of combineselect for the connection connect the datahub subscribe processor (tag combine all fields ) to the combination processor with a wire and enter a definition of combineall for the connection on the analytics canvas, click save step 3b configure json string for all fields click add processor again and select combination processor the following information defines this function combination type select combine all fields from the drop down menu what timestamp to take? select fresh timestamp from the drop down menu fields to combine you may skip this field for this combination type click save connect the datahub subscribe processor (tag combine selected fields) to the combination processor with a wire and enter the definition of combineselect for the connection connect the datahub subscribe processor (tag combine all fields ) to the combination processor with a wire and enter a definition of combineall for the connection on the analytics canvas, click save the configured analytics flows should look like the following after completing either step 3a or step 3b step 4 view output of processor click the view icon in the combination processor to view combined field json strings on the analytics canvas view combined json string for selected fields the combination processor returns a json string with the fields combineselect tagname , combineselect value , combineall tagname , and combineall value view combined json string for all fields the combination processor returns the full json string with all the fields from both input processors