How-To Guides
Analytics Guides
Use the Rise and Fall Function
13min
you can use the rise and fall function to calculate the difference in upper and lower thresholds between consecutive values from the plcs understanding different rise and fall functions use one of the following functions for your inputs rise once you enter a lower and upper threshold, this function will show you the timestamp at which the current value starts to rise from the upper threshold fall once you enter a lower and upper threshold, this function will show you the timestamp at which the current value starts to fall from the lower threshold riseandfall once you enter a lower and upper threshold, this function will show you the timestamp at which the current value starts to rise from the upper threshold and fall from the lower threshold user scenario review the following scenario for the rise and fall processor function then, you will simulate plc data and calculate kpis using a single input processor function suppose you are monitoring a manufacturing process where a motor's temperature is being recorded by a plc you want to know when the temperature rises above 80 degrees celsius and when it falls below 70 degrees celsius using the riseandfall function with the appropriate thresholds, you can get the exact timestamps when the temperature rises above 80 degrees and falls below 70 degrees this information can help you optimize the process and prevent any potential issues 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 tag 1 temperature name select s random value generator value type select float64 polling interval enter 5 tag name enter temperature min value enter 60 max value enter 90 step 3 create analytics flows you can now create the analytics flows using data from the device and tag you previously created to create an analytics flow with the rise and fall 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 temperature tag click save step 3a configure rise kpi click add processor again and select rise and fall processor the following information defines this function\ v kpi select rise tolerance enter a value to determine the range of values considered acceptable upper enter 80 for upper threshold value lower enter 70 for lower threshold value click save connect the datahub subscribe processor (tag temperature ) to the rise and fall processor with a wire and use the events connection on the analytics canvas, click save the configured analytics flows should look like the following step 3b configure fall kpi click add processor again and select rise and fall processor the following information defines this function kpi select fall tolerance enter a value to determine the range of values considered acceptable upper enter 80 for upper threshold value lower enter 70 for lower threshold value click save connect the datahub subscribe processor (tag temperature ) to the rise and fall processor with a wire and use the events connection on the analytics canvas, click save the configured analytics flows should look like the following step 3c configure riseandfall kpi click add processor again and select rise and fall processor the following information defines this function\ v kpi select riseandfall tolerance enter a value to determine the range of values considered acceptable upper enter 80 for upper threshold value lower enter 70 for lower threshold value click save connect the datahub subscribe processor (tag temperature ) to the rise and fall processor with a wire and use the events 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 rise and fall processor to view the output values view rise kpi output as the generated value is 85 , which is more than the upper threshold, the output shows the riseend , risestart and risetime fields view fall kpi output as the generated value is 67 , which is less than the lower threshold, the output shows the fallend , fallstart and falltime fields view riseandfall kpi output after generating values falling outside the lower and upper thresholds, the corresponding fields are displayed