04-17-2020 03:12 AM
Hello all,
i am working on a project and need some help. some backround: i have worked with labview, and made some event based programs, but now have a signal processing project. i have employed an very detailed producer consumer example, and modified it to my needs, but encountering some issues formulating a solution
i using a DAQmx to read pressure transducers that produce cyclic behavior. i have a few goals.
1. learn best practices in labview
2. extract time between peaks (amplitude will stay the same for the same session) but will change for a new subject.
attached is the main program and processing program. Please let me know how i can solve and improve the VI's
04-17-2020 06:10 AM
Hi evan,
@evan.l wrote:
attached is the main program and processing program. Please let me know how i can solve and improve the VI's
No, you did not attach some programs. All we got are two images of parts of your code…
First step to receive substantial help on your VIs is to attach the real VIs!
04-17-2020 07:08 AM
One of the glaring issues I am seeing is that the consumer should be in full control of the queue. Your producer should sent a sentinel of some sort through the queue to tell the consumer that no more data is coming. Then the consumer should destroy the queue when it is done.
You might also want to consider moving your consumer loops into subVIs to help organize your code a little better.
04-17-2020 08:53 AM
I agree with crossrulz that you want to use Sentinels to manage the Queue in Producer/Consumer.
Here's the idea:
Bob Schor
04-17-2020 10:42 AM
Hello Gerd,
I am also a newb in asking for help 🙂
attached is the mainvi and subVI
Thanks for the heads up.
04-23-2020 02:50 PM
Since I've kept this tab open for almost a week out of general interest, I guess it's time to respond.
No disagreement with prior comments. But very generally speaking, your code is mostly a pretty reasonable approach. Various kinds of cleanup and subvi's will help, but the essential architecture and distribution of responsibility checks out. (Keep in mind the advice from crossrulz to let the *consumers* be in charge of releasing/destroying the queues.)
-Kevin P