How-To Guides
Analytics Guides
Use the Simple Window Function
6min
you can use the simple window function to output a simple moving window in the fifo (first in, first out) algorithm, the first data point that enters the window is the first to be processed and removed as new data points come in this function takes a single value as inputs user scenario review the following scenario for the simple window function then, you will simulate plc data and calculate the trend in the data in a manufacturing setting, the simple window function is used to analyze the real time performance of a specific machine component as new data points representing the component's performance are generated, the simple window function processes the data in a fifo (first in, first out) manner, allowing the engineers to monitor the immediate impact of any changes or adjustments made to the component this helps in quick identification of any anomalies or deviations from expected performance, facilitating timely maintenance or intervention step 1 add a device follow the steps to connect a device docid\ ish7bqhzxswtdx8vbnszb 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 tag see add tags docid\ xgwokqbtpevii7or82ll0 to learn more tag 1 input1 name select s random value generator value type select float64 polling interval enter 1 tag name enter input1 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 simple window processor function in litmus edge, 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 input1 tag click save click add processor again and select the simple window processor the edit a processor dialog box appears value type this parameter specifies the type of incoming value for example, if our input1 tag generates float64 values and we want int values for our window, we can select int from the drop down menu order this parameter specifies the desired order of output window oldest > newest newest > oldest window size this parameter specifies the window in which the values will be observed click save connect the datahub subscribe processor (tag input1 ) to the simple window 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 simple window processor to view the output values the output shows a window of size 10 holding the incoming values from our input1 tag