LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Stoping Master Counter over Slave Counters

Hi Guys

I am trying to create a Master Counter that will count till 20 seconds and two individual Slave Counters (one counts for 5 seconds and other counts for 3 seconds). My goal is to monitor the Master Counter throughout the VI and whenever it reaches the count of 20 it should stop the entire VI. Problem that I am having is that the two Slave counters are operating correctly however whenever Master counter reaches the count 20 it starts form the beginning without stoping the Master counter.

I have attached my VI and I would really appreciate if someone could help me with this issue. I also would like to accomplish this using only the while loops like it is presented in the VI.
0 Kudos
Message 1 of 7
(3,055 Views)
Hi,
Please explain what you end goal is.  There might be a better way to accomplish what you are trying to do.  Also, the VI you posted is missing some sub VIs.  It is hard to tell how things are supposed to work without these.  You might look at using the time elapsed VI is you are not already using it.  That is what I have used when building applications similar to what you are describing.
Eric A.
National Instruments
Distributed I/O Product Support Engineer
0 Kudos
Message 2 of 7
(3,026 Views)
Hi Guys

I am  very sorry that I did not include my SubVI. Again my main goal is that whenever the master counter reaches 20 seconds it should stop the entire VI.. Two Slave counters  are present as well one counts for 5 seconds and the other one counts for 3 seconds. The Slave counters are operating properly only the master counter doesn't  want to stop once it reaches 20 second period.

Again I am very sorry for the inconvinience of not including my SubVI.
I have attached my SubVI and I would be very thankful if someone could help me with this issue. I also would like to accomplish this using only the while loops like it is presented in the VI.

Thanks million times

0 Kudos
Message 3 of 7
(3,012 Views)
Hi,
There is probably a simpler way to do this.  What are you trying to control with these loops and do you want the 3 and 5 second loops to only run once?  If I get a better idea of your finel goal I might be able to write a  simple piece of code to help.
Eric A.
National Instruments
Distributed I/O Product Support Engineer
0 Kudos
Message 4 of 7
(2,989 Views)
I have a product that needs to be "burned" in the burn chamber for 38 hrs. During those 38 hr period the power on the product gets turned on every 30 min and it gets turned off every 70 min so one cycle is 100 minutes long. These 100 min long cycles repeat themselves for the entire burn period of 38 hours.

In my VI I have my master loop that counts till 20 seconds, this particular loop should be a representation of the entire burn period which is 38 hrs.
The other two slave loops, which I made up to be 5 and 3 seconds long, are actually representations of my TIME ON period (30 min) and TIME OFF period (70 min).

So I should be able to monitor the slave loops to repeat themselves for the period that is set on the master counter. So lets say I set my counter instead to be 20 seconds I set it to be 120 seconds and my slave loops are 5 and 3 seconds long. So now I should expect my slave loops to repeat themselves for the period of 120 seconds however once the master counter reaches 120 seconds it should terminate the whole VI.

I hope I was a little bit more clear with this post.

Again I really appreciate that you guys take your time and help me out.

Thanks million times
0 Kudos
Message 5 of 7
(2,982 Views)
HI,
I wrote this very simple piece of code to display one way of accomplishing this.  Please review and comment.  I am not as familiar with the problem but I do want to know why an approach similar to this couldn't be used.
Eric A.
National Instruments
Distributed I/O Product Support Engineer
0 Kudos
Message 6 of 7
(2,958 Views)
Hi

First thank you very much of helping me out. I did analyze the code and there are few things that are conflicting.

1. If the master loop is represented by the for loop where are the two slave loops??
2. Two delays are represented but I would like to monitor both the count of the master loop and the slave loop.
3. I also think that it is kind of hard to terminate the loop if there are delays involved, so lets say in the code there was a delay of 4 seconds but if the process needs to stop at 3 seconds how could we exit out of the delay.

So there are few things conflicting but I think that I have managed to create the VI for the particular application. I will admit that this application is kind of hard to explain, but with your help and the help of NI-forum I was able to  complete the project.

Thank you
0 Kudos
Message 7 of 7
(2,950 Views)