To improve temperature monitoring efficiency, an FFL is utilized to continuously update an array with temperature values every second. The array stores 60 values, which are then averaged to create a 1-minute rolling average. After the FFL task is completed, the option to reset the array position to zero using a reset bit or a MOV function is available. If you know of a simpler method to achieve this, please share.
Utilize FFU to reset the entire array to zero, effectively clearing the .DN bit. The subsequent FFL instruction will then store data at the specified .POS location.
Cheeseface suggested utilizing FFU to move all array elements closer to zero, effectively clearing .DN. Subsequently, the next FFL operation will place data at .POS. It appears that in your situation, the destination may not be necessary. Consider utilizing a dummy tag to discard it instead. Another option is to use the FIFO.DN bit as a trigger for the FFU, ensuring it fills up before beginning the unloading process.
In my press project, I am utilizing an FFL/FFU pair to manage specific tasks such as stop time tracking and alarm history. Initially, I rely on the FFL until the DN bit becomes true, at which point I switch to the FFU for further operations. This strategic approach enhances efficiency and workflow management in the project.
Incorporating an FFL to store temperature data every second in a 60-value array, then calculating a 1-minute rolling average from those values. Is it possible to reset the array position back to zero using a reset bit or must a MOV function be used instead? If there is a simpler method to achieve this, please offer suggestions. Both options are viable, but caution is needed when utilizing the reset instruction to ensure it does not interfere with the timing of the FFL operation. It is important to note that resetting the array position may affect the accuracy of the rolling average calculation. To maintain a true rolling average, consider implementing an FFU trigger before the FFL for each one-second interval, along with recalculating the average continuously. Alternatively, the MAVE instruction could be used for a moving average calculation without additional complexity. For further information on FFL logic and potential bugs, refer to the provided link.
In response to a question about resetting instructions, drbitboy suggested using the MOV or CLR instruction instead of the reset instruction to avoid potential issues with clearing the .EN bit. When setting up a FIFO logic, it is important to consider the timing of triggers to ensure accurate results. Resetting the .POS to zero will result in a 1-minute average, not a rolling average. To calculate a rolling average, it is necessary to trigger an FFU before the FFL at each one-second interval and recalculate the average. Alternatively, the MAVE instruction can be used to simplify the process. This solution addresses a common need for maintaining a rolling average.
I prefer using a circular buffer for this type of task. In this approach, you don't have to reset the buffer or shift around any data. You just set your index back to zero once you've reached the end of the buffer. This provides the same rolling average without adding the complexity of a MOV function or reset bit. With this approach, your code can be faster and more efficient.
Actually, a simpler approach could be using a circular buffer or ring buffer data structure. What makes it unique from a typical array is that when it's 'full', it starts overwriting from the beginning, giving a 'rolling' experience without the need to reset. You simply take an average of the entire buffer every second to get your rolling average. This way, you don't have to deal with resetting the array position every minute, as the circular buffer naturally overwrites old data as new data comes in.
✅ Work Order Management
✅ Asset Tracking
✅ Preventive Maintenance
✅ Inspection Report
We have received your information. We will share Schedule Demo details on your Mail Id.
Answer: The FFL continuously updates an array with temperature values every second, which allows for real-time data collection and processing, leading to more accurate and timely temperature monitoring.
Answer: The system stores 60 temperature values in an array and averages these values to create a 1-minute rolling average, providing a smoother representation of temperature trends over time.
Answer: The reset function, which can be triggered using a reset bit or a MOV function, allows the system to clear the array position back to zero after completing the FFL task, ensuring that new temperature values can be recorded and averaged effectively.
Answer: If you are aware of a simpler or more efficient method to reset the array position to zero after completing the temperature monitoring task, the discussion welcomes suggestions for alternative approaches.
Join hundreds of satisfied customers who have transformed their maintenance processes.
Sign up today and start optimizing your workflow.