01-21-2015 06:48 AM
Hello,
My problem is that I need to read data from up to 28 tests, and the acquisitions start at different times for each test, and I must read the data at different rates. I also need to show the data and save in a MySQL database. And if the acquisition is out of the standard for the test, I must stop that acquisition. Any ideas of design patterns? I thought that could be possible to do thar using multiple loops, and communicate with the main loop using global variables, is that correct?
Thanks,
Solved! Go to Solution.
01-21-2015 06:59 AM
You do want multiple loops here. But global variables are not the way to do the communications.
It looks like you have alreay done a good job of figuring out which tasks you have. All of those could be in a seperate loop. Have a loop for each test, a loop for the saving to the database, possibly another loop for checking your limits. Use Queues to do the communications between the loops. You will need a different queue for each parallel process, but then anybody can send the command to anything.
I recommend having a look at the Continuous Measurement and Logging sample project.