07-23-2012 12:01 PM
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!
07-23-2012 12:14 PM
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.
07-23-2012 12:24 PM
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.
07-23-2012 12:25 PM
Here is the VI
07-23-2012 12:36 PM
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.
07-23-2012 12:39 PM
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.
07-23-2012 12:39 PM
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.
07-23-2012 12:46 PM
Can I furnish a state machine with the layout that I have now or should I restart?
07-23-2012 12:46 PM
@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.
07-23-2012 12:48 PM
What?