07-16-2019 08:56 AM
Hello everyone, I am newbie using LabView. In my company I'm working on project that acqusition pressure value and depend on its value, trying control DC motor speed. I did my project vi according to producer & consumer loop design pattern. I just want advices or points that I made mistakes. (Several times I tried algorithm in somepoints,motor rpm changes is observed .) For your check, I attached the project file.
Waiting for your replys. Thank you so much.
07-30-2019 11:46 AM
Hi deanmonnn,
From the start, I noticed that you are using the DAQ Assistant Express VI in your loop. While this is the simplest way to do data acquisition, it's not recommended for use in a loop because it can make that timing highly variable. If you can, take a loop under Help>>Find Examples... at Hardware Input and Output>DAQmx. The continuous examples use the DAQmx API in a way that is designed for use in a loop.
In addition, a producer consumer design pattern is not necessarily what you need here. The queue in this design pattern servers as a FIFO buffer, so it could take much longer to see the changes in the producer reflected in the consumer, if these are running at different rates. Most likely, you can get away with using just one loop for both tasks, or you would want to switch out the queue for some type of tag data (local variables, etc.)
Best of luck,