LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

controlled timer

I need to install a timer that will allow the user to: choose with a control how long they want that program to run for and go onto the next when the timer has ended.

 

I have a case structure with 3 cases and so I don't want to be using a while loop.

 

thanks!

0 Kudos
Message 1 of 16
(3,372 Views)

Any program this is going to run for awhile is going to need a "while" loop.  So I don't understand your statement "so I don't want to be using a while loop".

 

Please attach your VI.

 

Is it related to this thread?  skipping first step of array.

 

If is as heavily related to that thread as I think it is, then I suggest sticking to that thread with your question.

0 Kudos
Message 2 of 16
(3,368 Views)

It is related to that thread, but if I put a while loop in, then the start.vi stops and starts instead of a smooth infusion or withdraw.

0 Kudos
Message 3 of 16
(3,361 Views)
0 Kudos
Message 4 of 16
(3,360 Views)

That's ridiculous. You want the wait to happen after the pump is programmed, correct? Then why would you create a separate state? The wait has to go after. You can use a simple Delay function. That would not allow you to interupt the wait, however. If you need that, then you would need a different design.

0 Kudos
Message 5 of 16
(3,351 Views)

I want the pump to run for a certain amount of time which is defined by the user. I don't know what you referring to.

0 Kudos
Message 6 of 16
(3,346 Views)

It's probably not smooth because you are reinitializing your VISA resource on every loop iteration.

 

What you need is a state machine.  The key states would be Initialize, Execute a step, wait, Close.  The wait statement is where you put your timer.  You can either return to the wait state if the time is not up, or go back to the Execute Step state if the timer is up and execute the next step out of your array.   All of this is in one while loop.

0 Kudos
Message 7 of 16
(3,344 Views)

Can I furnish a state machine with the layout that I have now or should I restart?

0 Kudos
Message 8 of 16
(3,340 Views)

@Mike227 wrote:

I want the pump to run for a certain amount of time which is defined by the user. I don't know what you referring to.


That does not surprise me.

0 Kudos
Message 9 of 16
(3,339 Views)

What?

0 Kudos
Message 10 of 16
(3,333 Views)