06-03-2014 08:10 PM
As an example, I am trying to stop and restart a loop from a parallel loop, as per the example below.
What I am trying to achieve is the bottom loop to stop and then restart the top loop using a notifier.
In the below, I can stop the loop, but can't restart it. What am I doing wrong?
Solved! Go to Solution.
06-03-2014 09:15 PM - edited 06-03-2014 09:18 PM
This is simply a case of dataflow misunderstanding. First of all, if you want to be able to see the messages passing from one loop to another then they need to be wired the same notifier from a notifier initialisation. At the moment you have 2 initialisers working like 2 parallel train tracks, one can't really affect the other. Otherwise it should work.
[EDIT] I forgot to mention, Numeric is never going to get above 0 - 1 depending on your time out, the loop will be reset everytime your notifier fails to arrive and the wait times out. I'm not sure if this is what you wanted but it doesnt seem particularly informative.
06-03-2014 09:29 PM
okay, I named the notifiers (I assumed unamed notifiers would be okay), and now the notifications work.
but why does the top loop also run at 1s period, even though I have set it to 0.1s period?
06-03-2014 09:40 PM
Because it will sit waiting indefinitely at wait until notification recieves a notification. The notifications are only sent every 10th cycle from the sender loop. This means that every 10 * 0.1s = 1s there is a new notification received allowing the receiver loop to progress.
06-03-2014 11:47 PM
I removed the wait notification on the wait on notification and it basically does what I am after.
is this the best way to do what I am after, restart a loop at a set period? or is these a better way to achieve this?
06-04-2014 06:35 AM
hydzik wrote:
is this the best way to do what I am after, restart a loop at a set period? or is these a better way to achieve this?
What are you actually trying to do with this? Why do you need to restart the loop?
06-04-2014 06:44 AM
I am performing some data aquisition and I am finding that sometimes the daq hangs, I would like to restart the loop including reitialiasing the modules periodically.
06-04-2014 06:57 AM
@hydzik wrote:
I am performing some data aquisition and I am finding that sometimes the daq hangs, I would like to restart the loop including reitialiasing the modules periodically.
I have had DAQs run for days without stop. I'd say you have an issue with that somewhere. What DAQ are you using? What else are you doing in that loop besides reading your DAQ? Can you share any code?
06-04-2014 07:07 AM
I am using a USB-1208FS, which isn't a NI product.
I am running it for a few days at 15ms period, but sometimes the data hangs, while the loop continues.
I would like to restart it a midnight every night.
can you please advise if the above method is the best approach?
06-04-2014 07:12 AM
If your loop continues, why not just do a time check in that data acquisition loop? If the time expires, stop and let the outter loop reset everything.
Another thing to be aware of, since you are using USB, make sure your power settings for the bus is for Windows to never shut down the USB hub power. By default, Windows has this "power saving" feature set to turn off the USB hub if it doesn't certain activity. That might be what is causing your DAQ to hang.