Getting metadata commands to loop at different rates
-
I have a couple of variables that must be continuously updated, but they must be updated at different rates and through different functions. I have been using a daemon.g file to run simple looping metadata commands based off of a custom linear-analog sensor for ease of data analysis, but I now require a way to run another simple set of commands over a longer period of time without largely impacting the speed of the current set of commands. Currently running on 3.5.1, and efforts made with M596 have been unsuccessful so far. I realize the duet system is still essentially a one stack system, I am just hoping for an quicker solution than incorporating extra computers or micro controllers that I have overlooked.
In other words, is there a a way to run two separate background while loops at different rates, either in a daemon file or some other method? Perhaps some creative queue meshing method? There are no macros included, all M-commands, one loop designed to run at half a second, the other ideally over a full second.
-
@Duet_Science_Application I wouldn't have thought you can use a second 'motion' queue for commands that are not motion commands. Maybe post your current daemon.g file, and what your specification for the data capture is.
Alternatively, if you don't need to analyse and act on the data in realtime, extract the data from Object Model at specific times via http requests and store it in a time-series database. We have shown a demo using RESTful API to capture data, recording to an InfluxDB time-series database, then queried the database using Grafana to graph the data.
Ian
-
@Duet_Science_Application said in Getting metadata commands to loop at different rates:
one loop designed to run at half a second, the other ideally over a full second.
Why not have a single loop that runs every half second, and within that have an if-command that executes its body on alternate iterations?