We have 8 fish gutting machines, and are to create a status page for them.
Each of these machines have an internal counter counting the number of fish passed through. I have set up this counting value as an SQL-tag and i have enabled history for it.
Now, i want to display the number of gutted fish for a given period of time (set by a date slider) in a bar chart.
For this i would need to return the difference between the highest value and the lowest value in the selected range for each machine.
I have tried creating a script module using the “system.tag.queryTagHistory”, but i am having two problems:
- When setting the return size of “system.tag.queryTagHistory” to “2” and the aggregation mode to “Min/Max”, this will return a random number of rows (and always more than two). Why?
- How do i pass the “DateTime”-format to the python date format?
Does anyone have example code for a similar application? Is there other / simpler ways of doing this?