LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Elapse time express vi

I think I saw something like that the first time I tried to run your VI, but with the changes I had to make to get it to run, I was not sure.

 

Try disconnecting the "0" from the selector (False input) inside the case structure and wiring it to the select terminal. That should give you a 0,1,1,1,1,... state sequence.  Run that and see if it counts down. Then reconnect the "0" to the False input.  I recall doing something like this and it worked.

 

I suspect that something is wrong with the connection to the Select primitive, but it is often nearly impossible to detect such things.

 

I just downloaded another copy of your VI and only put a Diagram Disable structure around the missing subVI.  When I run it, I get "Starting pressure test" immediately, then Time remaining = 30, 24, 18, 12, 6, 0. About 3 seconds after it counts down to zero the Message becomes "Test was completed".  So everything seems to be working.

 

Lynn

0 Kudos
Message 21 of 42
(1,898 Views)

Hi Lynn,

 

Can you try and see if you could find out exactly what you did to get it to work. I just can't get the VI to count down. I've attached another copy of the VI so you can try it again.

 

Thanks

0 Kudos
Message 22 of 42
(1,873 Views)

Lynn,

 

I used a diagram disable structure to disable the pressure read subvi and my VI was able to countdown. Perhaps there is some setting in that subvi that is causing the problem. Thanks for the help.

0 Kudos
Message 23 of 42
(1,872 Views)

Post the Pressure Read subVI so we can take a look at that.

 

Lynn

0 Kudos
Message 24 of 42
(1,865 Views)

So im a newbie to Lab View...

I was introduced to NI through school a couple years back and have dabbled with labview here and there...

I was able to talk the complany into looking into there products more and seeing how we can integrate there technology into our products...

This project im working on is way bigger that the question im going to ask here right now... but since there is so little i know i figured if i could get some insight to how to do what exactly i looking to do its a step forward into the right direction lol...

 

anyways enough about me... lets get down to it...

 

i pulled this example file from the NI website about the Elapse Time Express VI here:

Elapsed Time Express VI

 

and i have added an attachment of my file with some minor changes implemented in order to function they way i am wanting it to...

 

after banging my head against the wall going back and for with making the code more complex and then less complex, i still wasnt getting what i wanted...

 

The Goal:

To have a user input a number that will control how long the timer runs for. during the run time i wanted an indicator showing how much time has elapsed. once the set time = the elapse time then the "run time complete" booleen is triggered indicating the treatment is done and also stopping the timer from counting. i also put in a a stop button that when pressed it stops and resets that timer untill it is pressed again.

 

The Problem:

after a couple cups of coffe and several cigeretts later i have come to the conclusion that the way this timer is working as intended. from what research i did from tutorials/forums/and literature NI had to offer i found that this is measuring "Elasped Time". so it is storing the start time, and calculating the elasped time based on the current time. as of right now when you run the program and the stop button is in theoff position, the timer start counting. when the elapse time = the set run time it stop that loop... and this is where it starts to get hazy for me... once that loop is stopped the outer loop is still running causeing the elapse time to continue to record elapse time every second. i want it to always show the elapse time but stop recording the time elapsed after the elapse time = set run time.

 

any and all suggestions are welcome, and maybe using this elapsed timer is not the best way to go about doing this project... but im tired of running around in circles (i know my lack of knowlege on understanding labview is contributing to my running around in circles) so im coming to you guys for help... be the asprin to my headache =P

 

0 Kudos
Message 25 of 42
(1,820 Views)

Hi AE3P,

 

I think you just need to reset the Elapsed Timer when you start the inner loop.

See the attachment (LabVIEW 2013).

 

I also put a small delay in the inner loop. You normally want to limit loop rates to reduce the load on the CPU.

 

steve

----------------------------------------------------------------------------------------------------------------
Founding (and only) member of AUITA - the Anti UI Thread Association.
----------------------------------------------------------------------------------------------------------------
Message 26 of 42
(1,800 Views)

Thanks for getting back to me so soon stevem...

I open you file and saw your corrections... i love how you make it all clean lol (something that comes in time i guess)

but unfortuantly it was still resetting after the elapse time reached the set time...

I wanted to have it retain the elapse time even after the elapse time = set time untill it was manually reset. =(

I did keep some of you ideas though =P

 

here is what i cam up with and it seems to be working they way i wanted it to... lemme know what you think! =D

 

 

0 Kudos
Message 27 of 42
(1,783 Views)

Very good! I'm glad you were able to get it working the way you wanted.

 

Just a note to you and people that may read this thread in the future:

 

It is not very hard to create your own Elapsed Time Function.

 

All you need is a way to store the Start Time (like a Shift Register) and then you just check the Current Time against the Start Time.

 

Attached is your last version with a homemade ET function.

 

steve

 

 

----------------------------------------------------------------------------------------------------------------
Founding (and only) member of AUITA - the Anti UI Thread Association.
----------------------------------------------------------------------------------------------------------------
Message 28 of 42
(1,768 Views)

I see what you did there Steve...

 

Stop Condition:

Start Time = Current Time when i=0(or inner loop is stopped)

 

Start Condition:

when i /=0 Current Time is stored and looped thorugh the shift register (now becomming the Start Time) to be calculated against the Current Time...

 

i love it and glad you took some time to give me an alternate way... assuming my explaination of your diagram is correct, i think im getting a basic understanding of Lab View in general... ty ty

 

i do have another question though =P

 

This aaplication looks great and works on paper... but im assuming it is grabbing the current time from my computer's current time right? if i wanted to put this on my compactRIO board to test it... do you know if there is a clock or something on that to use as a reference? maybe this is not the right thread for that question... either way THANKs for all the help! 😃

0 Kudos
Message 29 of 42
(1,747 Views)

Hi AEP3,

 

Yes you got it!

 

If you are running LabVIEW Real Time on your cRIO board you can use the "Elapsed Time" Express vi or the "Get Date/Time in Seconds" function just like on your PC.

 

If you have any problems on the cRIO, it would be good to start a new thread.

 

Cheers,

steve

----------------------------------------------------------------------------------------------------------------
Founding (and only) member of AUITA - the Anti UI Thread Association.
----------------------------------------------------------------------------------------------------------------
0 Kudos
Message 30 of 42
(1,716 Views)