with PageUp/Down StepUp/Down you can navigate in all circular buffer and store the latest entry when you export the data.
Based on a timer/new alarm you trigger your search on the buffer, if that “latest entry“ is no more in the buffer you have found the condition to export again your data.
If you think: “Good, ready to implement that…” well be sure to test your implementation on real hw and monitor CPU usage with SDM.
We faced the same challenge a few years ago and did exactly as @valerio.manenti
suggested.
However, with this implementation, we have unpleasant utilization peaks caused by the HistoryUI module, especially when the history is “full.”
In addition, you have to be careful that no alarms are lost when too many alarms are added within one cycle of the timer.
So it is inevitable to export “too early” to avoid loosing alarms, but this causes some alarms to be exported twice.
For these reasons, we switched to a solution with two queries, which is basically an SQL query.
This has enabled us to significantly reduce the utilization peaks:
(On the left is the implementation with HistoryUI, on the right with queries and manual writing of the file) and also avoid the duplication issues.
Thanks so much @PatrickS for sharing your smart idea + code + traces.
You already spent time on writing your answer, but I would like to ask you a favor, when you have time,: “Could you create a post for this topic on ‘Share info & Ideas’?“
Hi @Jurg_Heiniger , Could you mark the Patrick’s answer as a solution? Query feature was not ready at the beginning when R&D has released mapp Services,
they developed that as Patrick showed us for improving the performance on our system.
@alexander.hefner also deserves a special mention here.
He came up with the idea, or rather gave us the idea, when he was still our contact at B&R months ago.