LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Time Elapsed in Flat Sequence Frames

Solved!
Go to solution

I have attached a simplified VI file of what I am trying to do. Ideally, this program will start when "OK" is pressed and run through the frames (or steps) for the times given as the wait times. The program then would reset. This will be meant to time experimental steps eventually with settings output to equipment. I would like to be able to have a live timer for each step to either count down (ideally) or give elapsed time. I have tried different variations, but nothing seems to give me a live timer like I am looking for.

 

While this timer is not completely necessary, it would be nice to know where the experiment is for the up to 50 hour experiments that we will be running.

 

I am very new to LabVIEW, so please excuse the simplicity of the solution that this likely requires.

0 Kudos
Message 1 of 4
(3,608 Views)

You're going to need some more loops in order to have a live count. There's a VI called Elapsed Time that literally just outputs the elapsed time and also has some timer functionality. You could use that VI along with a while loop to get what you want.

 

You should look in to the State Machine architecture. It sounds like it will be ideal for your application.

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


0 Kudos
Message 2 of 4
(3,588 Views)
Solution
Accepted by topic author RWalker

As a simple state machine, this is trivial. See if the attached VI can give you some ideas.

 

Note that since this is a state machine...

  • it can be stopped at any time. If you only allow stopping in the idle case, don't wire across the other cases. 😉
  • No local variables!
  • No loops inside loops!
  • No sequences!
  • One single array of clusters defining state specific information in one place. Nothing scattered over several locations.
  • All timer states re-use the same code, just with two values different (state and desired time).
  • For more complicated scenarios, you can add more state flavors.
  • Note that I use the output of the wait for the ms tick. (you could also use the tick count, but that would need a seperate wait)
  • Simple, scalable and expandable code. Just add items to the enum and add corresponding cases.
  • modify as needed.

 

 

Message 3 of 4
(3,533 Views)

That is what I needed. Is there a way to have the time as being dependend on a radio button option?

 

EDIT:

Nevermind, I think I figured it out.

0 Kudos
Message 4 of 4
(3,447 Views)