01-06-2012 07:55 AM
I usually use two queues (one in each direction) for communication with my modules. In general, each module/loop has a dedicated queue to send commands/data to it, and uses a shared queue for communication with the main application/loop. Using many queues is not a memory problem, as long as the consumer is keeping up with the producer.
There are probably as many ways to deal with multiple queues as there are LabVIEW large application programmers. Rather than give you one method, I will refer you to the Large Application group in the LabVIEW community. There is a plethora of advice and examples there for exactly this type of problem.
I would probably use LabVIEW classes for your queue elements instead of clusters, and you seem to be at the point to take advantage of this. Check out the tutorials at the above link and repost if you have further questions.
01-06-2012 10:37 AM
Thanks for your reply. There is plenty of advice I can feed on 🙂
I do not know why I did not think of clusters for my queues ... it's so obvious and much simpler than my (dumb) approach 🙂 Now, classes are different class all together. I'll have to look into that. I originally started with two queues as well but it quickly grew. My experience now (looking back) that it's a bit easier to implement, but harder to expand later on. So my approach (with multiple queues) kind of defeats the original purpose of this all exercise to improve expandability and modular approach.
There are some excellent posts in the link you provided ... so much to read 🙂
Cheers,
Radovan
10-13-2012 02:21 AM - edited 10-13-2012 02:23 AM
HI,
I am also facing same problem. What i did to see the working of reentrant is.
1. Create 1 master Vi by name master.vi
2. Create 1 slave VI by name slave.vi
3. Enable the reentrant in slave VI.
I added one 10 sec delay in the slave VI to see the creation of clone inbetween slave is running.
As i run master.vi & calling slave.vi than clone is created but after completion of first called than only second clone with same name is created with name clone, but the data which i am passing from master is updated.
Can any of you please tell me that how can i load multiple front panel for same subvi with each doing seperate work assigned (i..e. add two number sent from master.vi)...
10-15-2012 10:11 AM
Hey Ranjeet_Singh!
First off, I would like a little more information about your program so there is better understanding on how to address your problem. What exactly are you trying to accomplish with your master/slave VI setup. What kind of data are you trying to pass around?
Just to help get you started, try checking out this article on opening multiple instances of a VI
https://decibel.ni.com/content/docs/DOC-5598
Keep us posted on how that works for you!
Regards,
10-15-2012 10:52 PM
Hi MaesterSid,
Although my application is big which gonna need this reentrancy. To illustrate this i wrote two very simple basic program called master.vi & slave.vi...
i just want to acheive that as soon as user presses add from master.vi by entering different value from master front panel. The slave should add the value & present to output.. Can you please go here & take a look at my code.
Till that time i will check ur code.
10-15-2012 10:59 PM
Hey friend MaesterSid,
The main problem with this code is we are fixing the number of instances. But in my application this wlll be depeneds on number of elements in a queue.
Second thing if i run my VI like this than i wont be able to pass the values. check this out.
Just go for the property of invoke node runVI.
10-16-2012 12:43 PM
Hi Ranjeet_Singh,
It looks like you have your own thread running in the forums on this particular issue. Instead of trying to work in two areas on finding a solution I suggest we focus our support on the thread you linked here. Older threads will not see as much visibility to the most recent discussions. You will find you will get a lot more community support from newer topics as well. It looks like you have some good suggestions from the members of the community to work off of and I would definitely suggest looking into their recommendations.
Regards,
10-16-2012 10:51 PM
Hi james,
Can you please elaborate which solution you are telling. Synchronous & asynchronous ?
10-17-2012 02:33 PM
It looks like some others have posted to elaborate on this particular answer in the other discussion forum you created for this issue. Please refer to their advice to see if that will help you out.
http://forums.ni.com/t5/LabVIEW/instances/m-p/2186966/highlight/false#M701888
Regards,