LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Elapsed Time VI Problems

Solved!
Go to solution

Hello NI Friends, 

 

I'm having a problem with my "elapsed time" vi where it would not count up.

 

I'm using labview 8.0 

 

Here is what I'm trying to do in case I'm going doing the wrong path here.. 

 

I'm trying to reset my array values to default after a certain time period has passed. I tried using an invoke node to do that, but for some reason that didn't work. So I put everything in a case structure, and just put 0 constants for the indicators after my target time has reached, but now my elapsed time would not count up..

 

Please help! 

 

0 Kudos
Message 1 of 7
(7,316 Views)

You have an inner while loop that once it starts, never ends because of the False constant wired to the stop terminal.  The only way to end your VI is to hit the Abort button on the toolbar.  As a result, the outer while loop and the Elapsed Timer function inside of it only executes once since the outer while loop is never allowed to iterate again.

 

(If the inner while loop ever did manage to stop, then the outer while loop would be turned into the infinite loop due to the False on its conditional terminal and the VI would still need to be aborted.)

0 Kudos
Message 2 of 7
(7,314 Views)

So how would I fixed it?

 

 

I changed the inner while loop to a for loop and that didn't fix it either

0 Kudos
Message 3 of 7
(7,303 Views)

@RavensFan wrote:

You have an inner while loop that once it starts, never ends because of the False constant wired to the stop terminal.  The only way to end your VI is to hit the Abort button on the toolbar.  As a result, the outer while loop and the Elapsed Timer function inside of it only executes once since the outer while loop is never allowed to iterate again.

 

(If the inner while loop ever did manage to stop, then the outer while loop would be turned into the infinite loop due to the False on its conditional terminal and the VI would still need to be aborted.)


 I actually got it to work now by placing the the elapsed time in a sperate while loop. The value re-initialize to defualt with the invoke function, but they are still there as soon as the time starts...can you help with that?

0 Kudos
Message 4 of 7
(7,297 Views)

You still need to get rid of these infinite while loops.  The only way to stop your VI is to abort it.  As a result, your outer while loop with the False wired to the stop condition terminal is pointless.

 

Why not put the Elaspsed time Express VI in the same loop as the other code?

 

Why are you taking the elapsed time and comparing that to another value?  The Time Has Elapsed boolean that comes out of the Express VI does that for you already.

 

If you want the case structure to clear as soon as the VI starts, then have the condition for that case structure be when the Elapsed Time is True OR i=0 for the  while loop's iteration terminal.

 

I would recommend looking at the online LabVIEW tutorials
LabVIEW Introduction Course - Three Hours
LabVIEW Introduction Course - Six Hours

Message 5 of 7
(7,282 Views)
Solution
Accepted by topic author Aquaman89

it is really hard to understand exactly what you want...but I tried to give it a shot. Again, follow what RavensFan had suggested(besides they won the super bowl)..your architecture suggests that you need to do the online tuturials(granted, i tried not to alter your style/logic...but as suggested there are plenty of improvements that can be done here.)

 

Spoiler
Average exampleMOD_BD.png

 

Message 6 of 7
(7,258 Views)

@apok wrote:

it is really hard to understand exactly what you want...but I tried to give it a shot. Again, follow what RavensFan had suggested(besides they won the super bowl)..your architecture suggests that you need to do the online tuturials(granted, i tried not to alter your style/logic...but as suggested there are plenty of improvements that can be done here.)

 


 

Thanks that was exactly what I was trying to do. 

 

Forgive my architecture, this is just a preliminary program that I am working on.

 

What I'm ultimately trying to do is to log a pressure transducer measurement for 5 mins, and use that 5 min average as my baseline pressure. As my filter gets clogged the pressure would start increasing up to a certain point, eg. 40% increase, which would trigger some valves and a pump to clean the filter...then resest the valve positions and get another 5 min average of my pressure and use that as my new baseline..and so on...

 

So all I was trying to do is to write a much simpler less complicated program to see how I would do it before actually working on the main thing..

 

I appreciate the help Smiley Wink

0 Kudos
Message 7 of 7
(7,243 Views)