06-04-2013 12:58 PM
Hello all, I am using a producer/consumer event structure within a producer/consumer....not sure if this is the best approach. The main vi is setup to perform several different tests based on the user input. It does an initialize, setup, and read a pressure controller. The main vi continues to read the pressure controller until the user presses a button to perform a particular test. When the test is complete, it goes back to the main vi and monitors the pressure controller. The user can perform another test or stop the program operation. My question is......In the individual tests I use an enqueue element which sends it back to the monitor pressure controller in the main vi. Is this the best approach? THANKS in advance!
Alma
06-04-2013 04:32 PM
I'm guessing no, but can you post your code?
06-04-2013 05:23 PM
hope this helps main vi, below subvi
06-05-2013 08:43 AM
You can actually attache the .vi file to the forum posts. That is typically much more helpfull for a large area of code than a picture. This way I (and any of the other advice givers) can poke around it to see exactly what you are doing.
06-05-2013 02:32 PM
I was hoping the pictures would be enough info. Let me explain further..... The top pic is the main vi. The sub vi in the consumer loop of the main vi is pictured below. As you can see they are both Producer/Consumer design and in the sub vi (bottom right of pic) is where i send the enqueue element "monitor" back to the main vi to monitor the pressure controller in between tests. Hopefully this breif explaination will help. 🙂 I will try to post the vi tomorrow...not at work today. THANKS for the help!
06-05-2013 02:36 PM
So the subVI is a popup window? And nobody will be able to manipulate the main VI while the popup is there? If so, I don't see much wrong with this. But if you need to change things in the main VI while this subVI is running, it won't really work well since your main's consumer loop will not be iterating until the subVI is complete.
06-05-2013 03:06 PM
Yes, the subvi is a popup window and the main vi cannot be manipulated while the popup is there. Thanks for the advise. I just wanted to make sure that I wasn't getting out of hand with the use of producer/consumer design. I feel like I am still learning when it comes to producer/consumer design but I love it the code is much cleaner. Thanks, again! Any other input would be appreciated.