08-02-2010 09:37 AM
I have been playing around with using more subVI to string code together. I'm having a problem with a countdown timer Transferring out data to the front panel of the testing.vi. If I use a stop icon to stop the loop the data transfers as I expected. But when I use a notifier to stop both loops at the same time the data does not transfer to the front panel of the testing.vi. Is there an easy way to fix this problem, or do I have a more fundamental problem with choosing a poor design to complete my task?
Thank you
08-02-2010 11:11 AM
Hey Danny,
I don't really understand the architecture of your program. Is there a reason for using two parallel loops? It looks like they are not entirely necessary; why not just wrap everything into a single loop and there is no need for the notifier?
Matt
08-05-2010 01:08 PM
I may have a similar problem. In the past (LV 6) I used occurrences to coordinate a high-speed while loop (acquiring data from a DAQ card, performing a moving average filter, load averages into a global array) with a slower-speed while loop that inserts the global data into pre-allocated arrays, displays them, and manages slow-speed analog output operations.
Under LV 7 ( I know, I know...dated. But hey) this breaks. The slower loop runs way too fast, and somehow the initialization of the fast loop is unpredictable. I need to learn how to either implement notifiers or timed loops, and need some guidance.
Sounds a bit like Danny's problem...
Paul D
08-05-2010 01:51 PM
Hey Paul,
I understand the need in general for parallel loops (I run them myself on most my applications because I am usually running fairly high data rates), but in Danny's case the need is not immediately clear to me and I suspect I am missing something (i.e. the program is probably not complete).
That being said, I am still not fully understanding the problem: is the data transferred the data associated with the shared variable? If that is the case, it is unclear how it could not possibly be transferring correctly unless there is something wrong with the SV setup. Also, is the order of the wait in the top (consumer) loop supposed to just throttle the loop or is it supposed to have a specific order associated with it (i.e. wait 100 ms and then check the shared variable)? Either way the wait is not necessary - simply have the notifier timeout and get rid of sending a false notifier:
or Danny could use timed loops:
And finally - Danny, why are you using a shared variable? If there is no network connection and you are not trying to transmit data over a network, there seems to be no need for this; you could use a global variable if necessary, but there are other ways to rejigger the VI so that you don't need any of this, like this:
Anyway, these are just some thoughts.
Cheers, Matt
08-05-2010 02:36 PM
Matt,
My hardware is compact a field point system running real-time. My current code probably doesn't need to use shared variables, however I was under the impression that when programming for a real-time target shared variables were necessary to update information between the host VI and the real-time target as well as between sub-VI running on the real-time target. I'm not a programmer and my labView experience is limited so the help from the message board has always been very helpful and educational.
Thanks again.
08-05-2010 05:06 PM
AND...this has also been helpful for my application, though there are a number of structures (and the notifiers!) that are new to me. My LV experience started with 0.772 (!), but kind of trailed off after LV 6, so I have some homework ahead of me...
Paul D