08-20-2012 05:59 PM
Hi guys , this may be very basic question but couldnt able to find the solution ,,,
i have Main Vi and a sub Vi ,, in which my main vi produces a random data and send it to the subvi . Here i want to open the window of subvi permenently i meant if i click display window button ,, only the value has to get update,, but in the attached example every time the screen blinks becoz of the reason everytime is called ,, i have even tried passing the random values using one more queue and read it in the subvi ,,,nthng works ,,,thanks in advance ,,
john
Solved! Go to Solution.
08-20-2012 07:06 PM
You have changed the design pattern. You are doing the dequeue before the while loop starts. Here is the flow of your code.
Do these steps
08-20-2012 07:14 PM
Hi John,
One of the causes of the blinking is that the sub vi's property was set to "Close afterwards if originally closed".
Even if you set the "SubVI Node Setup..." to "Close afterwards if originally closed".
Both places must be set correctly.
I made a few other mods. See if this is what you wanted.
steve
08-21-2012 02:30 AM
Hi steve ,, thanks for the prompt reply .. this is what i have expected to do ...
An other small question , i have made the same logic with Queues(loading the value in Main.vi and reading in subvi) , Notifiers(loading the value in Main.vi and reading in subvi).. whats the big difference , do i have some influence becoz of this in my program.. i mean parallel processing in main loop.
I have this doubt becoz later i have three to four consumer loops in my Main program ,, each has to be working parallely i.e. data acqusition , logging etc......
reagrds
John
08-21-2012 02:36 AM
Hi anand, thanks for ur reply.. U r right regarding the consumer loop ,,, i have modified it using a shift register ,, so i can change between other states
but i didnt understand when u tell keep the queue inside the while loop ,, why should i do like this ? can you explain bit further ?
meanwhile i have tried the steves idea ,, it was working fine and i posted another simple question reagrdng the use of queues and notifiers...
regards
john
08-21-2012 10:20 AM
@john_new wrote:
Hi anand, thanks for ur reply.. U r right regarding the consumer loop ,,, i have modified it using a shift register ,, so i can change between other states
but i didnt understand when u tell keep the queue inside the while loop ,, why should i do like this ? can you explain bit further ?
meanwhile i have tried the steves idea ,, it was working fine and i posted another simple question reagrdng the use of queues and notifiers...
regards
john
I mean to say the consumer loop dequeue should be inside the while loop if it is outside it gets only once.
08-22-2012 01:01 AM
Hi John,
-----------------------------------------------------
An other small question , i have made the same logic with Queues(loading the value in Main.vi and reading in subvi) , Notifiers(loading the value in Main.vi and reading in subvi).. whats the big difference , do i have some influence becoz of this in my program.. i mean parallel processing in main loop
-----------------------------------------------------
I can't look at your new vis (haven't installed 2012 yet), but I will give my opinion on queues versus notifiers.
Unlike queues, notifiers do not buffer data. If no one is listening - the data is lost.
Let's say, for example, that you are receiving data from a notifier in a data processing routine.
If the data processing routine does not complete before the next notification occurs, the new data is gone.
With a queue, the data would be there waiting for you.
In general, I would use queues to send data that might require buffering.
Notifiers are useful for sending control info (which might include data) or to synchronize operations.
I hope this helps,
steve
08-23-2012 02:12 PM
Hi Steve ,
Thanks for your reply ,, now i am clarified about Queue and notifiers but as i have already asked ,, ist possible to pass the queues from main vi to sub vi ,, i mean passing the acquistion value from main vi to sub vi ,,,,,
08-23-2012 02:17 PM
@john_new wrote:
Hi Steve ,
Thanks for your reply ,, now i am clarified about Queue and notifiers but as i have already asked ,, ist possible to pass the queues from main vi to sub vi ,, i mean passing the acquistion value from main vi to sub vi ,,,,,
If I understand you correctly yes. That is exactly what queues/notifiers are use for. You can wire the queue reference into the subVI or you can use named queues and have the subVI obtain the queue by name. Once you have the queue reference you can post (enqueue) or read (dequeue) data from the queue. When using queues only one task should ever dequeue data.
08-23-2012 07:56 PM - edited 08-23-2012 07:57 PM
@Mark_Yedinak wrote:
@john_new wrote:
Hi Steve ,
Thanks for your reply ,, now i am clarified about Queue and notifiers but as i have already asked ,, ist possible to pass the queues from main vi to sub vi ,, i mean passing the acquistion value from main vi to sub vi ,,,,,
If I understand you correctly yes. That is exactly what queues/notifiers are use for. You can wire the queue reference into the subVI or you can use named queues and have the subVI obtain the queue by name. Once you have the queue reference you can post (enqueue) or read (dequeue) data from the queue. When using queues only one task should ever dequeue data.
Additionally I would maintain the queue reference into an LV2G or an AE and use it in the sub vi so that you can reduce the wiring and also you can use it in many sub vi's. If you have more number of queues you can maintain them in LV2G in the form of a cluster.