LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

stop/start loop from another parallel loop

Solved!
Go to solution

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?

stop start loop from parallel loop.png

0 Kudos
Message 1 of 11
(2,875 Views)

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.

0 Kudos
Message 2 of 11
(2,850 Views)

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?

 

stop start loop from parallel loop 2.png

0 Kudos
Message 3 of 11
(2,842 Views)

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.

0 Kudos
Message 4 of 11
(2,838 Views)

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?

 

stop start loop from parallel loop 3.png

0 Kudos
Message 5 of 11
(2,822 Views)

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?


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 6 of 11
(2,793 Views)

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.

0 Kudos
Message 7 of 11
(2,790 Views)

@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?


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 8 of 11
(2,786 Views)

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?

0 Kudos
Message 9 of 11
(2,781 Views)
Solution
Accepted by topic author hydzik

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.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 10 of 11
(2,778 Views)