How-To Guides
Analytics Guides

Use the Base Conversion Function

11min
base conversion is the process of converting a number from one numeral system to another you have the following base conversion options decimal > binary decimal > hexadecimal decimal > octadecimal binary > decimal octadecimal > decimal hexadecimal > decimal notes for conversion of various units to decimal, it is expected that the input is a string value your input needs to have a field named value if you are converting from binary, octadecimal, or hexadecimal to decimal user scenario review the following user scenario for using the base conversion processor in manufacturing plants, engineers need to work with machines that use different protocols if a machine produces diagnostic data in one type of format, and the monitoring software requires decimal format for analysis, the base conversion function can convert the data quickly this allows for seamless integration between the machine and the monitoring system for this guide, you will simulate data coming from a plc and generate the decimal values 200, 300, and 400 you will then convert them accordingly using base conversion 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 tags docid\ h5heqicxrcy3nch9kbg9i to the device create the following tags tag 1 name select s random value generator value type select int64 polling interval enter 5 tag name enter tag 1 min value enter 200 max value enter 200 tag 2 name select s random value generator value type select int64 polling interval enter 5 tag name enter tag 2 min value enter 300 max value enter 300 tag 3 name select s random value generator value type select int64 polling interval enter 5 tag name enter tag 3 min value enter 400 max value enter 400 step 3 create analytics flows you can now create the analytics flows using data from the device and tags you previously created to create the analytics flow navigate to analytics on the analytics canvas, click add processor the create a processor dialog displays on the analytics canvas, click add processor the create a processor dialog 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 tag 1 click save click add processor again and select base conversion in the conversion field, make sure the default value decimal > binary is selected, and click save connect the two processors, select events , and enter a definition of tag1 for the connection repeat steps 2 8 for tag 2 and configure the following in the datahub subscribe processor, select the alias topic for tag 2 in the base conversion processor, select a conversion of decimal > hexadecimal when you connect the two processors, select events and enter a definition of tag2 for the connection repeat steps 2 8 for tag 3 and configure the following in the datahub subscribe processor, select the alias topic for tag 3 in the base conversion processor, select a conversion of decimal > octadecimal when you connect the two processors, select events and enter a definition of tag3 for the connection on the analytics canvas, click save the configured analytics flows should look like the following step 4 view base conversion data you can view data on the analytics canvas by clicking the view icon in each base conversion processor base conversion data for tag 1 the original decimal value of 200 is converted to a binary value of 11001000 base conversion data for tag 2 the original decimal value of 300 is converted to a hexadecimal value of 12c base conversion data for tag 3 the original decimal value of 400 is converted to a octadecimal value of 620