07-18-2018 05:59 AM
rakesh@labview wrote:
Yes I have.
But the problem is I have to use two VIs
not like the truth.
try again
07-18-2018 06:02 AM
Hi,
My problem is how to implement the producer consumer design pattern in 2 VIs.
One VI is producer and 2nd is consumer. How to implement this
07-18-2018 06:05 AM
rakesh@labview wrote:
Hi,
My problem is how to implement the producer consumer design pattern in 2 VIs.
One VI is producer and 2nd is consumer. How to implement this
You have a higher level VI that creates the queue. You then pass this queue reference into your two VIs. One of the VIs enqueues data. The other VI dequeues the data.
07-18-2018 04:42 PM
You can also create a named queue in both the vis to access the same queue.
07-18-2018 05:16 PM
rakesh@labview wrote:
Hi,
My problem is how to implement the producer consumer design pattern in 2 VIs.
One VI is producer and 2nd is consumer. How to implement this
Artem.SPb showed you how to do this. He used a Frame (so you could "see" what is inside) and called it "1st VI". That's the Producer. The Frame called "2nd VI" is the Consumer. Replace the Frames with Sub-VIs (having the same contents) and you'll have it.
One thing we ask (that you haven't done) is to see some of your code. One reason is that this tells us what version of LabVIEW you are using, which means we can tailor our response to your Version (if appropriate). It also gives us an idea how much LabVIEW experience you have, so we don't talk "over your head".
Bob Schor
07-18-2018 10:40 PM
Thanks a lot . Please find the attached VIs
07-18-2018 11:11 PM
Hi all
Thanks all. The producer consumer concept worked for me with named Queue.
I have one more requirement. Actually I want to acquire some data from Mutimeter, DAQ, oscilloscope etc, do some calculations and update the values in a Queue. Another VI has to save these data from Queue (each set)in text file. One more VI has to save these data in database also . That means database saving should happen parallely in another VI
So I have to implement a 3 level program. Please tell a solution
07-18-2018 11:14 PM
Just expand on what you have already done, ie, you need more loops and queues.
mcduff
07-19-2018 08:04 AM
I have several recommendations for your Design, with both the Producer and Consumer running as sub-VIs and the Main doing (almost) nothing except creating a Named Queue that it never uses.
Try this modification. I think you'll like it. Oh, one more thing -- it is very easy to create Icons (with the Icon Editor) for your sub-VIs. I suggest a simple full-size Box in which you put a 2 or 3-line Identifier ("Prod", "Cons") so you'll know what you look at the Top Level VI what those otherwise-anonymous boxes (sub-VIs) are supposed to be doing.
Bob Schor
07-23-2018 05:27 AM
Hi Bob,
The VIs that I have posted are just skeleton only. There are lot of other componets in it .I just posted to show how I am going to communicate between VIs parallely.